ORM
Rebuni Tech TeamObject–relational mapping (ORM, O/RM, and O/R mapping tool) in computer science is a programming technique for converting data between incompatible type systems using object-oriented programming languages.

Object-Relational Mapping (ORM) is a technique that lets you query and manipulate data from a database using an object-oriented paradigm. When talking about ORM, most people are referring to a library that implements the Object-Relational Mapping technique, hence the phrase "an ORM".
This creates, in effect, a "virtual object database" that can be used from within the programming language. There are both free and commercial packages available that perform object–relational mapping, although some programmers opt to construct their own ORM tools.
By contrast, many popular database products such as SQL database management systems (DBMS) are not object-oriented and can only store and manipulate scalar values such as integers and strings organized within tables. The programmer must either convert the object values into groups of simpler values for storage in the database (and convert them back upon retrieval), or only use simple scalar values within the program.
Pros
- You write your data model in only one place, and it's easier to update, maintain, and reuse the code(saves a lot of time).
- A lot of stuff is done automatically and It abstracts the DB system, so you can change it whenever you want.
- It forces you to write MVC code, which, in the end, makes your code a little cleaner.
- Sanitizing; using prepared statements or transactions are as easy as calling a method.
Cons
- You have to learn it, and ORM libraries are not lightweight tools;
- It abstracts the DB. While it's OK if you know what's happening behind the scene, it's a trap for new programmers that can write very greedy statements, like a heavy hit in a
forloop.