From what I can tell, you want to run a copy of the database on
multiple mini devices and have replication between them? If so, this
isn't really a good use case for replication, and adds several
unnecessary layers of complexity. So lets look at the end goal, you
want multiple clients to have read/write access to the same data, with
the constraint that the internet connection will be unreliable, but
you still want the data to be accessible, and possibly, editable.
This can be easily achieved by implementing good development
practises, similar to that of SPAs [1] or any "properly written"
mobile application. The application would maintain its own database,
for SPAs you'd probably use local storage [2] (assuming you didn't
need to support ancient browsers), and for mobile apps you can use an
embedded copy of SQLite3 [4] for relational structures, or couchbase
mobile [3] for document store. These databases would sync using your
"central" server, and your API design would depend on exactly what you
are trying to do, for example for simple requirements you could use
REST, but in others you may want to consider an RPC style, or you
might want to have the best of both worlds. There are some frameworks
out there which handle things like this, emberjs, angularjs etc,
though personally I am yet to find a decent, simple and clean
implementation of such a structure.
To achieve this, you also have to consider conflict handling, for
example if both users are offline and they edit a model, how would you
handle the conflict? If you automatically handle merge conflicts then
you also have to notify the affected users, and reflecting this in
your UX is *hard*. The theory of distributed systems are actually
quite simple, at least once you get past all the academic stuff, the
hard part is exposing it to the user in a friendly way.
You can get around many of these problems by disabling edits unless
there is an internet connection, allowing only read access in the
event of a connection drop out, then using model caching on the client
side (along with a bulk retrieve request). However both approaches
come with the same problem of delta changes, if a model changes then
each app will need to be notified about this, ideally via a push
mechanism. Designing an events system around this can be quite
challenging, for even the most seasoned developers.
If you have enough time/resources then it could be a fantastic
learning experience for you, but if this is a quick/dirty project
primarily lead by billable hours, then you probably don't want to
follow this route. If someone sent me a spec like this, I'd say it
would *easily* be 300+ hours work.
Hope this helps, if I have misunderstood, let me know.
Cal
[1]:
http://en.wikipedia.org/wiki/Single-page_application
[2]:
http://diveintohtml5.info/storage.html
[3]:
http://www.couchbase.com/nosql-databases/couchbase-mobile
[4]:
http://www.appcoda.com/sqlite-database-ios-app-tutorial/