Implement update_counter #21
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I wonder how hard it would be to change hanoidb to impleent something like mnesia's dirty_update_counter? Like, locate record, if found - treat value as int, increment it and write the result in the same place, if not found - create new record, everything in one atomic and probably fast operation? Would that be possible at all with architecture of this kv storage?
There are some interesting possibilities with CRDT-based counters, especially if you want fast updates, and can live with slightly slower reads. In this case, we could write update deltas ("increment by X"), which would be very fast; and have the merge operation accumulate counter updates. A read would then have to go through all log(N) levels and add up the counter value. So yes, it would indeed be possible.
Will deltas work with key expire time and space compaction? I think in this case we will have to update timestamps of all updates in the stack anyway.