genkgo / ember-localforage-adapter

Offline usage for Ember Data, based on localstorage adapter, but now uses Mozilla's localforage as data source
Other
133 stars 26 forks source link

[Version 3] Handling of sync/async relationships #81

Open frederikbosch opened 5 years ago

frederikbosch commented 5 years ago

Please take into account that this library uses a key/value store as backend. From our experience saving records in a separate key caused a gigantic load when it involved many records. Then for every relationships the adapter had to talk to localforage. This made the app unusable. Therefore we introduced a cache and caching setting at the level of the adapter. You can choose between fetching everything at once, fetching per model type or fetching per model. See the README.md.

Maybe this can be improved, or replaced by new/better methodology.

NullVoxPopuli commented 5 years ago

I like the cache approach. Have you tested it with > 10k records or other large numbers of things being accessed?

frederikbosch commented 5 years ago

Our app has around 1k-2k records. I believe I did testing back then with many more records. But memory was eventually becoming a problem. Especially because it had to perform on mobile phones from 6 years ago. So the answer of the performance is, of course, dependant on the use case. Another benchmark would be nice.