tags:

views:

60

answers:

1

Can any one tell me 'What is doctrine not good for? please describe a scenario where we definitely wouldn't use Doctrine.

+2  A: 

This is definitely more of a 'ORM-or-no?' discussion. I would say there are both architectural and performance reasons not to use Doctrine.

The whole point of an ORM is to translate database table structure into object graphs for your application. If your data is meant to represent or 'model' discriminate objects or relationships between objects (User, Shopping Cart, Order, etc). then an ORM is a valuable tool.

But in the case where you application is working with tabular data, and there is no serious impedence mismatch, Doctrine might not be the right approach. For example, if my application was for working with large sets of log files, an ORM might be overkill. Also, if your database is highly de-normalized an ORM probably isn't for you.

There are also performance considerations. ORMs tend to be slower than using bare-metal SQL. Doctrine also has a habit of building very large object graphs than have a big memory footprint. It isn't terribly well suited to working with thousands of database rows at once, or with a high number of inserts, updates or deletes. If you're going to be dealing with a high load of database transactions, an ORM might not be for you.

My philosophy is that an ORM is an extremely useful tool until it becomes too painful to use. If you won't be able to gain any benefit from using Doctrine at all, you probably already know it.

Bryan M.