9 parts · 12 chapters

ORM Internals

You use an ORM daily, and it is a black box that writes your SQL. Opening it (identity maps, units of work, lazy loading, hydration) is how you stop being surprised in production by N+1 queries, unexpected locks and slow pages.

Nine parts following the syllabus: the impedance mismatch; core machinery; query building; Prisma; Drizzle; TypeORM, Sequelize, Kysely and MikroORM; the reference implementations (Hibernate, ActiveRecord, SQLAlchemy, Django ORM); ORMs at staff level; and a capstone that builds an ORM.

the impedance mismatch · core machinery · query building · Prisma · Drizzle · TypeORM, Sequelize, Kysely, MikroORM · Hibernate, ActiveRecord, SQLAlchemy, Django · ORMs at staff level · build your ownsenior → staff · backend and full-stack engineers who use ORMs daily
the mismatchObjects versus relations, Data Mapper versus Active Record.
machineryIdentity maps, units of work, dirty checking, lazy loading, N+1.
queriesFluent APIs to ASTs to SQL, parameter binding, hydration.
the JS ecosystemPrisma, Drizzle, TypeORM, Sequelize, Kysely, MikroORM.
the referencesHibernate, ActiveRecord, SQLAlchemy, Django ORM.
at scaleProfiling, migrations, pooling, tenancy, testing, and the RFC position.
Built on SQL and the engine coursesAssumes SQL, The Language and the MySQL or PostgreSQL course. The language courses show Django ORM, Active Record and Hibernate in context.