Search code examples
phpperformancedoctrine-ormodm

Doctrine ODM Document Reuse


Scenario: In my PHP slim app, I have a class which is used for validation and if that passes I then use a "controller" to perform RESTful style updates.

My question is: If I perform a query and then in an unrelated part of the code perform a query that returns some of/all of the same documents. Does the doctrine document manager reuse the previously retrieved documents?

Thanks in advance! Ben


Solution

  • Doctrine can be extended to use object caches like Redis to reduce the hits to the database.

    We also have added code to our data access layer to reduce queries - this is upstream from Doctrine.