MCPcopy Index your code
hub / github.com/bluesky-social/kvdb

github.com/bluesky-social/kvdb @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
290 symbols 915 edges 15 files 27 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

KVDB

ci

NOTE: This repository is under heavy development and is not suitable for general production use yet. Do not use!

An implementation of a subset of the redis command set backed persistently by FoundationDB.

Note that the name KVDB is temporary.

Local Development

Ensure you have go, just, and the foundation clients installed (you must use fdb version 7.3.63).

Then, run just install-tools once to ensure you have the local go tooling you need.

You may then stand up and tear down the local dev dependencies with:

# runs local dependencies in docker
just up

# cleans up when you're done developing
just down

You can then run any of the following:

# show all supported commands
just --list

# run the linter and all tests
just

# run the database (you can also launch it in the debugger in vs code)
just run kvdb run

# open a local shell to the fdb database
just fdbcli

For instance, in one shell, you could run just run kvdb run, then in another, you could do:

redis-cli
127.0.0.1:6379> auth admin admin
OK
127.0.0.1:6379> set hello world
OK
127.0.0.1:6379> get hello
"world"
127.0.0.1:6379> ACL SETUSER newusername on >password123
OK

Keyspace Layout

FoundationDB provides strictly serializable transactions atop an ordered key-value store. The design of our key directory layout for redis is the following:

Path Description
redis_v0/* All data related to the redis implementation atop foundationdb (if we implement other wire protocols in the future, we will also give them their own directory)
redis_v0/_admin_user_initialized Whether or not an admin user has been created on the cluster via the CLI and env vars
redis_v0/_user/<username> The directory of user protobuf objects, stored by username
redis_v0/<user_id>/* Data for an individual redis user
redis_v0/<user_id>/meta/<obj_id> Metadata protobuf object for bookkeeping of stored object blobs
redis_v0/<user_id>/obj/<obj_id> Storage of data objects
redis_v0/<user_id>/list/<list_id> Metadata protobuf for information on each list
redis_v0/<user_id>/list/<list_id>/<item_id> Metadata protobuf for information on each item in a list
redis_v0/<user_id>/zset/<set_id> Stores an ordered list of item scores for ordered sets

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

SimpleStringValue
called by 192
pkg/serde/resp/resp.go
recordErr
called by 132
internal/server/redis/redis.go
handleCommand
called by 130
internal/server/redis/redis.go
BulkStringValue
called by 63
pkg/serde/resp/resp.go
SpanOK
called by 53
internal/metrics/prometheus.go
FormatInt
called by 47
pkg/serde/resp/resp.go
extractStringArg
called by 40
internal/server/redis/redis.go
validateNumArgs
called by 23
internal/server/redis/redis.go

Shape

Method 158
Function 102
Struct 25
TypeAlias 3
FuncType 1
Interface 1

Languages

Go100%

Modules by API surface

internal/types/redis.pb.go120 symbols
internal/server/redis/redis.go39 symbols
pkg/serde/resp/resp.go34 symbols
pkg/serde/resp/resp_test.go22 symbols
internal/server/redis/set.go17 symbols
internal/server/redis/redis_test.go16 symbols
internal/server/redis/object.go16 symbols
internal/server/server.go6 symbols
internal/server/redis/auth.go6 symbols
internal/server/redis/list.go5 symbols
cmd/kvdb/main.go3 symbols
internal/server/redis/crypt.go2 symbols

For agents

$ claude mcp add kvdb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact