Bedrock

active

by Expensify · since 2016 · also known as Bedrock by Expensify, BedrockDB

Expensify's WAN-replicated SQLite server with Paxos leader election, MySQL protocol and job/cache plugins.

relationaldatabase engineopen source (copyleft)mature

Overview

Bedrock is a networking and distributed-transaction layer that Expensify built on SQLite and runs as the primary database behind its product. Every node holds a full SQLite copy; nodes synchronise a hashed transaction journal (marketed as a 'private blockchain'), use Paxos to elect the highest-priority node as leader, and keep accepting work across data centres and availability zones, with zero-priority 'permafollowers' adding read capacity. Clients connect with any MySQL client or driver, or Bedrock's own text protocol, and functionality comes from plugins such as DB, Jobs (a durable job queue) and Cache. Because plugins run in-process next to SQLite, custom logic avoids network round trips. The C++ codebase is LGPL-licensed and still receives near-daily commits and date-stamped releases.

Strengths & trade-offs

Strengths

  • +Multi-datacentre replication with automatic Paxos-based failover and split-brain avoidance
  • +Full SQLite SQL with in-process plugins that skip network serialisation
  • +Drop-in MySQL protocol so standard clients and drivers work
  • +Built-in durable job queue and cache plugins
  • +Battle-tested as Expensify's production database and actively developed

Trade-offs

  • −Single-leader writes; no sharding, so the full dataset must fit every node
  • −Small community outside Expensify and sparse operational documentation
  • −Plugin development requires C++
  • −LGPL licence and Linux-only builds

Great for

  • +Highly available SQL backend spanning multiple data centres
  • +Durable job queues alongside relational data
  • +Teams that like SQLite semantics but need replication and failover

Think twice for

  • −Write-heavy workloads that need horizontal write scaling
  • −Datasets too large to replicate in full to every node

Capabilities

Native or official first-party support · 5 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓JSON
✓Durable persistence
–Full-text search
–Vector search
–Geospatial
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–Columnar storage
–In-memory
–Compression
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Medium · ≤ 10 TB
Horizontal scaling
None
Multi-region
Read replicas
Transactions
Full ACID
Consistency
Strong
Schema
Strict
Architecture
Distributed, Primary replica
Query languages
SQL (SQLite dialect)

Every node stores the full dataset; reads scale across nodes and zones while writes go through one elected leader.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

compatible withMySQL, SQLite
apis & protocolsMySQL wire protocol, Bedrock text protocol
client languagesAny MySQL driver, PHP
used byExpensify

Alternatives to Bedrock

Compare all→
rqliteRelational14.5

Lightweight distributed database that replicates SQLite over Raft behind a simple HTTP API.

bedrock vs rqlite →
dqliteRelational8.4

Canonical's embeddable C library that makes SQLite highly available with Raft replication.

bedrock vs dqlite →
libSQLRelational29.1

Turso's open-contribution SQLite fork with native vectors, a network server and embedded replicas.

bedrock vs libsql →
CockroachDBRelational47.1

Postgres-wire distributed SQL built to survive node, zone and region failures with serializable transactions.

bedrock vs cockroachdb →
MySQLRelational82.3

The web's default open-source SQL database, now on calendar versioning with 9.7 as the LTS line.

bedrock vs mysql →
Comdb2Relational10.9

Bloomberg's clustered relational database with optimistic concurrency and synchronous replication.

bedrock vs comdb2 →

Bedrock FAQ

What is Bedrock?

Bedrock is a relational database by Expensify, first released in 2016. Bedrock is a networking and distributed-transaction layer that Expensify built on SQLite and runs as the primary database behind its product. Every node holds a full SQLite copy; nodes synchronise a hashed transaction journal (marketed as a 'private blockchain'), use Paxos to elect the highest-priority node as leader, and keep accepting work across data centres and availability zones, with zero-priority 'permafollowers' adding read capacity. Clients connect with any MySQL client or driver, or Bedrock's own text protocol, and functionality comes from plugins such as DB, Jobs (a durable job queue) and Cache. Because plugins run in-process next to SQLite, custom logic avoids network round trips. The C++ codebase is LGPL-licensed and still receives near-daily commits and date-stamped releases.

Is Bedrock open source?

Yes. Bedrock is open source. License: GNU LGPL v3.

Does Bedrock support ACID transactions?

Yes. Bedrock supports full ACID transactions, with strong consistency.

Does Bedrock scale horizontally?

Bedrock does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at medium scale (≤ 10 TB). It supports cross-region read replicas.

How can I run Bedrock?

You can self-host it.

What is Bedrock best for?

Bedrock is a strong fit for highly available SQL backend spanning multiple data centres; durable job queues alongside relational data; and teams that like SQLite semantics but need replication and failover. Think twice for write-heavy workloads that need horizontal write scaling.

What are the best alternatives to Bedrock?

Common alternatives to Bedrock include rqlite, dqlite, libSQL, CockroachDB and MySQL. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is Bedrock?

Bedrock ranks #474 of 844 databases on the WhichDB Score (2.5/100), and #148 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.