Doctrine Object Relational Mapper (ORM)
10.2k
Stars
2.5k
Forks
1.3k
Open issues
30
Contributors
AI Analysis
Doctrine ORM is a mature object-relational mapper for PHP 8.1+ that provides transparent object persistence through a database abstraction layer and proprietary DQL query language. It is specifically designed for PHP developers building server-side applications that need to map relational databases to PHP objects, and is not suitable for non-PHP environments or applications without relational database requirements.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Doctrine ORM: PHP's dominant object-relational mapper, still actively maintained after 15 years
Doctrine ORM maps PHP objects to relational database tables, providing transparent persistence, an identity map, lazy loading, and a proprietary query language (DQL) inspired by Hibernate's HQL. It is the de facto ORM for PHP's Symfony ecosystem and widely used in enterprise PHP applications. Multiple branches (2.x through 4.x) are simultaneously maintained, indicating a large, heterogeneous user base that cannot all migrate at once. It matters because the vast majority of PHP enterprise applications rely on it directly or through Symfony bundles.
Created in 2010, Doctrine ORM evolved from earlier PHP persistence experiments. It reached maturity with the 2.x series, became the default ORM in Symfony 2+, and has since undergone major cleanups in 3.x and 4.x to leverage modern PHP features.
Growth was driven primarily by Symfony's adoption of Doctrine as its recommended ORM. Stars grew steadily over the years but have plateaued — not because usage declined, but because the project is mature infrastructure that developers install without starring. Composer download numbers (not visible here) would tell a more accurate story than GitHub stars.
Doctrine ORM is a foundational dependency of the Symfony framework, which powers a large share of professional PHP applications globally. Packagist download counts historically exceed hundreds of millions. It is used by major PHP-based platforms, SaaS products, and enterprise systems. Adoption is extensively documented through ecosystem integration (Symfony, API Platform, etc.) and community size.
Likely follows a classical Data Mapper pattern with a UnitOfWork, IdentityMap, and EntityManager at the core. DQL is parsed into ASTs and translated to platform-specific SQL via DBAL. Appears to support multiple inheritance mapping strategies (single table, joined, class table). Multiple active branches (2.20, 2.21, 3.6, 3.7, 4.0) suggest careful semantic versioning and long-term support commitments.
CI badges for all five active branches are present and linked to Codecov, indicating automated coverage tracking. Actual percentage not documented in README, but the presence of per-branch Codecov badges on a project of this maturity strongly suggests substantial coverage.
Last push was 2026-06-16, roughly 10 days before the evaluation date — actively maintained. Five parallel branches receiving CI builds is an unusually strong maintenance signal. This is not a project in slow decline; it is actively backporting fixes and evolving the v4 line.
ADOPT IF: you are building PHP applications with Symfony, need robust domain modeling using Data Mapper pattern, or require long-term maintainability with complex relational schemas. AVOID IF: you are building simple CRUD applications in Laravel (use Eloquent instead), need high-throughput write performance without ORM overhead, or are starting a project outside the PHP ecosystem entirely. MONITOR IF: you are on Doctrine 2.x and need to plan migration timelines to 3.x/4.x as older branches will eventually reach end of life.
Independent dimensions
Mainstream potential
5/10
Technical importance
8/10
Adoption evidence
9/10
- The Data Mapper + UnitOfWork pattern introduces a steep learning curve; developers unfamiliar with the identity map and lazy-loading proxies frequently introduce N+1 query bugs or unexpected flush behavior.
- Migrating between major versions (2.x to 3.x to 4.x) has historically required significant effort, and maintaining five active branches simultaneously signals that a large portion of users remain on older versions.
- Doctrine's proxy-based lazy loading can cause issues with serialization, PHP 8.x readonly properties, and modern architecture patterns (e.g., readonly value objects in DDD), requiring workarounds.
- Performance in write-heavy or bulk-operation scenarios can lag behind raw DBAL or query builders; the ORM abstraction adds overhead that may be unacceptable at high scale without careful tuning.
- Dependency on the broader Doctrine ecosystem (DBAL, Annotations/Attributes, Cache) means updates to any component can introduce compatibility friction across large dependency trees.
Doctrine ORM will remain the dominant PHP ORM in the Symfony ecosystem for the foreseeable future. Version 4.x will gradually consolidate users as PHP 8.1+ becomes standard, while niche alternatives like Cycle ORM may capture a portion of greenfield projects.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- PHP
- License
- MIT
- Last updated
- 6h ago
- Created
- 198mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Top contributors
Recent releases
Similar repos
doctrine/mongodb-odm
Doctrine MongoDB ODM is the official PHP object-document mapper for MongoDB,...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
10.2k | — | PHP | 8/10 | 6h ago |
|
|
4k | — | PHP | 8/10 | 3w ago |
|
|
1.3k | — | PHP | 8/10 | 4w ago |
|
|
1.1k | — | PHP | 8/10 | 23h ago |
|
|
9.7k | — | PHP | 8/10 | 18h ago |
|
|
2.9k | — | PHP | 7/10 | 3d ago |
Eloquent uses Active Record pattern, which is simpler to learn but mixes persistence concerns into domain objects. Doctrine's Data Mapper approach offers cleaner domain modeling and is preferred for complex domain logic. Eloquent dominates in the Laravel ecosystem; Doctrine dominates in Symfony.
TypeORM targets Node.js/TypeScript and has more GitHub stars, reflecting the larger JS ecosystem rather than superior quality. Doctrine is more mature and battle-tested for complex relational mappings. Different language ecosystems; not direct competitors in practice.
Cycle ORM is a modern PHP ORM with a cleaner architecture and better support for async runtimes (e.g., RoadRunner). It is a genuine alternative for greenfield PHP projects but has a fraction of Doctrine's ecosystem and community support.
RedBeanPHP targets simplicity and rapid prototyping with automatic schema generation. It lacks Doctrine's depth for complex domain modeling, large-scale applications, or strict schema control. Appeals to different use cases.
Propel was a major Doctrine competitor in the 2.x era but has largely stagnated and lost community traction. It is no longer a practical alternative for new PHP projects.