3 ms·
If you have a brand new SaaS app where there is very little data (kilobytes to megabytes) and each user/team is separated from the others, you could have: - a
by swlkr 6y ago
If you have a brand new SaaS app where there is very little data (kilobytes to megabytes) and each user/team is separated from the others, you could have:
- a sqlite database for each user on the backend
- then on page load, have them download their whole sqlite db on the frontend
- sync the two with something like litestream.io compiled for webassembly
- holtalanm 6y agoi think the use-cases for that are pretty few and far between, at least at the 'team' level. If you have a team, you need some way to manage members, which means adding/removing members. with this model, you effectively would not be able to remove members because you wouldnt know which members had downloaded an offline copy of the team's database. for individual users, this might have a lot more potential.
- vaughan 6y agoThis is the same as a removed member still having their browser cache containing team data. The advantage of this design is you get an app that is extremely responsive and offline capable. Then you just need a reliable way to sync changes. And you always have the option of just re-downloading the entire team db again if it gets corrupted somehow. You could even have logic to indicate the sync status of each table so that you don't need to download the whole table...you could just populate it as your need the data...like a cache.