menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

How I Scal...
source image

Medium

1w

read

376

img
dot

Image Credit: Medium

How I Scaled .NET APIs to 10K RPS Without Killing SQL Server (And Made EF Core 12x Faster)

  • Switching from ADO.NET to Entity Framework was like going from a typewriter to a MacBook, offering increased productivity and elegance.
  • However, as EF evolved into EF Core, the abstraction became a double-edged sword, being useful but not always predictable.
  • During a project for a logistics company, transitioning from a monolith to microservices, EF Core played a crucial role.
  • The legacy system was complex, with a heavy reliance on stored procedures, nested joins, and a lack of domain-data separation.
  • The team decided to rewrite modules from scratch using .NET Core, and EF Core was the preferred ORM for this task.
  • Choosing EF Core required a significant shift in mindset regarding how persistence was approached.
  • The author shares insights on scaling .NET APIs to handle 10,000 requests per second without overloading SQL Server.
  • By optimizing EF Core, the author managed to make it 12 times faster, improving performance significantly.
  • Strategies for optimizing EF Core performance included reducing unnecessary call chains and improving query execution.
  • Caching and batch processing were utilized to improve EF Core performance and reduce the load on the SQL Server.
  • Efficient use of database connections and minimizing round trips helped in scaling the .NET APIs effectively.
  • Adopting a hybrid approach combining Dapper and EF Core helped achieve better performance and scalability.
  • The author emphasizes the importance of understanding the trade-offs involved in ORM usage for database performance.
  • Overall, the article discusses strategies for enhancing EF Core performance and scaling .NET APIs effectively.
  • The journey from ADO.NET to EF Core showcases the evolution and challenges in modern ORM usage for high-performance applications.

Read Full Article

like

22 Likes

For uninterrupted reading, download the app