Skip to content

Engineering notes

These notes explain how fdyno uses FoundationDB and how we check that it behaves as intended: through SDK tests, protocol models, deterministic simulation, and faults on real clusters.

Why cancelling sent work can collapse goodput

Cancelling a request may not remove it from the server's queue. Then the entry still takes its turn, and the retry joins the back. Cancelling only adds load. We tested this in a FIFO model that runs fdyno's real Go handlers. When requests waited, the load fully recovered. When requests gave up, the same load completed zero reads.

Trust the checker, then check the checker

Test your checker on histories with known answers before you trust its verdicts. On two three-operation histories, each with one known anomaly, elle-cli 0.1.11 printed no verdict at all: not valid, not invalid.

Restoring 5 TB, measured

A zero-loss restore test with a fence tests the backup path, not what you lose after a sudden failure. In one EC2 run, the database reached 5 TB through the fdyno API 2 h 22 min after the load began. The restore into a new cluster took 8.4 hours. The audit found 0 of 164,680 acknowledged writes missing. The writers had stopped and the backup had drained before the restore, so this tested the backup path.

A guard protects only a commit that conflicts on it

An extra write record or a lease epoch stops a bad commit only if it is a conflict dependency of that commit. That means a normal read in the same transaction, or an explicit read-conflict key. In fdyno's TLA+ models and simulator, three variants lacked that dependency. The first let a retry apply an increment twice. The second let a late original commit delete another client's write. The third let a worker commit after its lease was taken over.

Rebuilding a lost Region on FoundationDB 7.3, and why the fast path is unsafe

Prefer a repair whose exposure you can name and audit over a shortcut whose loss you cannot see. On FoundationDB 7.3.51, the safe rebuild of a lost Region opens a window in which new writes live in one Region only. In one local check, 54 acknowledged writes fell in that window. The audit could list each one by commit version. The repopulate_anti_quorum shortcut can drop history that the rebuilt Region still needs, with no record of what.

Stuck, not broken

A hang is worse than a crash: a supervisor restarts a crash and an alert shows it, but a hang looks healthy for ever. In fdyno, an export whose destination no worker could verify stayed IN_PROGRESS for ever, with no error. A review of the background jobs found more cases like it. Each fix gave the job an end state or a way past the item that blocked it.

Never let time lead a key that every write touches

In an ordered key-value store, a key that starts with a rising timestamp sends new writes near the end of one range. The storage team that holds that end can limit the whole cluster. We ran a historical A/B test at 30 storage hosts. It spread fdyno's time-led extra write record keys over 64 fixed prefixes. At matched load, the hottest storage server's input fell from 3.96 to 1.72 times the median. The highest sustained offered rate rose 32%, from 201,136 to 266,002 operations per second (cluster version 9, prefixes off to on; runs fdyno-hab10xa-a1 and fdyno-hab10xb-a1, build a2f43417).

Strict serializability, and where it stops

Strict serializability orders committed transactions in real time. It does not make several of them one atomic operation, or give successive pages one snapshot. In fdyno, every item write and transaction API call is one FoundationDB transaction. That rules out lost updates and write skew. A paginated Query is not one transaction. If page 1 ends at sort key B and a writer then adds A and C, page 2 can return C and never A.

What a synchronous secondary index costs

A synchronous index removes index propagation lag, but every write pays for every index entry it moves. On EC2, PutItem fell from 40,806/s with no index to 4,731/s with ten ALL indexes whose keys moved. It kept 34,640/s, about 85%, with ten KEYS_ONLY indexes whose keys did not move (a pre-v0.1 build with default cluster version 3; run aws-20261118-cliffs-gsi).