Key takeaway
- FoundationDB architecture explained: roles, transaction flow, recovery, documented limits, performance and data layers, with guidance on when to use it.
What is FoundationDB and what is it used for?
FoundationDB is an open-source, distributed, transactional key-value store. According to its GitHub project, it holds large volumes of structured data on commodity servers, keeps keys in order and offers ACID transactions across the whole database. It is released under the Apache-2.0 licence.
It suits teams that want one strongly consistent storage core and are willing to build their own data model on top of it. If you are still comparing database families, start with our guides to NoSQL databases and SQL vs NoSQL vs NewSQL.
Why do enterprises look at FoundationDB?
According to its docs, FoundationDB provides strict serializability, which its consistency page describes as the strongest consistency model available. Applications that update several keys in one step do not have to reason about partial writes or concurrent interleaving, which is the main reason architects consider it for systems of record.
| Property | What the docs say | What it means for you |
|---|---|---|
| Transactions | ACID, strictly serializable | Multi-key updates are atomic and isolated |
| Data model | Ordered key-value, byte strings | You or a layer must define the higher-level model |
| Scale tested | Up to 500 cores and 100 TB of key-value data | A tested bound, not a hard cap |
| Hardware | Commodity servers | SSD storage engine for datasets larger than memory |
| Licence | Apache-2.0 | Open source, with no licence fee |
Sources: the known limitations and consistency pages of the FoundationDB docs.
What is the architecture of FoundationDB?
According to its architecture docs, FoundationDB separates work across process roles. Stateless roles can share a process, and you scale a role by adding processes for it. The transaction system (master, proxies, resolvers and transaction logs) is separate from the storage servers that hold the data.
| Role | What it does |
|---|---|
| Coordinators | Listed in the cluster file that clients and servers use to connect; they help elect the cluster controller |
| Cluster controller | A singleton elected by a majority of coordinators; detects failures and assigns roles |
| Master (sequencer) | Provides commit versions for batches of mutations and coordinates moves between generations of the write subsystem |
| Commit proxies | Get commit versions, send conflict ranges to resolvers, make mutations durable on the logs |
| GRV proxies | Hand out read versions; throttled by Ratekeeper |
| Resolvers | Detect conflicts by checking reads against recent committed writes, holding the last 5 seconds in memory |
| Transaction logs | Make mutations durable on disk for fast commit latency |
| Storage servers | Own key ranges and serve reads; most processes in a cluster are storage servers |
| Data distributor | A singleton that assigns key ranges and balances data across storage servers |
| Ratekeeper | A singleton that slows client transaction rate when the cluster nears saturation |
Read versions are served by GRV proxies, separate from commit proxies, and Ratekeeper throttles them when the cluster nears saturation.
How does a FoundationDB transaction work?
The architecture docs describe five steps:
- The client asks a GRV proxy for a read version, and the proxy confirms the logs are live.
- The client reads from storage servers at that version. Writes stay in client memory until commit.
- At commit, the client sends its reads and writes to a commit proxy.
- The proxy obtains a commit version from the master and sends conflict ranges to the resolvers.
- With no conflict, the proxy writes the mutations to the transaction logs. Once they are durable, the client gets success. A conflict returns a not_committed error.
The design choice that matters is the split: transaction processing, logging and storage are separate, so each can scale on its own. Because conflicts are detected at commit rather than by locking, applications must be ready to retry.
What happens when a FoundationDB cluster fails over?
According to the architecture docs, if a master, proxy, resolver or log fails, the master terminates and the cluster controller recruits a new one to run recovery. Each generation of the transaction system is an epoch. Recovery typically takes a few hundred milliseconds, though it can take seconds, and in-flight transactions fail with transaction_too_old. If a commit is interrupted, a client may see commit_result_unknown, and the docs strongly recommend idempotent transactions so that retries are safe.
The project also tests this with deterministic simulation. Its testing docs describe running an entire cluster inside one single-threaded process, modelling machines, disks and networks, and injecting failures such as connection loss, reboots and datacenter outages, with every run repeatable.
What are the documented limits of FoundationDB?
Limits decide whether a workload fits. The known limitations page lists these:
| Limit | Documented value | Design implication |
|---|---|---|
| Transaction duration | Over 5 seconds not supported | Split long jobs into short transactions |
| Transaction size | 10,000,000 bytes of affected data; over 1 MB suggests a design change | Batch writes in small units |
| Key size | 10,000 bytes | Keep keys short |
| Value size | 100,000 bytes | Store large objects through a blob layer or elsewhere |
| Hot key ranges | About the combined performance of three server processes, typically around 100,000 reads per second, in a triple-replicated system | Spread hot keys across ranges |
| Access control | No user-level access control | Enforce it in the application or network layer |
How does FoundationDB perform?
The performance page reports figures on named hardware. They are vendor benchmarks, so test your own workload before relying on them.
| Test | Setup | Result |
|---|---|---|
| Scaling | 24 EC2 c3.8xlarge machines, 384 processes, 90% reads and 10% writes | 8.2 million operations per second |
| Latency under 75% load | 12 machines with E3-1240 cores and SATA SSD, 48 processes | Start 0.3 to 1 ms, read 0.1 to 1 ms, commit 1.5 to 2.5 ms |
| Single-core reads | One process on one core | 55,000 per second on the SSD engine, 90,000 on the memory engine |
| Single-core writes | One process on one core | 20,000 per second on the SSD engine, 35,000 on the memory engine |
The docs add that maximum throughput needs a highly concurrent workload. In their test, a single process reached peak throughput at about 200 concurrent operations. This follows the general queueing relation that throughput equals outstanding requests divided by latency, so too few parallel requests is the usual cause of low throughput. The SSD engine suits datasets that do not fit in memory, and the memory engine suits datasets that do; both write to disk before reporting a commit.
How do you model data on FoundationDB?
The core is an ordered key-value store, and its data modelling guide states that keys and values are byte strings in lexicographic order. Because range reads follow that order, you design keys so that related data sits together. The tuple layer encodes tuples such as (state, county) into keys while keeping their order, so a prefix read returns every matching key.
Richer models come from layers on top of the core. The Record Layer is a Java library that adds record storage, indexing, a query planner and SQL access on top of FoundationDB, and per its docs it is stateless. The Document Layer implements a subset of the MongoDB API version 3.0.0 and is licensed under Apache 2.0; its README lists differences, so check compatibility before choosing it.
| Model | How you get it | When it fits |
|---|---|---|
| Key-value | Core API with the tuple layer | Custom data structures and indexes you design |
| Records and SQL-style access | Record Layer (Java) | Multi-tenant structured records with indexes |
| Documents | Document Layer (MongoDB 3.0.0 subset) | Only if its documented subset covers your queries |
Where is FoundationDB used?
The Record Layer paper (Chrysafis et al., on arXiv) states that Apple's CloudKit uses the Record Layer, built on FoundationDB, to serve applications with hundreds of millions of users, hosting billions of separate databases. The paper describes the layer as designed for massive multi-tenancy, with each tenant isolated in its own logical database.
For a wide-column alternative, see our guide to Apache Cassandra, and for managed options see cloud native databases.
When should you choose FoundationDB, and when not?
| Situation | Fit | Reason |
|---|---|---|
| Strongly consistent core for many services | Good | Strict serializability across the database |
| Teams that can build or adopt a layer | Good | Key-value core needs a data model on top |
| Long-running transactions or very large objects | Poor | 5-second, 10 MB and 100 KB value limits |
| Ad hoc SQL with joins out of the box | Poor | The core has no SQL; the Record Layer is Java-based |
| Needs per-user access control in the database | Poor | The docs list none |
Adopt in this order: prototype the key design for your top three queries, load-test with enough concurrency, add retry and idempotency handling, then plan operations and backup. When AI agents read or write this data, the decision layer above the database matters too: ElixirData keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and AgentAnalyst lets teams ask questions of enterprise data in plain language and get real-time insights. For the orchestration side, see agentic workflows.
To map one data decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
FoundationDB FAQ
Is FoundationDB a NoSQL database?
According to its docs, it is a distributed, transactional, ordered key-value store. It is a NoSQL store that also provides ACID transactions.
Is FoundationDB open source?
Yes. Its GitHub project states the Apache-2.0 licence.
What are the transaction limits in FoundationDB?
The known limitations page lists a 5-second transaction duration, 10,000,000 bytes of affected data, 10,000-byte keys and 100,000-byte values.
Does FoundationDB support SQL or documents?
Not in the core. The Record Layer adds SQL and JDBC access for Java, and the Document Layer implements a subset of the MongoDB 3.0.0 API.
How does FoundationDB handle failures?
If a transaction-system role fails, the cluster controller recruits a new master and recovery runs, typically in a few hundred milliseconds. The docs recommend idempotent transactions.
Who uses FoundationDB?
The Record Layer paper states that Apple's CloudKit uses it, built on FoundationDB, to serve applications with hundreds of millions of users.
Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.
Ready to put AI agents to work? Explore ElixirClaw, the agentic OS platform to build, orchestrate and govern AI agents.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE