Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should use doctrine ORM and when zend-db-table?

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?

like image 253
Ben Avatar asked May 24 '10 16:05

Ben


People also ask

What is doctrine in Zend?

Doctrine is an open-source PHP library providing convenient methods for managing your database in an object-oriented way. For working with relational databases, Doctrine provides a component named Object Relational Mapper (ORM for short).

What is doctrine database?

The Doctrine Project is the home to several PHP libraries primarily focused on database storage and object mapping. The core projects are the Object Relational Mapper (ORM) and the Database Abstraction Layer (DBAL) it is built upon. Get Started View Projects.

Is Doctrine a framework?

Doctrine is an Object-Relational Mapper - if you web-search that term, you'll find what you are after. Frameworks are pre-written code that you can use in your projects.


2 Answers

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.

like image 89
Bill Karwin Avatar answered Sep 24 '22 12:09

Bill Karwin


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.

like image 31
PatrikAkerstrand Avatar answered Sep 24 '22 12:09

PatrikAkerstrand