Comment on Eradicating N+1s: The Two-Phase Data Load and Render Pattern in GoparentComments−Tarean2yOrm's do a lot for you if you require related data from multiple tables:- Eager loading the data efficiently is annoying, most ORM's can do batched select-in loading now- Detecting changes with the DB is annoying if you update more than a single row, requires change tracking or a diff- Saving changes is a topo sort so you don't delete while foreign keys exists. Also, gotta wait for a foreign key to exist when a new row is insertedBut just let me tell the ORM a spanning tree of the schema and load that! Why do all ORM's default to cyclic object graphs and lazy loading.
Comments
Orm's do a lot for you if you require related data from multiple tables:
- Eager loading the data efficiently is annoying, most ORM's can do batched select-in loading now
- Detecting changes with the DB is annoying if you update more than a single row, requires change tracking or a diff
- Saving changes is a topo sort so you don't delete while foreign keys exists. Also, gotta wait for a foreign key to exist when a new row is inserted
But just let me tell the ORM a spanning tree of the schema and load that! Why do all ORM's default to cyclic object graphs and lazy loading.