Archives


Master Symfony2 fundamentals

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).
trainings.sensiolabs.com

Symfony hosting done right

ServerGrove, outstanding support at the right price for your Symfony hosting needs.
servergrove.com

L'audit Qualité par SensioLabs

200 points de contrôle de votre applicatif web.
audit.sensiolabs.com

Fabien Potencier
Doctrine vs Propel
by Fabien Potencier – December 07, 2009 – 45 comments

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.

Add a Comment

You must be connected to post a comment.

Comments RSS

  • gravatar
    #1 mathieu said on the 2009/12/07 at 09:43
    I choose Doctrine :)
  • gravatar
    #2 PaulK said on the 2009/12/07 at 09:46
    Gee, I was under the impression that switching from Propel to Doctrine was the right thing to do, but indeed, it is a huge task. Even though my project isn't that large, it has already taken up many hours. Still I believe Doctrine has a bright future ahead, so I'll just soldier on!
  • gravatar
    #3 leopard said on the 2009/12/07 at 10:03
    I like both - Propel and Doctrine. But more use Propel :)
  • gravatar
    #4 Keri Henare said on the 2009/12/07 at 10:07
    We won't be migrating any projects from Propel to Doctrine but we start all new projects with Doctrine.
  • gravatar
    #5 Alex de Azevedo said on the 2009/12/07 at 10:47
    I used to love propel, but I think that's Doctrine is the future.. so new projects with Doctrine!
  • gravatar
    #6 Jesse said on the 2009/12/07 at 10:58
    I was hoping from the title that this would be a benchmarking post. Let me know if you want to put those together and demonstrate which ORM actually performs better.
  • gravatar
    #7 altralize said on the 2009/12/07 at 11:06
    Doctrine my friend Doctrine forever and ever.... :)
  • gravatar
    #8 Daniel said on the 2009/12/07 at 11:08
    Fabien, why not put up a poll feature here on symfony project web page?

    Questions like these could be interesting to follow with a poll.
  • gravatar
    #9 Toni Uebernickel said on the 2009/12/07 at 11:16
    Propel :-)

    Ack @Daniel, Polls would be great!
  • gravatar
    #10 Fabien said on the 2009/12/07 at 11:21
    @Jesse: Benchmarking Propel vs Doctrine does not make much sense. I can easily make a benchmark to show you Propel is much faster, or that Doctrine is much faster. It really depends on your database schema, what you do with it, and how you use all the features at your disposal.
  • gravatar
    #11 Fabian Lange said on the 2009/12/07 at 12:50
    Regarding Benchmarks, Roman has a good post here:
    http://www.doctrine-project.org/blog/php-benchmarking-mythbusters
  • gravatar
    #12 Akadiusz Tułodziecki said on the 2009/12/07 at 14:10
    Migrating to Doctrine with big project is not easy task. Second problem is benchmark. I don't know witch lib is faster I think that when Doctrine 2.0 will be available than will be much better than Propel but to this time I'll use Propel.
  • gravatar
    #13 Frosty said on the 2009/12/07 at 16:05
    I choose plugin DbFinder, for compatibility.
  • gravatar
    #14 davide said on the 2009/12/07 at 16:14
    As a Propel fanboy, I don't like Doctrine. But it does have nice features... Propel will probably have them in the future, version 1.5 is under development. It just suffers the fact that the lead developer almost forgot about for a lot of time, before other developers took his place.

    @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?
  • gravatar
    #15 prodigitalson said on the 2009/12/07 at 16:33
    Call me crazy but i still MUCH prefer Propel to Doctrine. I do like alot of Doctrine's features (mainly its much better inheritance), and all my new projects will most likely use Doctrine. That said its not because i personally like using Doctrine, its just that going forward most plugins will most likely be developed for Doctrine and the best CMS plugins (Apostrophe, Sympal) are using Doctrine. Im going to miss using Propel :-)
  • gravatar
    #16 yureg said on the 2009/12/07 at 17:08
    Fabien, thanks for the stats. I expected such results. There have been some projects for Propel-to-Doctrine conversions recently over the Net.
    And what about writing an article about Propel vs Doctrine: strengths and weaknesses of both?
  • gravatar
    #17 Fabien said on the 2009/12/07 at 17:16
    @davide: I have already wrote/talked a lot about that. The core team will provide support for Doctrine 2 in Symfony 2.
  • gravatar
    #18 Massimiliano Arione said on the 2009/12/07 at 18:19
    I would like to give a "spoiler" here for all you Propel-fans: I'm working to implement all those missing Propel behaviors, migrating them from old symfony plugin to Propel 1.5 branch. I'm planning to release a plugin compatible with Propel 1.4 (and so usable with current symfony versions)
  • gravatar
    #19 Ricky said on the 2009/12/07 at 18:55
    >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.

    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.
  • gravatar
    #20 Richtermeister said on the 2009/12/07 at 20:37
    Using the Jobeet popularity as a metric for Propel vs. Doctrine strikes me as similar to "news framing".. It's like saying "people are more interested in Tiger Woods than in global warming..
    - 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! :)
  • gravatar
    #21 xplo said on the 2009/12/07 at 20:50
    An ORM with both object (Propel Criteria) and sql-like (Doctrine HQL/DQL) support like hibernate for java would win.

    I ll stick with the object one until then =)
  • gravatar
    #22 Zuzanna said on the 2009/12/07 at 21:58
    Propel is much easier to use, hence less people need to read a book or tutorial about it. Doctrine is too complicated, so people need to read every book about it and still need to ask in the forum. :-)
  • gravatar
    #23 Lionel said on the 2009/12/08 at 09:29
    This post is a real shame!

    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!
  • gravatar
    #24 Broderix said on the 2009/12/08 at 09:38
    see what google.trends say:
    http://trends.google.com/trends?q=symfony+doctrine%2C+symfony+propel&ctab=0&geo=all&date=ytd&sort=1
  • gravatar
    #25 Fabien said on the 2009/12/08 at 10:10
    @Lionel: A shame? Read the post again. It's not about saying Doctrine is better than Propel, far from it. It's just about what newcomers use most with symfony today. A lot of people ask me this question again and again, and this post is just an answer based on the traffic on the symfony website. That's all. Nothing more. Using Propel or Doctrine is YOUR choice. There is no definitive answer.
  • gravatar
    #26 Nick said on the 2009/12/08 at 11:32
    +1 Propel.

    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.
  • gravatar
    #27 Steve said on the 2009/12/08 at 16:00
    I have always used Propel, but there seemed to be so much focus on Doctrine being the way forward so I gave it a try...

    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!
  • gravatar
    #28 rozwell said on the 2009/12/08 at 16:12
    It doesn't mean that more people uses Doctrine. It means that more (new?) people wants to learn about it.

    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.
  • gravatar
    #29 Gabo said on the 2009/12/08 at 16:47
    Doctrine Rocks
  • gravatar
    #30 romanb said on the 2009/12/08 at 16:52
    From reading the comments, the title of the post was probably a little unfortunate. Maybe "Doctrine vs Propel Jobeet Traffic" would've been a bit better. Its just new water on the wheels of endless and senseless "propel vs doctrine" discussions.

    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.
  • gravatar
    #31 chris said on the 2009/12/08 at 18:14
    not sure how many of you know this but Mr Francois Zaninotto is now taking over propel development http://propel.posterous.com/

    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
  • gravatar
    #32 joaquin nunez said on the 2009/12/08 at 18:24
    it's a difficult topic.

    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
  • gravatar
    #33 Celal Barış Özdemir said on the 2009/12/09 at 02:30
    I am a big fun of Propel and I find it so much easier to use than Doctrine. Uprising traffic of Doctrine does not mean so much. I am getting afraid as I see Propel losing attraction.
  • gravatar
    #34 sadaf said on the 2009/12/10 at 12:34
    i worked with both and found doctrine easier.
  • gravatar
    #35 jL said on the 2009/12/13 at 06:56
    I gotta say: Propel has a lot of strengths, and I'm saddened to have heard of its deprecation.

    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.
  • gravatar
    #36 Javier said on the 2009/12/13 at 22:17
    Instead of asking or compare which one would be the best ORM, I would like to ask for a post about which one is the right ORM for a specific situation. A post explaining this will be more usefull for new people (like me).
  • gravatar
    #37 Tito Miguel Costa said on the 2009/12/13 at 23:39
    Propel, definately ;) but Doctrine will be symfony first choice in the future, i suppose.
  • gravatar
    #38 saganxis said on the 2009/12/14 at 15:58
    @jL: agree with you
    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...
  • gravatar
    #39 east3rd said on the 2009/12/15 at 01:38
    IMO, DbFinder offers a much better interface than both Propel and Doctrine. It's the first plugin I install for every new project.
  • gravatar
    #40 SidGBF said on the 2009/12/16 at 16:30
    The only reason that I use Doctrine is that symfony team will not offer support for Propel. Propel will work with sf, but that doesn't mean that will have the same support and quality.
  • gravatar
    #41 puentesdiaz said on the 2009/12/17 at 16:28
    Is impossible join both ORM ??? i ´ll be crazy with this Debate!
  • gravatar
    #42 makhz said on the 2009/12/20 at 05:48
    What about the dbdesigner to doctrine support (xml or yml) like the Dbdesigner to propel plugin?

    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 ? ;_;
  • gravatar
    #43 ugg bootsq said on the 2009/12/26 at 04:23
    I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.so you also can read my website,if you like




  • gravatar
    #44 ugg boots said on the 2009/12/26 at 04:25
    I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.so you also can read my website,if you like
    <a href="http://www.uggprovide.com/">ugg boots</a> or want to buy
    <a href="http://www.purchaseuggboots.com/">ugg boots</a>,welcome to my website: http://www.uggprovide.com/ or http://www.purchaseuggboots.com/



  • gravatar
    #45 ugg boots said on the 2009/12/26 at 04:26
    I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.so you also can read my website,if you like [url=http://www.uggprovide.com/]ugg boots[/url]
    [url=http://www.uggprovide.com/]ugg online[/url]