me-box / zestdb

ZestDB
MIT License
18 stars 3 forks source link

TimeStamp resolution and fast writes #25

Open Toshbrown opened 6 years ago

Toshbrown commented 6 years ago

It is possible to write to the store faster than the smallest resolution of the timestamp in milliseconds.

When this happens the data return by latest, earliest API calls can be out of order causing tests to fail.

jptmoore commented 6 years ago

Yes, if you write with the same timestamp the write order is not guaranteed. Items in the series with the same timestamps are effectively equal in order. I think it might be worth considering a move to nanosecond timestamps if this is an issue.

Toshbrown commented 6 years ago

I'm not sure it's a practical issue, as writing at 100hz is probably beyond what most applications require. If it's not too tricky to move to using nanosecond internally but still keeping milliseconds externally. Then it might be worth adding to the todo list.