Hacker News new | ask | show | jobs
by realPubkey 1009 days ago
I am the developer of RxDB, a local-first javascript database, and I made multiple apps with it and worked with many people creating local first apps. The problems you describe are basically solved.

> What to do with stale user data?

Version/Schema migration in RxDB (same for IndexedDB and watermelonDB) can be done in simple javascript functions. This just works. https://rxdb.info/data-migration.html

> What about data corruption?

Offline first apps are built on the premise that internet connections drop or do not exist at all. The replication protocols are build with exact that purpose so they do not have any problems with that. https://rxdb.info/replication.html

> What happens when you have merge conflicts during a sync?

You are right, CRDTs are not the answer for most use cases. Therefore RxDB has custom conflict handlers, which are plain javascript functions. https://rxdb.info/replication.html#conflict-handling

> What happens when the user has millions of items?

There is a limit on how much you can store on a client device. If you need to store gigabytes of data, it will just not work. You are right at that point.

> How do you handle backups? How do you handle exports?

- live backups: https://rxdb.info/backup.html

- json export/import https://rxdb.info/rx-collection.html#exportjson