I have a list of Java objects on my server that is sent to the client through some serialization mechanism. From time to time, the list of objects is updated on the server, that is, some objects are added, some are deleted, and others simply change their place in the List. I also want to update the list on the client side, but I will send the least possible data. In particular, I do not want to resend objects that are already available on the client.
Is there a library available that will create some kind of diff from two lists, so that I can only send the difference and new objects by wire?
I found several Java implementations for the unix diff command, but this algorithm is impractical for reordering. i.e. [A, B, C] → [C, B, A] can be sent as soon as the location changes [1-> 3] [3-> 1], while diff will want to resend all objects A and C (as much as I understand).
source
share