ORM, or Object‑Relational Mapping, is a technique that lets developers interact with a relational database using objects in their programming language. It abstracts SQL behind methods and properties, so you can create, read, update and delete records without writing raw queries.
Also called: Object‑Relational Mapping
Why it matters
Using an ORM speeds up development and reduces the chance of errors, meaning a client gets a site built faster and easier to maintain, which lowers long‑term costs and keeps the site reliable as data requirements evolve.
How it works
An ORM defines a mapping between database tables and classes, usually via configuration files or annotations. When the code accesses an object, the ORM translates the operation into the appropriate SQL, executes it through the database driver, and returns the result as an object instance.
The mistake people make
A common mistake is assuming the ORM will always generate optimal queries; developers often load related records lazily, which can cause many small queries to be sent to the database and slow the site.