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.
What is the difference between ORM and micro ORM?
Asked Answered
This is bit different but may help: https://mcmap.net/q/405531/-why-entity-framework-performs-faster-than-dapper-in-direct-select-statement. This is about ADO.NET vs Dapper: https://mcmap.net/q/719678/-dapper-vs-ado-net-with-reflection-which-is-faster –
Jessikajessup
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.
But even with a micro-ORM you do have unit of work implemented by the db transaction. It's still an API even if it's ado.net. –
Dulin
@Dulin what I mean is: a unit of work automatically provided by some kind of change tracking with an "all or nothing" commit; in a micro-ORM, yes you can do all of that via a db transaction: but you need to do it yourself –
Hairy
© 2022 - 2024 — McMap. All rights reserved.