views:

498

answers:

2

In terms of project scale, doctrine vs zend-db-table speed and performance, when should I use doctrine inside Zend project, and when zend-db-table?

+5  A: 

Use whatever you are most comfortable with and will make you the most efficient. You and your fellow developers are probably the most expensive resource, and it's probably cheaper to buy additional hardware, if needed, than you having to worry about possible future performance considerations.

Of course, you will still need to perform basic database optimizations such as creating sensible indexes etc. But I feel that those "optimizations" go without saying.

PatrikAkerstrand
Optimization of queries important consideration if doctrine make it auto and zend-db not make it auto.Thank you
Yosef
+7  A: 

Any ORM framework gives you benefit for development productivity, not runtime efficiency. Doctrine is no different from Zend_Db_Table in this regard.

If you are choosing between Doctrine and Zend_Db_Table, choose based on the features that make it easier or faster to write the code.

No ORM framework can automatically make database queries faster in the general case. If you need high-performance database queries, you should learn to code SQL queries, and design your schema and indexes to support performance given the queries you need to run.

Bill Karwin
"No ORM framework can automatically make database". Sorry for I don't have this link here now, but I've seen Doctrine 2 benchmarks with PHP 5.3 which showing that in some cases it runs faster than the native PDO. I know, that benchmarks are evil, but is it really not possible?
takeshin
thank you very much.
Yosef
@takeshin: Doctrine 2 uses transaction management and caching to improve performance for certain scenarios. This doesn't make *queries* run faster.
Bill Karwin