title | updated | permalink |
---|---|---|
What is ORM? |
March 14, 2016 |
/faq/databases/orm/ |
ORM (Object-relational mapping), also known as O/RM, and O/R mapping is a programming approach for converting data between incompatible type systems.
Many full stack frameworks provide their own database abstraction approaches or ORMs.
Standalone database abstraction layers and ORMs to check out:
- Aura SQL - Extension to the native PDO along with a profiler and connection locator.
- DataMonkey - Database ORM for PHP build on top of Doctrine.
- Doctrine - Home to several PHP libraries primarily focused on database storage and object mapping. The core projects are a Object Relational Mapper (ORM) and the Database Abstraction Layer (DBAL) it is built upon.
- Eloquent - Illuminate Database component, used in Laravel framework but also a standalone component.
- Medoo - Light PHP database framework to accelerate development.
- Pomm - PHP Object Model Manager for Postgresql.
- Propel - A highly customizable and blazing fast ORM library.
- ProxyManager - Library that aims at providing abstraction for generating various kinds of proxy classes.
- RedBeanPHP - Easy to use ORM for PHP.
- safemysql - A real safe and convenient way to handle MySQL queries.
- Spot ORM - simple and efficient DataMapper built on Doctrine Database Abstraction Layer.
- Zend\Db - Zend Database Component.
There are mainly two main design patterns used in ORMs - Active Record and Data Mapper.
As some articles have pointed out (1, 2, 3), ORM is anti-pattern that violates principles of object-oriented programming.
Here are some other useful and updated resources to read or check as well:
- ActiveRecord and the Beauty Lost in Translation
- Lessql - Lightweight and efficient alternative to ORM for PHP.