So my Android app uses a SQLite database. I need to "replicate" two or more tables with a central server. The remote server will merge the data from remote client devices (my app), along with a few extra fields to make each record unique, since multiple client devices will be participating.
This must be a common need for developers using SQL replication so I'm hoping someone can point me to an existing (turn-key) solution.
If not, I would like to consider methods that doesn't require me to code a lot of specifics about the table schema. Perhaps I could just specify the table and specify the server and that's it. I guess I could even sqlite dump to file then pass the file?
Thoughts?
Thanks!
Do you only need to send data to the central server (replication as you say), or do you also need to receive data from that server (synchronization)? If you only need to send data and bandwidth/data usage is not a constraint, then you can create a CSV or TSV file with the data you need, optionally compress it and send it to the server, and implement all merging logic in the server. Even if it's not table-specific, you need to determine what to do in case you already have identical or very similar data (overwrite, ignore, error?).
I would advise against just sending raw sqlite data, since that would create an unnecessary dependency with sqlite on the server. Creating a TSV file isn't hard.
I don't think there are any turn-key solutions for what you need, though there are many libraries and frameworks to help you implement it server-side.