0

We have several systems that hold the same data in different databases. The requirement is to keep the data synced in as much reliable way as possible. Performance isn't a concern because we don't have lots of users.

Currently, we're using RabbitMQ to produce events on data changes so that consumers are able to track the updates and do corresponding changes in its own data. We've set up a RabbitMQ cluster to increase reliability. However, my team leader is still concerned about insufficient reliability and data loss in case if one of the systems failed to handle a message correctly.

Is there any better way to solve the task?

  • What failure modes do you need to handle? Missing a message, temporary resource problems, complete failure or disconnection and subsequent recovery/re-sync of one system, failing to handle a message correctly because of a bug/mismatch and continuing on a best-effort basis ... what? – Useless May 30 at 20:45
  • If you require your data to be consistent throughout the several systems, and performance isn't and issue, then perhaps create an interface between the systems and the databases to handle any updates to the data? As mentioned by candied_orange, hashing and diffing is also useful. It is how many desktop-cloud syncing solutions work. – stonefruit Jun 30 at 4:09
1

One data reliability scheme that I've used to test synchronization is hashing all data in the model. This must exclude unique meta information like computer name. But if you can encompass all data that is meant to be identical and hash it you have a fairly good test to detect when you are out of sync.

Once you have that you can add new features to the system and exercise them and see if they put you out of sync. If they do you can fix them. You can break the system and watch it go out of sync, repair it, and see if it self heals.

I'd advise doing more than one hash of everything. Do smaller scoped hashes as well that help you find the cause of the problem quickly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.