What exactly is the difference between ORM and micro ORM?

dapper difference entity-framework-6 micro-orm orm

Question

Please mention the difference between (big) ORM and micro ORM. What are the advantages of micro ORM over big ORM. For eg. the difference between entity framework ORM and dapper micro ORM.

1
8
1/16/2018 10:12:16 AM

Expert Answer

They are simply different tools. The key goal of micro-ORMs is to remove a lot of layers that an awful lot of data access code doesn't need - basically providing a minimal API surface and trying to balance that by offering the performance benefits that can come from simplicity. For example, things that you would expect to find in an ORM but might not be available in a micro-ORM include (depending on the specific tool being used, and the additional extension libraries being brought on):

  • lazy loading of child members (perhaps via polymorphic runtime type generation, perhaps via code-gen)
  • identity tracking
  • change tracking
  • a rich complex mapping system that supports arbitrary data models on multiple backend databases
  • complex query generation from complex LINQ expression trees or some other DSL
  • a unit-of-work API - essentially a SubmitChanges() method that figures out and applies a batch of related changes

Note that they aren't mutually exclusive: you can use both approaches in the same code-base, depending on what you need in different places.

8
1/16/2018 10:56:07 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow