vado / docs
GitHub

Run it

Operations

Deploy, configure, create databases with a placement, sign in to the dashboard, drive the bench API, and upgrade without breaking running shards.

Deploy

From a checkout
npx wrangler secret put VALKEY_PASSWORD
npx wrangler secret put BENCH_TOKEN      # optional: turns on the bench API
npm run deploy -- --var ACCESS_TEAM_DOMAIN:https://<team>.cloudflareaccess.com --var ACCESS_AUD:<tag>

VADO_REDIS=1 npm run deploy              # carry the Redis flavour too

Open connections keep the old router code until they end. Busy shards restart onto the new code within about 30 s without failing commands, and idle ones get it when they next start. Wait a minute after a deploy before measuring anything.

Settings

SettingDefaultMeaning
VALKEY_PASSWORD (secret)unsetMakes AUTH mandatory and turns on /ws
BENCH_TOKEN (secret)unsetBearer token for the bench API; unset turns it off
ACCESS_TEAM_DOMAIN, ACCESS_AUDrequiredDashboard sign-in with Cloudflare Access
SHARD_EPOCHS[{"from":0,"shards":1}]Shard count by creation time. Append, never edit
LOCATION_HINTunsetRegion for new shards without a regions list, and every pub/sub shard
VALKEY_MAXMEMORY64mbPer shard. Keep it at or under 64 MB: the memory limit is 128 MB
VALKEY_MAXMEMORY_POLICYnoevictionallkeys-lru for a cache
VALKEY_LOGLEVELwarningValkey's log level, written to the Worker's logs
ROUTER_IDLE_MS30000Idle shard sockets close after this
ROUTER_SOCKET_BUDGET128Sockets per process before routers switch to batched calls

Create a database with a placement

Databases are created on first use with the current epoch's shard count, at LOCATION_HINT. To choose the size, placement, replicas or flavour, create it first, through the bench API or the dashboard's New database dialog:

Bench API
curl -H "authorization: Bearer $TOKEN" \
  "https://<your-worker>.workers.dev/db?db=mydb&shards=16&regions=world&replicas=world"

regions and replicas take world or a comma-separated list of hints. flavour=redis runs Redis, and password=new gives the database its own password, returned once. For an existing database, /db returns its record unchanged.

Dashboard sign-in

The dashboard is the Worker's own URL. Anyone can watch: live numbers come over /live from the database's Watcher, and carry counts, sizes, rates and city names, never keys, values or client addresses.

Changes need signing in through the Access application on /signin (setup). Every change verifies the Access token against the team's signing keys, ACCESS_TEAM_DOMAIN as issuer and ACCESS_AUD as audience, before it runs. Signed in, you can create databases, run a command and see which shard and replica answered, restart a shard, and start test traffic, which stops by itself after 10 minutes. The dashboard refuses KEYS, FLUSHALL and FLUSHDB; those belong in a client.

The bench API

https://<your-worker>.workers.dev/<test>?... with Authorization: Bearer <BENCH_TOKEN>. Every test takes db (default default), and via=shard&shard=<i> to skip the router.

TestWhat it does
dbCreate a database, or return its record: shards, regions, replicas, flavour, password=new
stats, shardsEach shard's host stats, files and replica states; shards adds Valkey's INFO
throughputPipelined SETs (op=get reads them back) over conns connections: n, batch, value, keys
latencyOne PING, then n GETs one at a time: first reply, p50, p99 and max
runThe commands in a POSTed JSON array, such as [["SET","k","v"],["GET","k"]]
sendRun another test from a Sender object in region, so load starts where you choose
durability, write, verifyWrite known keys, abort every shard (or deploy in between), read them back
abortHard-reset one shard, all of them, or one region's replicas
staleness, rywReplica lag seen by a second connection; stale reads on one connection
commitHow long shard 0's storage takes to confirm a write, from inside the object
rewriteBGREWRITEAOF on shard 0 while another connection PINGs it
fill, fragWrite until OOM; measure fragmentation of wasm memory against used_memory
churnn connections, par at a time, each AUTH, SET, GET and close
dropDrop a database for good. Its name is never reused and its shards keep only a tombstone

