OpenAI goto hell
OpenAI goto hell

Reputation: 661

Syncing database like entries with google drive

I have an application that is running on multiple android devices of the same user. Any of these devices have to maintain a local database that needs to be synced accross all devices. It's very likely that two devices will add or remove entries at the same time, meaning that inconsistency is very likely to happen.

Here's a list of things I need:

I know that Google drive is not a database and so I'm currently searching and thinking for a solution that would still allow this scenario without any other server. I'm aware that there is probably no solution for this but before I give up this idea I want to be sure.

The only thing I found so far that could become handy for this approach is the If-Match: "E_TAG" header field but assuming that I represent entries in the file structure I would have to update multiple files atomically which seems to be impossible.

Is there any way to accomplish this via google drive? I also searched for synching concepts that are working on filesystems that don't have file locking but I could not find anything either.

Upvotes: 0

Views: 264

Answers (1)

pinoyyid
pinoyyid

Reputation: 22306

It's all possible with Google Drive, but you'll need to build all of your own sync logic using the available Drive primitives. You'll also need to deal yourself with update conflict resolution. You will make use of etags and also the changes feed in order to do this. But beware, it's non trivial.

If you don't need to use Drive, then Firebase might be a good option to consider.

Upvotes: 3

Related Questions