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've been implementing a Source for Firebase and one of the things that surprised me was that each source maintains it's own cache. As far as I can tell this is to facilitate synchronous access through the retrieve method. Rather than maintaining caches for each individual Source perhaps it would be simpler/more efficient to keep one inside the ember-orbit Store instead? This way the Source implementations don't need to consider the cache at all (less to understand when implementing a Source) and the information isn't duplicated in memory for every Store.
The text was updated successfully, but these errors were encountered:
@opsb Very cool to hear about your Firebase source!
As long as retrieve works synchronously on a source, it should not need a cache. I plan to make the cache completely optional on the base Source class.
However, I would not recommend placing a cache at the ember-orbit Store level, which would require that your orbit source only work with ember-orbit and somehow be aware of the associated Store. Its important that retrieve work on the Source level inside Orbit, so that transform connectors can inspect sources to compare their contents and determine which changes are needed. This doesn't mean that each source have a cache - just that retrieve work synchronously (and the easiest way to achieve this initially was to put a cache on each source).
"so that transform connectors can inspect sources to compare their contents and determine which changes are needed. " aha, I did wonder about this, I hadn't figured out how Orbit stopped operations from bouncing backwards and forwards, makes a lot of sense now.
I've been implementing a Source for Firebase and one of the things that surprised me was that each source maintains it's own cache. As far as I can tell this is to facilitate synchronous access through the retrieve method. Rather than maintaining caches for each individual Source perhaps it would be simpler/more efficient to keep one inside the ember-orbit Store instead? This way the Source implementations don't need to consider the cache at all (less to understand when implementing a Source) and the information isn't duplicated in memory for every Store.
The text was updated successfully, but these errors were encountered: