1/57
Looks like no tags are added yet.
What is a distributed system?
Multiple machines coordinating over a network to look like one system, which must handle partial failure, unreliable networks, and no shared clock.
What is the CAP theorem?
During a network partition, a system must choose between consistency and availability. You can't have both.
Where does FoundationDB sit on CAP?
CP. It favors strict consistency; during a partition, the side without a quorum becomes unavailable rather than returning stale or divergent data.
What is the difference between serializability and strict serializability?
Serializability: transactions behave as if run in some serial order. Strict serializability: that order also respects real-time order (if A finishes before B starts, A comes first). FDB provides strict serializability.
What is linearizability?
Single-object guarantee: every operation appears to take effect atomically at one point between its start and end. Strict serializability is its multi-object transaction equivalent.
What are ACID properties?
Atomicity (all or nothing), Consistency (invariants hold), Isolation (concurrent transactions don't interfere), Durability (committed data survives crashes).
What is consensus?
Getting multiple nodes to agree on a single value despite failures. Paxos and Raft are the classic protocols.
What is a quorum?
A majority of nodes (e.g. 2 of 3). Requiring quorum for decisions ensures any two quorums overlap, which prevents split-brain.
What is split-brain?
Two parts of a partitioned system both believe they are in charge and accept conflicting writes. Quorums prevent it.
What is sharding (partitioning)?
Splitting data across machines by key range or hash so no single node holds everything. FDB shards by key range.
What is replication and why use it?
Keeping copies of data on multiple machines for fault tolerance and read capacity. The cost is keeping the copies consistent.
What is a hot spot (hot key/shard)?
A small key range receiving disproportionate traffic, overloading one machine. A common issue with ordered key spaces such as monotonically increasing keys.
What is two-phase commit (2PC)?
A protocol for atomic commit across nodes: prepare/vote, then commit/abort. It blocks if the coordinator fails at the wrong time.
What is MVCC?
Multi-version concurrency control: keep multiple versions of data so readers see a consistent snapshot without blocking writers.
What is optimistic concurrency control (OCC)?
Transactions run without locks, then at commit time are checked for conflicts and aborted/retried if one is found. Good when conflicts are rare.
What is the difference between optimistic and pessimistic concurrency?
Pessimistic takes locks up front and blocks others. Optimistic proceeds freely and validates at commit. FDB is optimistic.
What is idempotency and why does it matter?
Repeating an operation has the same effect as doing it once. Essential because retries are unavoidable in distributed systems.
What is a snapshot read?
A read at a consistent version that doesn't add a read conflict, so concurrent writes to that key won't abort your transaction. Trades isolation for fewer conflicts.
What is FoundationDB?
A distributed, ordered key-value store with strictly serializable ACID transactions across arbitrary keys, designed for correctness and tested with deterministic simulation.
What is FDB's "unbundled" design?
Transaction management (timestamps, conflict checking, logging) is separated from storage, and each part scales independently.
What do FDB coordinators do?
A small set of nodes running Paxos that store cluster connection info and elect the cluster controller. They are not on the data path.
What does the cluster controller do?
It is elected by the coordinators, monitors the cluster, and recruits and assigns the other roles.
What is the sequencer (master)?
It hands out commit versions in order and tracks the latest committed version, giving transactions a total order.
What are GRV proxies?
They serve "get read version" requests, giving clients a read version that reflects all previously committed transactions.
What are commit proxies?
They accept commits from clients, get a commit version from the sequencer, send the transaction to resolvers, then push it to the transaction logs.
What are resolvers?
They check committing transactions' read conflict ranges against recent writes and reject conflicting transactions. Each handles a slice of the key space.
What are transaction logs (TLogs)?
They durably store committed mutations (replicated) before the commit is acknowledged. Storage servers pull from them.
What are storage servers?
They hold the actual key ranges (shards), serve reads at a given version, and asynchronously apply mutations pulled from the TLogs.
Walk through an FDB transaction.
1) Get read version (GRV proxy). 2) Read from storage servers at that version. 3) Buffer writes locally. 4) Commit: proxy gets a commit version, resolvers check conflicts, TLogs persist, then success is returned.
How does FDB detect conflicts?
Resolvers check whether any key in a transaction's read conflict ranges was written by a transaction committed after its read version. If so, it aborts with a conflict error.
Why do write-only transactions never conflict in FDB?
Conflicts are detected only on reads. With no read conflict ranges, there is nothing to invalidate.
Why does FDB have a 5-second transaction limit?
Storage servers keep only about 5 seconds of MVCC versions in memory. A transaction older than that gets transaction_too_old.
What is the FDB retry loop?
Client code wraps the transaction in a loop: on retryable errors like conflicts, the transaction is reset and the whole function re-run. Transaction logic must therefore be safe to re-execute.
What does commit_unknown_result mean?
The client lost contact before learning whether the commit succeeded. The transaction may have committed, so logic needs idempotency or a check.
What is a read version vs a commit version?
Read version: the snapshot the transaction reads from. Commit version: the position in the global order assigned when it commits.
What is a versionstamp?
A unique, monotonically increasing value filled in by FDB at commit (commit version + batch order). Useful for ordering keys and sync without extra coordination.
What are FDB atomic operations?
Mutations like ADD, MAX, MIN, and bit operations applied at the storage servers without reading first, so they don't create read conflicts. Used for counters and count/sum indexes.
What are FDB watches?
A client can ask to be notified when a key's value changes, avoiding polling.
What are FDB's size limits?
Key: 10 KB. Value: 100 KB. Transaction: 10 MB. Time: 5 seconds.
What is the Tuple layer?
An encoding that turns typed tuples (strings, ints, etc.) into byte keys that sort correctly. The Record Layer builds its keys with it.
What is a subspace?
A key prefix that carves out a namespace in the single key space. Record stores use subspaces as their "folders."
What is the Directory layer?
Maps human-readable paths to short integer prefixes, so keys stay compact and directories can be renamed or moved cheaply.
What does FDB's data distribution do?
It splits key ranges into shards, assigns them to storage teams, and rebalances automatically for size and load.
What is Ratekeeper?
A component that throttles transaction starts when storage servers or logs fall behind, protecting the cluster from overload.
How does FDB tolerate failures?
Data is replicated (single, double, or triple redundancy modes). On failure, a recovery process picks a new transaction subsystem and continues from the durable log.
What happens during FDB recovery?
The cluster controller recruits a new transaction subsystem (sequencer, proxies, resolvers, logs), locks the old logs, and resumes from the last durable committed version. Typically only seconds.
What is deterministic simulation testing?
FDB runs the whole database in a single-threaded simulator with controlled randomness, injecting failures (network, disk, machine) and replaying bugs exactly from a seed.
What is Flow?
FDB's C++ actor-based extension for asynchronous programming. It is what made deterministic simulation possible.
What is FDB's "layer" concept?
FDB's core stays minimal (ordered KV + transactions); richer data models like the Record Layer are built on top as layers.
Why can FDB give transactions across the whole key space?
All commits are serialized through the sequencer and resolvers, giving a global order, so any keys can participate in one transaction.
What is the tradeoff of FDB's design?
Strong consistency and simplicity at the cost of the 5s/10MB limits, centralized commit pipeline throughput, and conflicts on hot keys.
How does the Record Layer exploit FDB's design?
Records and index entries are plain keys, so FDB's transactions keep them consistent, and its limits shape continuations, splitting, and online index builds.
Why is statelessness valuable for the Record Layer?
All state is in FDB, so clients can be scaled, restarted, or load-balanced freely, and any server can handle any request.
What is multi-tenancy and its main risks?
Many independent customers on shared infrastructure. Risks: noisy neighbors, isolation, per-tenant limits, and fair resource sharing.
What is a noisy neighbor problem?
One tenant using a disproportionate share of resources degrades others. The Record Layer's scan limits and FDB's throttling mitigate this.
What are eventual consistency and its contrast with FDB?
Replicas converge over time but may serve stale reads. FDB instead gives every read a consistent snapshot and strict serializability.
What is write amplification in indexing?
Each indexed field adds an extra key write per record write, so more indexes mean more work per transaction (and a closer approach to the 10 MB limit).
Why scan in pages with continuations rather than one big query?
The 5s/10MB limits, plus fairness and memory use. Each page is one short transaction and the continuation carries the position.