Skip to content
whichdevtool?
Categories ▾

Frameworks and UI

Frontend and full-stack frameworks Backend frameworks UI component libraries

Hosting

VPS and cloud servers App hosting and PaaS

Data

Managed databases File and object storage ORMs and database toolkits

AI

AI model APIs

Email

Transactional email APIs Email marketing and newsletters

Payments

Payments and billing

Domains and edge

Domain registrars CDN, DNS and edge security

Operations and identity

Monitoring, uptime and error tracking Auth and identity Background jobs, queues and workflows
Stacks Directory
Ctrl K

Search directory
Menu
StacksDirectory Pricing changes Glossary
VPS and cloud servers App hosting and PaaS Managed databases Transactional email APIs Email marketing and newsletters Domain registrars CDN, DNS and edge security Monitoring, uptime and error tracking Auth and identity Frontend and full-stack frameworks Backend frameworks UI component libraries AI model APIs File and object storage Payments and billing Background jobs, queues and workflows ORMs and database toolkits
  1. Home
  2. ORMs and database toolkits
  3. Doctrine ORM
DO

Data mapper ORM for PHP · by Doctrine Project

Doctrine ORM

PHP's main data mapper ORM, built on the Doctrine DBAL, with a unit of work, DQL query language inspired by Hibernate, and the default persistence layer in Symfony.

Visit doctrine-project.org ↗ Alternatives Open source Open source Self-hostable
doctrine-project.org
Doctrine ORM homepage
§1

Overview

Doctrine ORM has been developed since 2010 in its current repository and is the object-relational mapper behind most Symfony applications. Entities are ordinary PHP classes mapped with attributes or XML; an EntityManager loads them, tracks changes in a unit of work, and writes everything on flush(). Queries are written in DQL, an object-oriented SQL dialect inspired by Hibernate's HQL, through a QueryBuilder, or in native SQL.

The ORM sits on the Doctrine DBAL, which provides platforms for MySQL, MariaDB, Oracle, SQL Server, PostgreSQL, Db2 and SQLite. Schema versioning is handled by Doctrine Migrations, a separate package for versioning the schema and deploying changes; Symfony integrates both through DoctrineBundle and DoctrineMigrationsBundle.

The project maintains several lines at once: 3.7 and 2.20 are the stable series on the project page, with 3.8, 2.21 and 4.0 listed as upcoming. The 2.x line is still maintained for applications that have not moved to 3.x.

§2

Pricing and plans

Plan Price What you get
Doctrine ORM $0 MIT licence

Free and open source under the MIT licence; there is no paid product.

Source: www.doctrine-project.org/projects/orm.html · prices as published, excluding tax.

§3

What it does

Unit of Work
Changes to managed entities are computed and written in one flush, in dependency order.
DQL and QueryBuilder
Object-oriented query language plus a fluent builder; native SQL available with result mapping.
Attribute mapping
Map entities, associations, embeddables and inheritance with PHP attributes or XML.
DBAL
Database abstraction with platform classes for MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle and Db2.
Doctrine Migrations
Separate package that versions the database schema and deploys changes.
§4

Strengths and limitations

Strengths

  • Plain PHP entities keep domain code free of persistence base classes
  • Mature and deeply integrated with Symfony
  • Supports Oracle, SQL Server and Db2 as well as open-source databases
  • Long-maintained 2.x and 3.x lines for gradual upgrades

Limitations

  • More concepts to learn (EntityManager, unit of work, proxies, flush) than Active Record ORMs like Eloquent
  • Migrations require the separate Doctrine Migrations package
  • More than 1,300 open GitHub issues
  • Upgrading from 2.x to 3.x involves breaking changes
§5

Who it suits

Good for

  • Symfony applications
  • PHP projects with complex domain models
  • Enterprise PHP on Oracle or SQL Server

Look elsewhere if

  • Laravel apps, which use Eloquent
  • Small scripts where a query builder is enough
§6

Alternatives to Doctrine ORM

Tool From Free option Stages
EF
Entity Framework Core .NET ORM
— Open source
OO
jOOQ Type-safe SQL builder for the JVM
€12/mo Free tier
SQLAlchemy Python SQL toolkit and ORM
— Open source
AR
Active Record (Rails) Active Record ORM for Ruby on Rails
— Open source
EO
Eloquent ORM Active Record ORM for Laravel
— Open source
En
Ent Code-generated Go entity framework
— Open source

All ORMs and database toolkits →

§7

Questions

Doctrine vs Eloquent: what is the difference?

Doctrine is a data mapper with a unit of work and plain PHP entities; Eloquent uses the Active Record pattern where models save themselves.

How do migrations work with Doctrine?

Install the separate doctrine/migrations package, which versions your schema and applies changes; Symfony integrates it through a bundle.

Which Doctrine ORM version is stable?

The project page lists 3.7 and 2.20 as stable, with 3.8, 2.21 and 4.0 upcoming.

Sources read for this page

  • https://www.doctrine-project.org/projects/orm.html
  • https://github.com/doctrine/orm
  • https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/platforms.html
  • https://www.doctrine-project.org/projects/migrations.html
Spec sheet
From
Open source
Free tier
Free to self-host
Stages
HobbyIndieStartupScale-upEnterprise Suits indie, startup, scale-up, enterprise
Language
PHP 8.1+
Approach
Full ORM (Data Mapper, Unit of Work)
Databases
MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle, Db2
Migrations
Yes, via the separate Doctrine Migrations package
Open source
Yes
Self-host
Yes
EU data
Not stated
Category
ORMs
Visit doctrine-project.org ↗

To report an out-of-date price or limit, use the correction form.

whichdevtool?

Developer and cloud tools compared on price, free tier and limits, each with its source. For side projects, solo developers and small teams.

Categories

  • VPS and cloud servers
  • App hosting and PaaS
  • Managed databases
  • Transactional email APIs
  • Email marketing and newsletters
  • Domain registrars
  • CDN, DNS and edge security
  • Monitoring, uptime and error tracking
  • Auth and identity
  • Frontend and full-stack frameworks
  • Backend frameworks
  • UI component libraries
  • AI model APIs
  • File and object storage
  • Payments and billing
  • Background jobs, queues and workflows
  • ORMs and database toolkits

Research

  • Directory
  • Stacks by project
  • Developer news
  • Pricing changes
  • Glossary

Site

  • About and methods
  • How we make money
  • Suggest a tool or fix
  • Privacy
© 2026 whichdevtool.com Prices change. Each tool page links to its source. We may earn a commission when you sign up through links on this site. How we make money