Skip to main content
XenonStack

Big Data Engineering

XenonStack Blog FoundationDB Architecture: Roles, Limits and Use Cases

and | Published | Updated

FoundationDB Architecture: Roles, Limits and Use Cases
11:47

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.

PropertyWhat the docs sayWhat it means for you
TransactionsACID, strictly serializableMulti-key updates are atomic and isolated
Data modelOrdered key-value, byte stringsYou or a layer must define the higher-level model
Scale testedUp to 500 cores and 100 TB of key-value dataA tested bound, not a hard cap
HardwareCommodity serversSSD storage engine for datasets larger than memory
LicenceApache-2.0Open 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.

RoleWhat it does
CoordinatorsListed in the cluster file that clients and servers use to connect; they help elect the cluster controller
Cluster controllerA 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 proxiesGet commit versions, send conflict ranges to resolvers, make mutations durable on the logs
GRV proxiesHand out read versions; throttled by Ratekeeper
ResolversDetect conflicts by checking reads against recent committed writes, holding the last 5 seconds in memory
Transaction logsMake mutations durable on disk for fast commit latency
Storage serversOwn key ranges and serve reads; most processes in a cluster are storage servers
Data distributorA singleton that assigns key ranges and balances data across storage servers
RatekeeperA 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:

Two-column diagram: left lists GRV proxy, storage server, commit proxy and resolver; right lists what each does, ending in a durable commit on the transaction logs or a conflict error.
  1. The client asks a GRV proxy for a read version, and the proxy confirms the logs are live.
  2. The client reads from storage servers at that version. Writes stay in client memory until commit.
  3. At commit, the client sends its reads and writes to a commit proxy.
  4. The proxy obtains a commit version from the master and sends conflict ranges to the resolvers.
  5. 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:

LimitDocumented valueDesign implication
Transaction durationOver 5 seconds not supportedSplit long jobs into short transactions
Transaction size10,000,000 bytes of affected data; over 1 MB suggests a design changeBatch writes in small units
Key size10,000 bytesKeep keys short
Value size100,000 bytesStore large objects through a blob layer or elsewhere
Hot key rangesAbout the combined performance of three server processes, typically around 100,000 reads per second, in a triple-replicated systemSpread hot keys across ranges
Access controlNo user-level access controlEnforce 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.

TestSetupResult
Scaling24 EC2 c3.8xlarge machines, 384 processes, 90% reads and 10% writes8.2 million operations per second
Latency under 75% load12 machines with E3-1240 cores and SATA SSD, 48 processesStart 0.3 to 1 ms, read 0.1 to 1 ms, commit 1.5 to 2.5 ms
Single-core readsOne process on one core55,000 per second on the SSD engine, 90,000 on the memory engine
Single-core writesOne process on one core20,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.

ModelHow you get itWhen it fits
Key-valueCore API with the tuple layerCustom data structures and indexes you design
Records and SQL-style accessRecord Layer (Java)Multi-tenant structured records with indexes
DocumentsDocument 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?

SituationFitReason
Strongly consistent core for many servicesGoodStrict serializability across the database
Teams that can build or adopt a layerGoodKey-value core needs a data model on top
Long-running transactions or very large objectsPoor5-second, 10 MB and 100 KB value limits
Ad hoc SQL with joins out of the boxPoorThe core has no SQL; the Record Layer is Java-based
Needs per-user access control in the databasePoorThe 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.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue