I'm starting to develop an android application where I have to persist user data. For server data I want to use Google Cloud with noSQL but I don't know what to use to save data in local memory when the user doesn't have connection. My principal conflict is to mantain synchronized both data (local and cloud). Is there a noSql data base to use with android in local mode?.



You might want to look into Firebase's Realtime Database (also Google) instead of Cloud Datastore.

It has Android/iOS/JavaScript SDK's and is designed to work offline with a client side cache, handling synchronization between Client and Server for you.

If you want to do this in Cloud Datastore, you'll need to wrap the client libraries with your own methods for local caching and synchronization (not easy, but possible).

If you use Cloud Datastore's auto-generation ID's for entities it will be much harder since there isn't a great client way to do it. How you would do it was pre-allocate keys in advanced per client and store in a cache to use while offline. alternatively, if you use Names in the keys instead of IDs it will be somewhat easier, although you'll need to make sure there isn't conflicts between clients.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.