Client/Server communcation (SharedState) with a map or array with large dat

In my understanding, by using shared state, if you modify only one element in an array or in a map, it will transmit the entire thing. How do you deal with that if the data in that map/array is big and you want to optimize for performance.

E.g. you have say 500 items in that array and only one or two are changing once in a while.
Obviously having 500 fields in the shared state is not feasible. On the other hand, transmitting all 500 items every time a single item changes is very heavy and slow.

It would be nice to only transmit the delta of the array.


Yes, unfortunately shared state does not support deltas. You can work around it by using RPC calls instead, eg. something like

interface MyDiffRpc extends ClientRpc {
    public void sendWholeThing(List<Foo> list);
    public void updateElem(int i, Foo newElem);
    public void insertElem(int i, Foo insertedElem);
    public void removeElem(int i);

thanks johannes! will do it that way then