I have several question about integrating integrating Doctrine 2.2 & Zend framework. I know there are many questions that discuss the same issue, but I have specific questions about it.
-
What is the best place to place Doctrine
Entities, Proxies, Repositories,...etcfor maximum performance? Most Integration techniques generate Entities in aNamespacein thelibraryfolder, but I was wondering if putting them in amodels folderinside my application would be better for performance.
Like instead of searching the entire include path my models folder will be faster to find. -
What is the best integration method with respect to performance? I plan to use
Bisnaintegration, but I if there is a better method for integration please let me know. -
If I want to add a service layer for Doctrine where would be the best place?
Notes:
- I use a the default folder structure generated by
Zend toolfor my projects. - I downloaded Doctrine 2 and added it to my library folder.
Thanks in advance
I normally put my entities as well in my library as the Bisna video proberly told you. But I agree with you this is not the best place because it’s application specific code. A better approach would be something like application/entities. I don’t think it’s meassurable for performance.
I like the Bisna integration a lot. I think it’s one of the best integrations of Doctrine2 there is for ZF. It’s small, simple and clean. With the Bisna integration it’s easy to modify caching layers in your application.ini so from that approach it’s good for performance. But the integration isn’t rocket science so I don’t it either makes any difference in performance between other integrations.
There are some configuration options you need to be aware of to increase performance. You should disable automatic proxy generation in your production environment and create them with the Doctrine-CLI. It’s best practice to enable Annotation and DQL->SQL caching with either APC or Memcache which will improve performance a lot.
Asside of that you have a lot of possibilities in Doctrine2 to cache your queries by passing the lifetime of a query. If you set-up APC or Memcaching as default caching your database result sets will be saved there.
Hope my answer helps you a bit, if you want to anything more just ask!