The presence of two objects A , B of the same class (for example, HashMaps).
On different computers connected via the Internet
One ( A ) is the source, and the other ( B ) is like an updated copy ...
Is there a standard / recommended way to keep them “connected” or “updated”?
Example
I am using a TCP connection and writeObject
ObjectOutputStream bufferObj = new ObjectOutputStream (out);
bufferObj.writeObject (A)
and in the copy - something like this
ObjectInputStream bufferObj = new ObjectInputStream (in);
Object B = bufferObj.readObject ();
But this has a problem that the whole object is sent in every synchronization (e.g. periodically or every time a change occurs)
I would like to send only the differences (especially useful for Java collections) , but knowing the difference is not so simple:
I would like to have something like this (too simple / optimistic scheme)
In server source
ObjectA.serverUpdatesWarehouseAt (port);
In client copy
ObjectTemp.updateItRemotelyFrom (IP, port);
ObjectB.merge (ObjectTemp); // update differences when adding / removing as needed
Is something like this already done? so I'm here trying to avoid the ingenuity of the wheel
thank you for reading