vigour-io / level

0 stars 0 forks source link

[Stamps] Store stamp information in level #4

Open jimdebeer opened 8 years ago

jimdebeer commented 8 years ago

this is very useful for a persistent overview of change in observable

obs.on(data, event) {
   console.log(event)
   // event.stamp
}

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!)

jimdebeer commented 8 years ago

need to store stamp data

boitewitte commented 8 years ago

@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

jimdebeer commented 8 years ago

edge 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!