Definition
Object-Relational Mapping — a programming technique that lets you interact with a database using objects and methods instead of raw SQL.
In Depth
ORMs like Django ORM, SQLAlchemy, and Prisma map database tables to classes, rows to objects, and columns to attributes. They handle query generation, type conversion, relationship loading, and SQL injection prevention. Trade-offs include performance overhead and the 'N+1 query problem.'
Example Usage
Using Django's ORM to query glossary terms: GlossaryTerm.objects.filter(category__slug='ai-ml', is_featured=True) instead of writing raw SQL.
Business Context
ORMs dramatically accelerate development by abstracting SQL, preventing injection vulnerabilities, and making code portable across database backends.
Related Terms
ACID Properties
Atomicity, Consistency, Isolation, Durability — the four properties that guarantee database transact...
Database Index
A data structure that speeds up query performance by creating a fast lookup path to rows based on sp...
Database Migration
A version-controlled change to a database schema — adding tables, modifying columns, or creating ind...
Database Normalization
The process of organizing database tables to reduce data redundancy and improve data integrity by fo...
Database Sharding
Horizontally partitioning data across multiple database instances, distributing load and enabling st...
Also Known As
Tags
Quick Info
Need help implementing this in your business?
Get Started