Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populating lazy proxy objects with field data #747

Closed
vmattila opened this issue Jan 8, 2014 · 3 comments
Closed

Populating lazy proxy objects with field data #747

vmattila opened this issue Jan 8, 2014 · 3 comments
Labels
Stale Issues that have not seen any activity in 30 days

Comments

@vmattila
Copy link

vmattila commented Jan 8, 2014

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?

@jmikola
Copy link
Member

jmikola commented Jan 9, 2014

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.

@malarzm malarzm added the Idea label Jan 16, 2016
@stale
Copy link

stale bot commented Jan 21, 2019

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.

@stale stale bot added the Stale Issues that have not seen any activity in 30 days label Jan 21, 2019
@alcaeus
Copy link
Member

alcaeus commented Jan 21, 2019

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.

@alcaeus alcaeus closed this as completed Jan 21, 2019
@alcaeus alcaeus removed the Idea label Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Issues that have not seen any activity in 30 days
Projects
None yet
Development

No branches or pull requests

4 participants