EF Core vs Marten and Polecat: Choosing the Right .NET Data Tool
In .NET development, EF Core remains the default ORM for genuinely relational data — such as tables queried independently or schemas shared across services — but it adds complexity when used to model aggregates like orders with nested items and addresses. Tools like Marten (for PostgreSQL) and Polecat (for SQL Server) store entire domain objects as JSON documents in the same database already in use, eliminating the need for a separate document database. The common pain points of EF Core overuse include growing Include chains, AsSplitQuery workarounds, and frequent migrations for unsettled schemas — symptoms that suggest a document model may be more appropriate. With a document session, an aggregate is loaded by ID, modified, and saved in a single commit, avoiding the mapping overhead EF Core requires to reassemble a unified domain object from relational tables. The core guidance is to use EF Core where data is truly relational and reach for Marten or Polecat where the domain naturally treats an object as one cohesive unit.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in