Bean change monitoring to create deltas?
I have several Beans in my application that are updated regularly with regular setter methods. I want to sync these Beans with a remote application that has the same bean classes. In my case, bandwidth matters, so I have to keep the number of bytes transferred as low as possible. My idea was to create deltas of state changes and carry them over instead of whole Objects. Currently I want to write a protocol to push these changes myself, but I am not tied to it and would prefer an existing solution.
Is there a solution for this problem? And if not, how can I easily control these state changes in a generalized way? AOP?
Edit: This issue is not related to caching, even if it might seem at first glance. The data should be replicated from a central server to multiple clients (4 to 10) over the Internet. The client is a standalone desktop application.
source to share
This sounds remarkably similar to how JBossCache works in POJO mode .
It is a delta based distributed cache that splits java objects into a tree structure and only communicates changes to bits of the changing tree.
Should be perfect for you.
source to share
I love your idea of ββcreating deltas and sending them.
Simple Map can handle delta for one object. Serialization might just give you an efficient message.
To reduce the number of messages that will kill your performance, you should group your deltas for all objects and send them altogether. This way you could collect other collections or maps.
To keep track of all changes in many beans, AOP seems like a good solution .
EDIT: See Skafman's answer.
Using existing caching technology could be better. Many problems may already be realized ...
source to share