Doctrine vs Propel
December 7, 2009
•
Published by
Fabien Potencier
![](/uploads/assets/stats_jobeet.png)
Now that symfony 1.4 is out, it's time again for me to answer a lot of questions about which ORM people need to use. I don't have a definitive answer, but today, I want to share some numbers with you.
First, let me re-iterate that both Doctrine and Propel are equally
supported
in symfony 1.X. And thanks to the new installer feature of symfony 1.4,
choosing between one or the other is just a matter of passing the --orm
option when creating a project:
$ php symfony generate:project foo --orm=Doctrine
$ php symfony generate:project foo --orm=Propel
As for any Open-Source community, it's not easy to find metrics that tell you what people use and how they use it. You can measure the number of tickets for a specific feature, count the number of people asking for help on Propel or Doctrine. But for the Propel vs Doctrine question, we have two more reliable metrics.
First, the traffic on the Jobeet tutorial. The Jobeet tutorial is available for both Propel and Doctrine, and is the most popular piece of documentation for newcomers. As you can see on the graphic on the side, Doctrine has became the most popular ORM in June 2009, and going strong since then.
We can also compare the number of "Practical symfony" books sold during since the beginning if 2009. The difference between Propel and Doctrine is much more important, as we sell approximately five times more Doctrine books than Propel ones.
Choosing between Propel and Doctrine is really a matter of taste. Both have great features and also some weaknesses. But after you make your choice for a project, stick with it. Migrating from Propel to Doctrine or the other way around is just a huge task.
Help the Symfony project!
As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.
Questions like these could be interesting to follow with a poll.
Ack @Daniel, Polls would be great!
http://www.doctrine-project.org/blog/php-benchmarking-mythbusters
@fabien This post does not clear things up about the future of Propel in symfony 2. Will it still be dropped, now that is being developed again?
And what about writing an article about Propel vs Doctrine: strengths and weaknesses of both?
Yes, but the Jobeet tutorial used to have a link to the propel version from the homepage. At some point that changed to the jobeet version. I think a better test would have been for the link to go to a page where you could choose which version of the tutorial you wanted to view.
- not neccessarily true, but reflective of the coverage the news outlets are offering. Similarly, Doctrine is being promoted as the "official" ORM for symfony, and newcomers are being told that it's the safer bet for the future. Naturally they'll seek out Doctrine tutorials more, but it doesn't reflect an educated choice based on actual preference.
What puzzles me a little is why the choice of ORM is becoming such a big deal. Propel used to be the default ORM, and yet Doctrine was not neglected. Similarly I'd imagine when Doctrine becomes the default, Propel won't be forgotten about either. "Competition" is good! :)
I ll stick with the object one until then =)
I can't understand why Fabien use so weak arguments ("look, propel is going down, doctrine is going up...").
I think making a choice between propel and doctrine is a serious question, and must have serious responses (benchmark, functionnalities, evolution, etc.): give use links, that's usefull!
http://trends.google.com/trends?q=symfony+doctrine%2C+symfony+propel&ctab=0&geo=all&date=ytd&sort=1
As others have said above, I find Propel requires less documentation reading than Doctrine to get going. Propel seems more intuitive, whereas when I tried doing simple things with Doctrine, I found myself spending a long time sifting through the documentation.
Doctrine's inheritance looks really good, and hopefully Propel 1.5 can support this and other features found in Doctrine but currently missing in Propel.
I haven't voiced my opinion about this before, but the fact that Propel will not officially be supported by the "core team" in Symfony 2 has unsettled me.
Just over one year ago, Propel was the officially supported ORM in Symfony. Next year it will be Doctrine. What about 2 years after that? Investing resources into something that potentially may not be officially supported in the near future does not help in getting a good night's sleep.
Although powerful, it seemed like a step backwards! Suddenly I was having to put table names into queries, remembering table structures and lots more stuff which Propel would take care of me.
My conclusion would be that Propel is easier to learn, more intuitive and does most of the simple stuff so well. If you need more from your application, things such as table inheritance and behaviours in Doctrine suggest that it may be worth learning that. That's just my opinion though!
Propel is with symfony from the beginning and most users already know how it works so.. theres no reason to read it again.
I'm currently using Propel (with sf 1.2.10) and I'd like to see some specific benchmarks about resources and performance.
And oh! I'm going to read Jobeet Doctrine tutorial only because I'm curious for it. But I'm still using propel.
Propel and Doctrine are not really very similar. And Doctrine 2 is a whole new game and makes it even more difficult to compare them. Then it's like comparing Apache Torque and Hibernate. Both useful, but each with an entirely different approach and good for different things, depending on the project.
"Suddenly I was having to put table names into queries".
Not sure what project you used, but it wasnt Doctrine.
Hell, use whatever you want. If you feel comfortable and happy with Propel, thats great, wonderful, splendid, etc. but don't try to make it look superior to something else that you dont know equally well or dont event understand (yet). Just use it and be happy.
Most of the difficulties, annoyances, frustrations, etc. that I've seen in the php world with regards to using ORM tools is just a result of not knowing what they're good for in the first place. Thats probably because many people think they somehow "must" use them, since others use them. Then they get frustrated because they dont really understand how this thing is supposed to be used. You're really doing yourself and the developers of these projects a great disservice if you're using these tools without knowing what you want them to do for you or what they're good for at all.
To be fair, I see this problem often in the java world, too. People getting frustrated with Hibernate & co because they just dont understand the purpose but started using it because others do. All these people are much better off with avoiding these tools until they see the need themselves in some project.
Here's a recommendation: If you're really interested in the topic of object-relational mapping / relational object persistence, look beyond PHP and Rails ActiveRecord. It will give you a whole new level of insight. If you dont want or dont have the time to do that, then stop trying to compare and judge these projects based on so little knowledge. Just use them, or not.
some of you may remember how much of an impact francois had in symfonys early days (documentation, plugins, support etc etc) before the "epic fallout" http://redotheweb.com/
In his recent involvement with propel he has already released a new version (1.4) and blogged about the changes for the yet to be released 2.0
Propel has a bright future and this is one fella to watch, so i'll be sticking to propel
as many people said before me, the post's name is not correctly selected, this is only traffic and if we think that the default link is pointing to the doctrine tutorial isn't totally true to say that doctrine is capturing more attention.
on the other hand like xplo have said before, we need 1 orm library that implement the two ways to use a db.
so, pls don't put meaningless post like this one
saludos
For starters, I'm generally displeased with Doctrine's DQL. That said, I'm certainly aware that many people find Propel's Criteria-based approach a bit maddening. And I get that. So I'm willing to chalk this disparity up to a "taste" issue.
One thing that's really fantastic about Propel is the fact that the base model classes it generates actually have their accessors and mutators declared as plain old PHP functions, rather than Doctrine's approach of using the "magic" _set() and _get() approach (please, someone tell me if I've overlooked an option in Doctrine that accomplishes this).
There are two (related) really good things that you get as a result of Propel's approach: 1) code completion when using an IDE, and 2) all accessors and mutators show up in phpdoc.
This makes a HUGE difference in projects with larger model APIs.
Propel is easy to get documented and is better when using an IDE. How can Doctrine compete with that?
Agree with most of you that the title of this blog post is not suitable at all with the content.
Besides I don't like the attitude of push down Propel in favour to doctrine like the introduction to the 14 day of the More with symfony book when it says "The Doctrine 1.2 project became the new default symfony ORM library both because it is easier to use than Propel". Don't understand which is the point of this and why are you so competitive when Propel was the default ORM for to many years...
I'm working with huge projects (30-60 tables in my dbs) and is really hard to update it in yml (doctrine project) and very easy in xml (propel projects).
Will be Symfony 2 compatible with Propel ? ;_;
ugg boots or want to buy
ugg boots,welcome to my website: http://www.uggprovide.com/ or http://www.purchaseuggboots.com/