I keep hitting the following problem over & over again:<p>- Build a mobile app (mostly some sort of CRM/ERP kind of app), where ALL the features need to work offline
- This means that all the data (for the currently logged-in user) needs to reside on the mobile device.
- This also means that any CRUD operation needs to hit the local data-store first, and should be synced in the background with a remote data-store.
- This also means that if the user signs into another mobile device, a relevant subset of the remote datastore should be "restored" on the mobile device.
- Probably a few other subtleties that I haven't thought through yet.<p>Is there any stable/production-grade DB that solves this problem? Bonus points if it's an RDBMS, because building reports for a CRM/ERP is 10x easier on top of an RDBMS vs a document/JSON DB.
Sybase MobiLink does this. It has a central sync server that manages syncing data between a RDBMS and the phone's database. It got bought by SAP and might have been deprecated.<p><a href="https://help.sap.com/viewer/4949f39728bd400ebee2fb94687cc74f/17.0/en-US/81cb5d6a6ce21014afd7b01bc41d7276.html" rel="nofollow">https://help.sap.com/viewer/4949f39728bd400ebee2fb94687cc74f...</a>
I've worked on (and actively promoted) products in this space but nowadays I'm rather disillusioned with the dream of effortless sync. It works pretty well in dev. But once you have to deal with aggregations and security it all falls apart. You end up having to reinvent a regular backend in a very convoluted way on top of a second-rate db. It's like all the problems with ORM but on steroids.
I tried to build this for my MVP which was also CRM. I stopped for other reasons, but this is how I was doing:<p>1. Store data locally in SQLite.<p>2. Export from DB to JSON string.<p>3. Encrypt JSON with in memory password.<p>4. Save encrypted string on backend server running Laravel and MySQL.<p>Basically, I provided backend only for sync functionality. And I liked that data was encrypted on client, so I had less liability.
I've done one with a LAMP stack on android with a distributed DB setup you got the varsatility of PHP and all the libraries you need. The challenge is if you want the client not to have local code.data access and to have confident security setup for updating from a remote app to the server.
I've tried to find something similar and as far as I can tell the best current candidate available is pouchdb syncing to a couchdb instance.<p>If offline first isn't a must have and you're ok supporting 'intermittent offline' then Firestore with offline enabled is probably your simplest option
Have you looked into Realm? It might fit your use case<p>[0] - <a href="https://realm.io/" rel="nofollow">https://realm.io/</a>
also interested in this with a different use-case. We'd like to have agricultural applications 'offline first' so that they always work no matter whether connectivity is there or not.