Upgrading safely

  • During a deploy, old routers call new shards, old primaries stream to new replicas, and old shards send rewrites to new rewriters. Keep Durable Object methods and the rewriter's socket protocol stable, and make changes additive.
  • Each object's tables come from its migrations.ts. Add a migration; never edit a shipped one or rename a table or column.
  • New Durable Object classes need a new migration tag in the Worker's wrangler.jsonc.
  • Never remove a shard class, and keep rewriter classes in step with shard classes: class k finds REWRITER<k> by name.
  • Don't roll back past the change that added shard classes, or the one that stored file rows under keys. Older code can't find the shards or read the files written since.
  • Change capacity by appending an epoch. Existing databases keep their size.

Browse topics or type to search

Introductionvado runs real Valkey 9.1, compiled to WebAssembly, in Cloudflare Durable Objects. A router in a Worker spreads keys over the shards, so valkey-cli and ioredis see one ordinary server.What you getIntroductionA first commandIntroductionThe dashboardIntroductionRead onIntroductionQuick startCreate the Access application, deploy the Worker, and connect valkey-cli or ioredis. About ten minutes on Workers Paid.1. Create the Access applicationQuick start2. DeployQuick start3. Connect valkey-cliQuick start4. Connect from a WorkerQuick startRun it locallyQuick startArchitectureA router per connection, shard objects running Valkey with their AOF in SQLite, and memory-only replicas in other regions. What each part owns, and what it costs.Where everything livesArchitectureHow clients reach itArchitectureRouterArchitectureShardsArchitectureRead replicasArchitectureRewritersArchitectureCatalogArchitectureWatcher, Pulse and the dashboardArchitectureWhat the design buys, and costsArchitectureSharding and routingKeys hash to 16,384 slots, slots map to shards in contiguous ranges, and a database's size and placement are fixed when it is created.Slots and shardsSharding and routingShard countSharding and routingPlacementSharding and routingHow the router routesSharding and routingCROSSSLOTSharding and routingShard classesSharding and routingConnectionsSharding and routingUnsupported commandsSharding and routingDurabilityEvery acknowledged write is in SQLite before its reply leaves. Group commit keeps that cheap under load, a helper object compacts the AOF, and deploys restart shards without failing commands.Write-through storageDurabilityGroup commitDurabilityAOF rewrites in a helperDurabilityWhen a shard resetsDurabilityClean restarts on deployDurabilityRead replicasEach shard can keep a memory-only copy in other regions, fed from its AOF. Routers read the nearest one, a connection always reads its own writes, and an idle database's replicas sleep.RegionsRead replicasCopy, then streamRead replicasWhat a replica read can seeRead replicasFailuresRead replicasIdle sleepRead replicasLife of a requestWhat happens between a client sending SET k v and reading +OK, and what each reply tells you.One SET, step by stepLife of a requestWhat a reply tells youLife of a requestOperationsDeploy, configure, create databases with a placement, sign in to the dashboard, drive the bench API, and upgrade without breaking running shards.DeployOperationsSettingsOperationsCreate a database with a placementOperationsDashboard sign-inOperationsThe bench APIOperationsUpgrading safelyOperationsSecurityWho can connect, what clients may change, how data travels, where copies live, and what the bench token and the dashboard allow.AuthenticationSecurityWithout a passwordSecurityWhat clients can changeSecurityTransportSecurityReplicas and data locationSecurityThe bench token and the dashboardSecurityLimits and measurementsWhat one shard holds, how fast writes and reads went, and the conditions behind each number. Measured on production in November 2026, on one account.LimitsLimits and measurementsMemoryLimits and measurementsThroughputLimits and measurementsLatencyLimits and measurementsReplicasLimits and measurementsRewritesLimits and measurementsCold starts and deploysLimits and measurementsFailure testsLimits and measurementsWhat these don't showLimits and measurementsRedisA database can run Redis 8.12 instead of Valkey. It is opt-in at build time because it doubles the upload and is distributed under the AGPLv3.Choosing RedisRedisBuilding with RedisRedisDifferencesRedisThe AGPL licenceRedisRepositoryAn npm workspace: two apps and three packages. How to check, test and build it, and what CI runs on every push.LayoutRepositoryCommandsRepositoryEnd-to-end testsRepositoryContinuous integrationRepositoryThe wasm buildsRepositoryCode rulesRepository
Local search. Nothing is sent to a server.Esc to close
Documentation