I'm building a server-to-many-listeners application where the server has a "master list" that changes many times per second, and these updates need to be streamed to connected clients, so that they can keep a state identical to the server's.
The list contains pricing data, representing an orderbook from an asset exchange and looks like this:
[[1.0, 0.002], [1.1, 1.2039], [1.2, 0.29183]]
...where the first value is the price, and the second is the amount.
The idea would be that the client would receive the full list upon first connecting (or by some other side-channel), and would then incrementally apply the changes as they stream in.
Is there a pattern for doing this sort of thing? Efficiency is important here (but 2nd to correctness), so preferably the amount of data transferred is kept to a minimum.
EDIT: I'm less interested in the transport layer and more in the data layer, how to structure the delta format, etc.
Aucun commentaire:
Enregistrer un commentaire