ozzem
ozzem

Reputation: 294

How to create an App which syncs two devices basing on a remote db value

I'd like to make an app (and a webserver) where I have this scenario :

  1. device1 makes a post and set a value in a remote db.

  2. device2 is alerted of the changed value in the db and gets the value.

What I need is obiously the pattern, an implementation of it or just the architecture I could use to develop the solution a presented.

I was thinking about a pub/sub pattern. What do you suggest?

EDIT : My idea was a shared grocery list (like Bring to be clear). I would like that, when someone puts an item into the shared list, the list will be updated in "realtime" on the other client.

I found rethinkdb https://www.rethinkdb.com/ and could be useful (just like firebase) but I don't know if it's possible to invoke it in the app directly. I don't know how to integrate the android app and the db.

Upvotes: 0

Views: 75

Answers (1)

Xavier Rubio Jansana
Xavier Rubio Jansana

Reputation: 6583

Without something more specific, I suggest either https://realm.io/products/realm-mobile-platform/ or https://firebase.google.com/

Please, provide more specific questions if you want more specific answers.

Update

While I have no experience with rethinkdb, it has a Java API that probably is compatible with Android (because of Gradle integration instructions). See Java driver page for more information.

Take into account that unless there is some provider that offers the server component as a service, you will have to manage your own server and install the server component by following this instructions. Notice that there is an official Docker image available which can be useful in some scenarios.

Upvotes: 2

Related Questions