Doctrine – PHP Object Relational Mapper

ORM is certainly a very popular concept these days, but I haven’t really come across any PHP implementations that I found worth-while. Sure, big frameworks like CakePHP may have ORM functionality, but I’m not a fan of huge frameworks. I’ve also dabbled in my own implementations, but never got too far, as I’m not a fan of re-inventing the wheel. At any rate, I stumbled across Doctrine by accident (good ol’ RSS readers), and am impressed, mostly because it’s something that can be integrated into existing projects / frameworks.
www.doctrine-project.org

Other's Thoughts   (3 so far...)


  • Phillip Harrington
    May 21 '09 at 8:42 am

    I too have been in the same spot – not wanting to use a huge framework every time – but not wanting to write my own. I’ll definitely check out doctrine. Thanks for the tip.


  • Faizan
    Jan 16 '10 at 9:44 pm

    I’m now using doctrine for a year now. I’ve used it with symfony and codeigniter, and it is best PHP ORM


  • hafij
    Aug 3 '10 at 6:14 am

    Here I must share something. I have worked on many several frameworks and many different orm. But there is no such thing best out of those. As you rightly pointed out that a framework with huge load is not good at all. In my project that I am working on, the total number of users are more than 50 thousands and the total number of images are more than 2 milion. Given this situation you have to pick very lightweight orm system. The conditions are,

    1. No foreign key relationship. (Your code must handle it).
    2. Standalone table is just a standalone class.
    3. You can have up to 2nd or 3rd order of normalizaion for you database. (Less join means more speed, less constraint means less overhead).
    4. Never load associate object all together what cakephp does.
    5. Its really a pain to have xml or yml file to maintain database stuff.
    6. Doctrine is not simple at all.

    Now think about any mvc framework. Any framework must give a standard but without magical stuff. Such as validators, helpers etc. This is really bad if you think about a site with huge number of request every time. Go and visit http://phpwebpad.hafij.com.

  • Share Your Thoughts...

    Some HTML is ok. If this is your first comment on my site, it will be reviewed before being posted publicly. Your comment may be edited or marked as spam if it appears intended for SEO purposes.