You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working with the search layer of our application. Currently I'll do search against ElasticSearch, fetch document id's and do a query for these documents from MongoDB with the help of Doctrine.
Roundtrip to MongoDB is unnecessary if we have all details available in the ES document, consider for example just a simple listing.
What came to my mind is a concept of "read-only" proxy objects. We could create a new proxy object when going through the search results, populate it with some data and use it like a normal object. If we'd need some other (non-cached) fields, Doctrine could lazily load the document from the MongoDB.
Would this be possible in general or is it too much mis-using proxies?
The text was updated successfully, but these errors were encountered:
As a general caching optimization, this sounds like an abuse of proxies. I can imagine we might add additional fields to proxies down the line, though. For instance, sharding support would see us add shard keys to DBRefs, and those immutable values could easily be incorporated into proxy objects.
Currently, I suppose you could use a custom ProxyFactory class to do this, but your proxies would be different than the ones ODM creates.
There's still the matter of us moving to Common's ProxyGenerator down the line. That may complicate things (including our sharding support), if the common class limits the "cached" field to the identifier.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.
This is similar to what #1527 intends to do, except from a different data source. With proxy logic being rewritten in 2.0, we can tackle this in 2.x. Regardless, closing this in favour of the PR.
I have been working with the search layer of our application. Currently I'll do search against ElasticSearch, fetch document id's and do a query for these documents from MongoDB with the help of Doctrine.
Roundtrip to MongoDB is unnecessary if we have all details available in the ES document, consider for example just a simple listing.
What came to my mind is a concept of "read-only" proxy objects. We could create a new proxy object when going through the search results, populate it with some data and use it like a normal object. If we'd need some other (non-cached) fields, Doctrine could lazily load the document from the MongoDB.
Would this be possible in general or is it too much mis-using proxies?
The text was updated successfully, but these errors were encountered: