DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

Bedrock


Bedrock is a distributed relational DBMS designed for geo-replication. It uses SQLite as its backing data storage and supports the MySQL wire protocol.[01]

Source Code
https://github.com/Expensify/Bedrock[02]
Developer
Country of Origin
US
Start Year
2016 [06]
Project Type
Open Source
Written in
C++
Supported Languages
C++
Embeds / Uses
SQLite
Inspired By
SQLite
Compatible With
MySQL
Operating Systems
Linux, macOS
License
LGPL v3

Database Entry

Bedrock


Bedrock is a distributed relational DBMS designed for geo-replication. It uses SQLite as its backing data storage and supports the MySQL wire protocol.[01]

History[03][04][01]


BedRock is the system that backs Expensify, the expense management company. It had been used for 8 years prior to being launched. It was originally created as an in house solution to the strict database constraints of financial institutions - response time within milliseconds, transaction logging and authentication, and replication of multiple servers.

Concurrency Control[05]


Bedrock's synchronization engine is a private distributed general ledger, i.e, a private blockchain. It has an internal table called journal, which has 3 columns called id, query, hash. Each time a query is committed to the database, a new row is inserted into the journal. The new row records the query, and calculates the new incremental hash based on the previous row. When a server connects to a cluster, the most recent id and hash are broadcasted. If two servers disagree on the the hash corresponding to the id, then they know that they have "forked" at some point and stop communicating with each other. A Paxos-based election scheme decides which fork stands up to the new master.

Data Model


Hardware Acceleration[01]


Bedrock is written for modern hardware with SSD-backed RAID drives and RAM file caches. It was made to be "simple", not requiring any esoteric hardware hacks as done by other systems. Hence, there is no standard hardware acceleration option.

Indexes


Logging


Query Interface


Storage Architecture


Storage Model


System Architecture


Citations

6 sources
  1. Bedrock by Expensify bedrockdb.com
  2. GitHub - Expensify/Bedrock: Rock solid distributed database specializing in active/active automatic failover and WAN replication · GitHub github.com
  3. Bedrock/docs at main · Expensify/Bedrock · GitHub github.com
  4. Your Database is Your Prison — Here’s How Expensify Broke Free firstround.com
  5. Bedrock by Expensify bedrockdb.com
  6. First commit github.com
Revision #15