1
I am architecting the development of a backend structure composed of microservices for a financial institution. Probably the biggest project I’ve ever worked on, and I’m having serious doubts about using Code First or Database First. We will use ASP.NET Core 3 with Microsoft SQL Server, all hosted on Microsoft Azure. This is an application that due to some business partnerships may already have a few million users guaranteed.
The practicality of the Entity Framework Core would be very interesting, mainly due to the speed in the development process (we have a tight timebox)however I have concerns about performance with queries automatically generated by the framework in an application with so many users.
In contrast a ORM seems to be something interesting when we don’t have all the business rules mapped out yet, and the database needs to track the progress of the application. I imagine that the Migrations of EF Core could make the process very practical, mainly because I am thinking of working with microservices.
Is there any material or whitepaper regarding the use of these techniques for high-volume applications? I am particularly leaning towards the use of code-first. There may be some obstructive reason in the mentioned scenario?
If performance is a ORM concern it shouldn’t be used, right? You need to choose which of the two to use. Core only has Code First, what you can do is import the DB model to write the code for you, but it still works as Code First. Its use makes a difference, the model not even because it is only a model of development and not of execution. Microservice can even scale up (almost always no need - you’re using one of the 30 most accessed sites in the world that runs monolith and can run on 1 server) but it slows everything down, and absurdly hard to do right, it’s horror show
– Maniero
I work with banking systems and micro services... I can say that any ORM is "banned" and most follow the CQRS. But... it depends on which operation is going to be done and which database... Here the set of solutions include Mongodb, SQL Server, Redis and etc... all of them on-premise and in the Clouds...
– Leandro Angelo
@Leandroangelo Thanks for the input. Do you work with the database first approach? What’s the main reason you banned ORMS? Is there any material, white paper or book that you can suggest me to better understand how DB-level operations are performed in this segment? I’m still opting for microservices because it can help a lot in our time to market, but I plan to use SQL Server to store all transactional user records. If you like, structure it as an answer I’ll gladly accept.
– adamasan
Basically the problem with Orms is that you are not 100% in control of your queries, transactions and modeling (code-first). There is no cake recipe, only good practice, but every need is a case. And in the end you will be restricted to the paradox of the theorem of CAP https://medium.com/system-design-blog/cap-theorem-1455ce5fc0a0
– Leandro Angelo