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

#1076 in Network programming

Download history 29/week @ 2024-07-19 170/week @ 2024-07-26 46/week @ 2024-08-02 27/week @ 2024-08-09 21/week @ 2024-08-16 23/week @ 2024-08-23 49/week @ 2024-08-30 15/week @ 2024-09-06 18/week @ 2024-09-13 42/week @ 2024-09-20 35/week @ 2024-09-27 8/week @ 2024-10-04 28/week @ 2024-10-11 14/week @ 2024-10-18 6/week @ 2024-10-25 18/week @ 2024-11-01

66 downloads per month
Used in 4 crates (3 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–22MB
~319K SLoC