3 ms·
I analyzed [1] that problem and tried to reproduce data loss with LokiJS, which also has everything in memory and only partially writes to disc. It is very hard
by typingmonkey 5y ago
I analyzed [1] that problem and tried to reproduce data loss with LokiJS, which also has everything in memory and only partially writes to disc.
It is very hard to reproduce a loss. You can call the saveDatabase() when the window 'unload' event fires and also after each write when the database is idle again. This works quite reliable.
The only way to lose data is when I shutdown power directly after a write.
It is also to mention that having everything in memory will not support multi-tab usage.
[1] https://rxdb.info/slow-indexeddb.html https://rxdb.info/slow-indexeddb.html