13 breaking releases

0.29.0 Dec 4, 2024
0.28.0 Nov 4, 2024
0.27.0 Oct 21, 2024
0.21.0 Jul 22, 2024

#503 in Database interfaces

Download history 380/week @ 2024-08-21 697/week @ 2024-08-28 204/week @ 2024-09-04 386/week @ 2024-09-11 316/week @ 2024-09-18 398/week @ 2024-09-25 363/week @ 2024-10-02 373/week @ 2024-10-09 635/week @ 2024-10-16 834/week @ 2024-10-23 597/week @ 2024-10-30 473/week @ 2024-11-06 195/week @ 2024-11-13 238/week @ 2024-11-20 502/week @ 2024-11-27 426/week @ 2024-12-04

1,442 downloads per month

MIT/Apache

530KB
12K SLoC

iroh-docs

Multi-dimensional key-value documents with an efficient synchronization protocol.

The crate operates on Replicas. A replica contains an unlimited number of Entries. Each entry is identified by a key, its author, and the replica's namespace. Its value is the 32-byte BLAKE3 hash of the entry's content data, the size of this content data, and a timestamp. The content data itself is not stored or transferred through a replica.

All entries in a replica are signed with two keypairs:

  • The Namespace key, as a token of write capability. The public key is the NamespaceId, which also serves as the unique identifier for a replica.
  • The Author key, as a proof of authorship. Any number of authors may be created, and their semantic meaning is application-specific. The public key of an author is the [AuthorId].

Replicas can be synchronized between peers by exchanging messages. The synchronization algorithm is based on a technique called range-based set reconciliation, based on this paper by Aljoscha Meyer:

Range-based set reconciliation is a simple approach to efficiently compute the union of two sets over a network, based on recursively partitioning the sets and comparing fingerprints of the partitions to probabilistically detect whether a partition requires further work.

The crate exposes a generic storage interface with in-memory and persistent, file-based implementations. The latter makes use of redb, an embedded key-value store, and persists the whole store with all replicas to a single file.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~16–56MB
~1M SLoC