Greetings.
I was working on a project which will consume a REST API located at a server say www.this-server.com and there will be a Windows Forms Application using C#, let's call this application X.
This X will be installed on several machines at different locations across the globe, and they would be utilizing the application. Suppose there are 90 stations or machines where X is installed but internet is connected only to say 85 of the stations.
What I want is that remaining 5 stations should not stop working, I mean CRUD operations take place offline in the local database of the application X.
As soon as there is a network available, 5 remaining stations should sync their changes to main API at www.this-server.com and get any changes happend to the server in the meantime.
I know it would require something like this, the so called smart client: https://www.codeproject.com/Articles/1134703/Net-application-that-works-online-and-offline-Sma
But what I am having problem is that suppose, there is a auto-increment field in several tables in the API, how would those be generated at all and would there be any conflict.
Something kind of this: https://dba.stackexchange.com/questions/104700/sync-many-client-database-to-one-central-database
I mean is that thing even possible, it could have been possible if the application X had single instance running at once, but in my case there are 90 simultaneous utilization of the API.
Any help, teachings, advice would be highly appreciated. Regards Jayant
PS: I am a newbie developer and still learning, so a lot to go and see, don't get angry over me :-D.
If you cannot change the server you will have to write a client (X) that can differ between synchronised records and not synchronised records.
I would either create a second store for unsynchronised stuff or create extra fields marking a record as unsynchronised. When connecting I would then do some magic to update the local ID. The local ID cannot be autoincrement.
Preferably, if you can change the server, I would instead opt for not using the autoincrement in the REST API. Instead I would use a Guid which can be created globally unique by anyone.
For performance reason you can use the integer autoincrement ID locally. But for any communication with an external system, hide the ID and use the Guid instead.