Skip to main content

Glossary

ORM

Meaning and details

An ORM translates between two worlds: rows in a relational database and objects in your programming language. You manipulate a User object and call save; the library emits the SQL. Prisma, Drizzle and Eloquent are the cu...

ORM meaning

An object-relational mapper: a library that maps database rows to objects in your language, so you query with code instead of raw SQL.

What is ORM?

An ORM translates between two worlds: rows in a relational database and objects in your programming language. You manipulate a User object and call save; the library emits the SQL. Prisma, Drizzle and Eloquent are the current favorites in the TypeScript and Laravel worlds, and every major language ships one.

Why it matters to an indie builder: an ORM removes a whole class of busywork, connection handling, parameterized queries, migration boilerplate, and makes the data layer type-safe and reviewable in the same language as the rest of the app. The genuine cost is abstraction leakage: the day you need a query the ORM cannot express well, you must drop to raw SQL anyway, so the skill you deferred comes due.

A concrete example: a subscription feature. With the ORM: define a Subscription model with relations to User and Plan, call subscribe with a typed object, and migrations for the new table generate from the schema change. Roughly an hour, type-checked end to end. Without one: hand-write the migration, hand-write parameterized inserts in three places, and keep them in sync forever. The ORM pays for itself the first week and every week after.

Common mistakes: the N+1 query, fetching a list then touching a relation per item, one query becomes a hundred, and the page mysteriously takes nine seconds (every ORM ships an eager-loading fix; learn it first), trusting inferred schema drift instead of versioned migrations, treating the ORM as a reason not to learn SQL (the abstraction breaks precisely when you cannot read the query it made), and reaching for raw SQL strings with interpolation, reintroducing the injection risk the ORM removed. The orm-adjacent packages on IndieBoot, Prisma and Drizzle side by side, show how close the modern choices are.

Keep exploring the glossary