0

I need to do some Data Synchronization between a client and a server. I have decided to use RabbitMQ for Data Synchronization, in order for my program to be tolerant for network failure. I know how to use RabbitMQ, so no problem there.

All data needs to be stored in a local database, and then copied to an other database.

My problem is exactly which data to transfer over the network.

Let me show some example code:

This is the way I write to my database today. The body of my method is removed since it is irrelevant for the question.

public static class DatabaseHelper
{
    public static void RegisterCheckout(string checkoutStationId, string employeeId, string destinationId)
    {
        //Insert in to database 
    }
}

So in short my program calls DatabaseHelper.RegisterCheckout("123", "321", "456"), the checkout is put into the local database.

But how do I serialize this method call, in order for me to reproduce it server side?

Jens Borrisholt
  • 6,174
  • 1
  • 33
  • 67
  • 1
    _"[There are no such feature like retry attempts in RabbitMQ](https://stackoverflow.com/questions/23158310/how-do-i-set-a-number-of-retry-attempts-in-rabbitmq)"_ so it's hardly _"tolerant for network failure"_ sadly –  Dec 22 '17 at 05:33
  • About retry I plan so save my data locally and then post it when online. But the problem is how to serialize a method call – Jens Borrisholt Dec 22 '17 at 05:47
  • 1
    It's better to transfer database state, not method calls. So for example add timestamp columns to all tables and periodically grab all rows which were changed since X and send them to server. – Evk Dec 22 '17 at 06:10
  • Thank you @Evk perhaps you could make me a raw demo. Just to show the idea. I doesnøt have to be at complete working demo. – Jens Borrisholt Dec 22 '17 at 06:21

0 Answers0