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) Beta (1.3) Beta
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)
-Fast (replaced 1.2.x bottleneck (Creole) with PDO
-Code completion available in IDEs (non-magic methods)
-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)
-No support for 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
-Beta
-Plugin
-No 1.0 release yet
-Uses magic methods in PHP, meaning no code completion for database properties

Conclusion

  • 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 that 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.