Development

ComparingPropelAndDoctrine

You must first sign up to be able to contribute.

Propel vs. Doctrine

The purpose of this page is to provide a concise, factual view of both major ORM's available for symfony. Both have pros and cons, let's try to avoid a flame war :)

Propel Propel Doctrine
Status - Version Stable (1.2.1) Stable (1.3) Stable 1.0.3
Underlying DBA Creole (coded in PHP) PDO PDO
Plus -Part of symfony core
-Stable
-Existing Symfony documentation
-Many Symfony plugins use propel
-Code completion available in IDEs (non-magic methods)
-Part of core since symfony 1.2
-Fast (replaced 1.2.x bottleneck (Creole) with PDO
-Code completion available in IDEs (non-magic methods)
-Part of core since symfony 1.2
-Fast (far fewer queries, and PDO retrieves resultsets faster)
-Supports inheritance
-Handles Many-to-Many relationships easily
-Supports arbitrary complex joins with a single statement
-Object population for arbitrary queries (no need for custom hydration functions)
Minus -Relies on pre-generated classes for joins
-Uses more queries to retrieve the same data
-Requires custom classes to retrieve datasets not predicted by class generation
-Verbose coding style (Criteria vs DQL)
-Supports inheritance
-No support for many to many relationships
-No cross-schema relationships
-Lacking Documentation
-The version shipped with symfony is based on Creole (which isn't actively developed)
-Plugin -Plugin
-Uses magic methods in PHP, meaning no code completion for database properties

Conclusion

  • In symfony 1.2 or better Doctrine 1.0 and propel 1.3 are included, providing two fast and stable implementations, so that choice can be made mainly on APIs available.
  • Doctrine has come leaps and bounds, and remains often easier to work with for 'complex' schema.
  • Propel's newest release (1.3) is in beta, but uses the same underlying technologies that Doctrine does (PDO), levelling the performance playing field. Rough benchmarks imply that for simple operations, Propel is faster. Although, for complex operations, Propel is notorious for using more queries than Doctrine, so Doctrine comes out on top. It comes down to what you're doing with it as to which is "right" for your project.

Propel 1.2 remains bundled with Symfony 1.0, and has a lot of useful plugins developed for it. If you're game, try Propel 1.3 or Doctrine and see how you go.


TODO Can we update this comparative with tha last release of PROPEL and DOCTRINE ??