Synchronizing data between San Francisco and Berkeley
nix run github:nicolaschan/baybridge# 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) -> barEach 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.
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:
- By keyspace: Provide the verifying key V. This is the most efficient way to look up names for a given verifying key.
- By namespace: Provide the name k. This returns all the verifying keys known to have an entry for k. This is useful for discovering writers without first knowing their verifying key.
This is a work in progress!
- A global key-value store
- Support untrusted replicas (this is the main goal!)
- Check replication status of trusted nodes
- Subscribe to changes for realtime streaming
- Various consistency levels
- Able to build a fuse filesystem on top of it
- Swappable communication layer
- Communication through holepunched NATs