DELAPARRA
Index
Color
NL
Category: Core glossary

ORM (Object-Relational Mapper)

Explained by Updated

What is ORM (Object-Relational Mapper)?

ORM (Object-Relational Mapper): A library that translates between your application's objects and database tables, so you can interact with a database using your programming language rather than raw SQL. An ORM, or object-relational mapper, translates between database tables and objects in your code. Instead of writing SQL for every query, you work with classes like Order and methods like $order->customer.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about ORM (Object-Relational Mapper)

How is ORM (Object-Relational Mapper) used in practice?

Laravel's Eloquent, Doctrine for PHP, Prisma for Node and SQLAlchemy for Python are well-known examples. They speed up development, prevent SQL injection by using parameter binding, and make code easier to read.

What should you keep in mind with ORM (Object-Relational Mapper)?

The abstraction has costs. It is easy to trigger many small queries without noticing, such as loading each order's customer inside a loop. Eager loading with with() fixes that. For complex reports, writing the query directly or using the query builder is often clearer and faster. Learn to look at the SQL your ORM produces; tools like Laravel Debugbar or Telescope show it.

At a glance

CategoryCore glossary
Explained by
Updated

More Core glossary terms

All terms starting with O

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.