Open frederikbosch opened 5 years ago
I like the cache approach. Have you tested it with > 10k records or other large numbers of things being accessed?
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.
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.