I plan to have a cloud web application(CWA) and several local web application(LWA), let's assume 3 LWAs and 1 CWA. CWA === LWA.

This web application would consist of a database server, file storage server, An Application server.

I have two options for synchronisation:

Option 1:

A record saved in LWA-1 would reflect in the CWA and LWA-2 and LWA-3 and vice versa (it might not be real-time and I'll explain why in a bit).

Option 2: A record saved in LWA-1 would not reflect in LWA-2 and LWA-3 BUT would sync to the CWA. Same goes for other LWAs. Essentially, The CWA aggregates data synced from all LWAs.

Main Challenges:

  1. Internet connection is really really unreliable and bad so synchronisation will happen at intervals when Internet will be stable. This is why I'm relying heavily on local systems and not a complete cloud solution.

  2. Avoiding Duplicate keys on synchronisation.

  3. Ensuring Data Integrity.

  4. Maintaining unique records. E.g client A registered on LWA-1 must not be able to re-register on LWA-2 and LWA-3.

I need your bright minds to help determine the best approach to designing this whole system.

Techs: NodeJS, MySql, Linux, python

  • Which option is better depends almost entirely on the services your application is offering and what data needs to be synchronized and to whom from a business perspective and what data could be processed entirely locally. Commented Feb 5, 2021 at 7:16
  • To avoid key duplication, I would suggest each local application requests a range of id's from the cloud application (say, a thousand ids). This way it can keep issuing new Ids for new data records knowing there will never be a key-conflict from other local applications. Having reserved a range of id's instead of asking every time you need a new one also allows you to keep operating when the internet connection is down. Commented Feb 5, 2021 at 8:39


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.