Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications

Categories

🎓 Certifications
🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
CheatGrid
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications
LVLEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

ORM and Database Abstraction Tools Cheat Sheet

ORM and Database Abstraction Tools Cheat Sheet

Back to Backend Development
Updated 2026-05-28
Next Topic: RabbitMQ Message Broker Cheat Sheet

Object-Relational Mapping (ORM) frameworks bridge the gap between object-oriented programming and relational databases by abstracting SQL operations into type-safe, language-native code. ORMs handle schema management, query generation, and data mapping automatically, enabling developers to work with database records as objects while the framework manages connection pooling, transactions, and query optimization. The key mental model: ORMs trade some performance and control for developer productivity and type safety, but understanding when to use eager loading vs lazy loading, how to prevent N+1 queries, and when to drop down to raw SQL separates effective ORM usage from performance disasters. In 2026, the landscape has matured dramatically — Prisma 7 dropped its Rust engine for pure TypeScript, Drizzle dominates edge/serverless, and standalone SQL query builders like Kysely offer type safety without ORM abstraction overhead.

What This Cheat Sheet Covers

This topic spans 16 focused tables and 119 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Popular ORM FrameworksTable 2: Core ORM PatternsTable 3: Basic CRUD OperationsTable 4: Defining RelationshipsTable 5: Query OperationsTable 6: Aggregation FunctionsTable 7: Eager vs Lazy LoadingTable 8: N+1 Query ProblemTable 9: Schema MigrationsTable 10: TransactionsTable 11: Performance OptimizationTable 12: Raw SQL vs ORMTable 13: Soft Deletes and Automatic TimestampsTable 14: Advanced ORM FeaturesTable 15: Testing with ORMsTable 16: Edge and Serverless ORM Deployment

Table 1: Popular ORM Frameworks

The ORM ecosystem spans every major backend language, with different tools optimizing for developer experience, SQL transparency, performance, or edge-runtime compatibility. The right choice depends on your language ecosystem, team SQL fluency, and deployment target — not benchmark marketing.

FrameworkExampleDescription
Prisma
const user = await prisma.user.findUnique(
{ where: { id: 1 } }
)
• Schema-first ORM for TypeScript/Node.js with generated type-safe client, Prisma Studio, and Prisma Migrate
• Prisma 7 removed the Rust query engine — now pure TypeScript: 90% smaller bundle, 3x faster queries, edge-compatible
• supports PostgreSQL, MySQL, SQLite, MongoDB, SQL Server, CockroachDB.
Drizzle ORM
const users = await db.select()
.from(usersTable)
.where(eq(usersTable.id, 1));
• SQL-first TypeScript ORM with zero codegen step — schema defined in TypeScript, types inferred instantly on save
• edge-native (Cloudflare Workers, Vercel Edge, Deno); two APIs: SQL-like Select API and higher-level Query API
• minimal bundle (~12 KB gzipped), zero dependencies.
Kysely
const user = await db
.selectFrom('users')
.select(['id', 'name'])
.where('id', '=', 1)
.executeTakeFirst();
• Type-safe SQL query builder for TypeScript — not a full ORM; compile-time type checking on every table, column, join, and alias
• zero dependencies, runs everywhere (Node, Deno, Bun, Cloudflare Workers); built-in migration primitives via kysely-ctl.
TypeORM
@Entity()
class User {
@PrimaryGeneratedColumn()
id: number;
}
• Decorator-based ORM for TypeScript/JavaScript supporting both Active Record and Data Mapper patterns
• broad database support including Oracle; still widely used in NestJS enterprise codebases, but losing ground to Drizzle/Prisma for greenfield projects.
MikroORM
user.name = 'Alice';
await em.flush();
• Data Mapper + Unit of Work ORM for TypeScript — automatically batches entity changes into a single transaction on flush()
• Identity Map ensures each entity loads once per request; strong TypeScript support with composite keys and polymorphism.
Sequelize
const User = sequelize.define('User', {
name: DataTypes.STRING
});
• Mature promise-based ORM for Node.js with model definitions, hooks, transactions, and migrations
• supports PostgreSQL, MySQL, MariaDB, SQLite, MSSQL; widely used but less type-safe than Drizzle or Prisma.

More in Backend Development

  • OAuth 2.0 and Authorization Flows Cheat Sheet
  • RabbitMQ Message Broker Cheat Sheet
  • _Elysia_Framework_for_Bun
  • Backend Error Handling and Recovery Patterns Cheat Sheet
  • Express.js Cheat Sheet
  • Laravel PHP Framework Cheat Sheet
View all 53 topics in Backend Development