10 releases

0.1.9 Jan 31, 2024
0.1.8 Jan 24, 2024
0.1.7 Dec 28, 2023
0.1.2 Nov 23, 2023

#496 in Network programming

Download history 251/week @ 2023-12-22 239/week @ 2023-12-29 716/week @ 2024-01-05 339/week @ 2024-01-12 643/week @ 2024-01-19 337/week @ 2024-01-26 177/week @ 2024-02-02 177/week @ 2024-02-09 350/week @ 2024-02-16 173/week @ 2024-02-23 93/week @ 2024-03-01 70/week @ 2024-03-08 76/week @ 2024-03-15 78/week @ 2024-03-22 92/week @ 2024-03-29 20/week @ 2024-04-05

272 downloads per month
Used in 5 crates (4 directly)

MIT license

210KB
4K SLoC

KeyValue service

This service implement key-value storage, which has set/get/del, sub/unsub

For working in unstable network, we ensure data is correct event if lost some previous packets. For that reason, we dont use any delta data technical, instead we sending full data each time we need to changed

  • Set: Key, Value, Version
  • Get: Key
  • Del: Key, Version

With Set, Del only correct version will be used. In details:

  • Set: only newer version is apply
  • Del: only equa or newer version is apply

For ensure data not losing when network changed, we implement simple replication algorithem, when each key is set to multiples node which generated by:

  • OriginKey
  • Rep1Key = OriginKey XOR Rep1Factor
  • Rep2Key = OriginKey XOR Rep2Factor

Each time Set, Get or Del will be sent to all of origin key and replication keys

Current version only sending OriginKey

Set

We sending set command util received ack for that set version or newer version

Get

Del

We sending del command util received ack for that del version or setted with new data

Sub

We sending sub command util received ack or switched to unsub

Unsub

We sending unsub command util received ack or switched to sub

Sync

We sync each acked key-value or subscribe state in each interval time

Dependencies

~11–24MB
~361K SLoC