Open jimdebeer opened 8 years ago
need to store stamp data
@jimdebeer Could you share your opinion about the solution I thought of today for attacking this issue? /CC: @ninjatux
Base setup
The data needs to partitioned in events
and data-storage
(the data result, or current
).
This will be done in two separate db's. So one for all the events (which can be easily put into archive: #10 as soon as it's old
)
Solution
data-key
, data-value
, stamp
events
with key
: stamp
.data-key
and value
: data-value
stamp
to stamp
on current dataevent.stamp
> currentData.stamp
-> set to Data + set to data-storage
(can be queued as well)event.stamp
<= currentData.stamp
-> discardedge case -- older time stamp but new (If event.stamp <= currentData.stamp -> discard) case will not fly unfortunately -- have to check keys -- someone can connect after an offline session -- we still want her data!
this is very useful for a persistent overview of change in observable
there are a few ways to do this -- but probably adding it as an extra field begin the payload you're storing per key is the fastest (do some perf tests for this!)