4

in EntityFramework old version if I have a table DbSet more than 50, I would definitely separating using BoundedContext concept, because most of the tips and tricks that I got from some blog site, now my question how in .net core if I have 100 tables, whether EntityFrameworkCore can handle 100 table or more in a single DbContext, or did have in separating its performance in order to obtain its process load is not heavy. thanks.

1 Answer 1

2

Its not necessarily a performance issue as the DbContext uses IQueryable for your DbSets so each 'table' isnt materialized until you call ToList(), First(), etc. I have worked on projects (not my design) that have used over a 100 tables in a single context and the bottlenecks were never from a large DbContext. It just made the whole project unweildy and not something I would want to do again.

For larger projects whether its .net core or .net <=4.5 I would definitely go the bounded context route but structured from a DDD standpoint. Juli Lerman has written many blog posts about this and of course there is the blue book by Eric Evans which is the DDD bible.

Another DDD disciple is Jimmy Bogard where he expands on the DDD princples by delving into Value Objects, Aggregates, and Roots.

The short answer (too late) is that no, you don't have to worry about a 100 objects in your DbContext from a performance standpoint but by using DDD, Aggregates, Value Objects, Bounded Contexts, etc., you may find that the number of tables required will shrink and your project becomes much cleaner with greater separation of concerns.

1
  • thanks for your explaination.....I am agree with DDD and with separating CbContext by module.....I now using DDD dan Bounded Context concept....I just want to know the issue in .Net Core and EntityFrameworkCore about performance with large DbSet....now I have knowladge again about this....thanks for your time... Nov 22, 2016 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.