DB sync between 2 devices in (almost) realtime?

Cableguy

Expert
Licensed User
Longtime User
Hi guys.. I've had an idea for an app, but there is something that surpasses me... I would like to implement a (almost) realtime DB sync between 2 devices and only 2 devices... Something like a master/slave relation...How could I manage this?
Can G+ or Dropbox be used in such a way? What would be an alternative?
 

Cableguy

Expert
Licensed User
Longtime User
I better give you a real case scenario.

I'm planning a joined expenses tracker. By joined I'm refering to a Husband/Wife thing.
I Have two main possible scenarios for the device relationships...
1 - Have a "Master" device, where the real DB would be installed, and a "slave" one who would then just manage records without actually holding the DB. This would be my ideal one, but I recon it's the least possible one.
2 - Have a relay service, and host the DB... this would equalize the relation between the devices as they would act as clients to the DB service... This is my 2nd best case, wich would force me to buy a good host service for the DB part.

what would be my best bet?
 

KMatle

Expert
Licensed User
Longtime User
I would use a hosted SQL database. Via httputils and a bit of php you have full control of it. It is accessable from anywhere and a save solution (imagine the master device breaks or gets lost). With the database you have ONE location for the data and it is always "synced". With a user-table you can define who is master and who is slave and a simple login function. It's simple and reliable.

I pay about 10$/m for a unlimited hosting plan (php, MySql, unlimited db's, traffic and space). For sure there are cheaper solutions (with one or two db's).
 
Top