Doctrine 1 alternative

I’m working with a lot of projects that use Doctrine1. The ORM is ageing somewhat and has been criticised for its performance overhead. At my current job I have written a REST API that provides an easy means of interacting with Doctrine models, much like Ruby on Rails does. It works very well and performs beyond our current (and short to mid-term needs) but will hit a bottleneck with tens of thousands of requests per hour.

I’m looking for a faster ActiveRecord style ORM for PHP. So far I’ve investigated a number of alternatives, like phpActiveRecord, but all of the projects I’ve looked at are inactive and barely maintained. (Note to project developers, it’s not a good sign when your help forum is riddled with spam!)

Do you have a recommendations? Porting to Doctrine2 looks like a nightmare, especially the lack of public access to properties that persist to the DB, but given the lack of alternatives it may be the only way forward …


3 thoughts on “Doctrine 1 alternative

  1. younes0

    I’m also interrested in finding a new ORM Active Record library for my current project a Not a DataMapper one (which can be overkill on small projects(1))

    I used the Flourish(2) Active Record ORM which defines the tables relationships and properties according to the table schema and it’s nice: writing models is simple, you don’t need to write the basic validation rules and table relationships in the model constructor.
    But it seriously lacked flexibility in my experience, I had problems dealing records with complex relations: table related to a table related to another one / or multiple FK relationships… I would be still using this library if I could override the relations.
    I can’t you tell about performance. You may try it, since the setup is quick and the documentation great.

    Propel seems to be a great one but requires an extra build step, namely building the model classes (3).

    I found some active and new ORM on Github:
    https://github.com/jasonmoo/DumbledORM
    https://github.com/c9s/LazyRecord
    https://github.com/unlox775/SimpleORM-php
    https://github.com/miknatr/grace
    https://github.com/fguillot/picoMapper

    1: http://stackoverflow.com/questions/2169832/data-mapper-vs-active-record
    2: http://http://flourishlib.com/docs/ObjectRelationalMapping
    3: http://programmers.stackexchange.com/questions/48760/should-i-choose-doctrine-2-or-propel-1-5-1-6-and-why

    • David

      Thanks for all the info, I’ll be looking through these in more detail. I did look at Propel some time ago but the lack of PHP 5.3 support was a deal breaker for me. Propel 2 looks like a good potential option but who knows when it will be ready.

  2. younes0

    So I checked :

    – those ORM found on Github and they didn’t fit to all my needs (orm validation for example) and they will probably never be maintainted as much as the big ORMS Propel, Doctrine.

    – Propel 1.6 : this was too much work to me, you have to set up XML files to define your models and database settings then generate though CLI 7 classes per model, insane ! I understood that this step is required, I might be wrong ? I’m just saying that for my projects size, this was not worth it.
    If you try to setup Propel, I recommend you to do it through Composer.

    – Then there are those ORMs integrated with Full MVC Frameworks: FuelPHP and Laravel as first choices.
    Since I’m using my own framework, It took me sometime to get these integrated (especially Laravel which I finally avoided).
    I finally choosed FuelPHP and love it: http://net.tutsplus.com/tutorials/php/easy-form-generation-using-fuelphp/
    Those ORMS may be still young, but they offer many possibilities and an active community support.

    Cheers,

    http://younes.info

Leave a Reply to David Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">