nicolaschan / baybridge

MIT License
1 stars 0 forks source link

Bay Bridge Key-Value Store 🌉

Synchronizing data between San Francisco and Berkeley

Installation

nix run github:nicolaschan/baybridge

Usage examples

# Start a local server
baybridge serve

# In another shell
baybridge list
baybridge set foo bar
baybridge get "$(baybridge whoami)" foo # returns bar
baybridge namespace foo # shows a mapping: $(baybridge whoami) -> bar

Design

Definitions

Each writer is identified by a keypair (S, V) where S is the private signing key and V is the public verifying key. The verifying key V corresponds to a keyspace K, the collection of names writable by V. Each value in the store is addressed by a tuple (V, k), a verifying key V and a name k. A namespace N for k is the set of addresses where the name is k over all verifying keys.

Reading and writing

To write to a name in K, the write command must be signed by the signing key S.

This way, nodes do not need to trust each other. Nodes share the signed write commands and apply the changes according to a conflict resolution strategy. Readers can ask any node for the data and audit log of the events to derive the current state.

Values can be queried in two ways:

Goals

This is a work in progress!