If you’ve done any form of data manipulation on a relational database before, then you know how unpleasant it can be…writing long-boring queries to get little things done.
Object Relational Mapping (ORM) is a pretty neat technique that allows us to query and manipulate data stored in a relational database using an object-oriented approach.
ORM enables us to interact directly with the database using objects in an object-oriented language it supports. This means no more long SQL queries.
Behind the scenes, ORM’s implements something called a “Data Layer”. The data layer is typically a library written in the object-oriented language that is part or works together with your web framework of choice.
The data layer acts as a translator between the OO language and database and is able to handle translations between them.
It encapsulates the code needed to manipulate the data (using raw queries) and provides a set of APIs on objects to interact directly with the database.
In practice, we only use the APIs provided to us by the ORM to communicate with the underlying database. The way it handles translation or works under the hood is completed abstracted away from us.
This is just one of those computer science jargon that’s not too hard to understand at all.
Thanks for stopping by, see ya real soon.