How Raft DB compares with other databases
One page on how Raft DB compares with MySQL, PostgreSQL, MongoDB and SQLite, with the measured YCSB numbers, how they were taken and why they are only relative.
This page gives the first comparison run of the project. Read the caveats before the numbers: they decide what the numbers mean. The numbers were measured with Raft DB's own benchmark harness, which is not part of the download; further numbers are in the performance chapter.
What kind of system it is#
| Raft DB | MySQL / MariaDB | PostgreSQL | MongoDB | SQLite | |
|---|---|---|---|---|---|
| Data model | Documents in tables; SQL front-ends and a JSON filter API | Rows | Rows (plus jsonb) | Documents | Rows |
| Query language | SQL (MySQL or MariaDB dialect), JSON filters | SQL | SQL | Its own query language | SQL |
| Wire protocol | Own binary protocol, HTTP/JSON, MySQL, MariaDB, SQL Server (TDS), PostgreSQL | MySQL | PostgreSQL | MongoDB | In process |
| Durable by default | Yes: acknowledged after fsync | Yes (InnoDB defaults) | Yes | Only with the journal option | Depends on synchronous |
| Isolation between SQL transactions | Per table, READ-COMMITTED (a writer holds its tables until the end; no snapshot reads) | Yes | Yes | Yes | Yes |
| TLS for client connections | Yes (MySQL, MariaDB, SQL Server and PostgreSQL front-ends; not the other links) | Yes | Yes | Yes | Not applicable |
| Replication | Log shipping, synchronous option, watcher-quorum failover | Yes | Yes | Yes | No |
| Maturity | Pre-release | Decades | Decades | Years | Decades |
Throughput on one Windows laptop (YCSB, operations/s)#
Setup: one machine (i7-10750H, 6 cores, 31.8 GB, NVMe), clients and servers sharing it; 100,000 records of 10 fields x 100 bytes; 8 client threads; Zipfian; every database acknowledges a write only after fsync; writeallfields=true; defaults for the other databases (MySQL 9.7.1 with a 128 MB buffer pool, PostgreSQL 18.0 with 128 MB shared_buffers, MongoDB 8.2.2 with w=1&journal=true). One run per cell. Raft DB ran through its binary protocol in the second table and through HTTP in the first.
| ops/s | Raft DB (HTTP) | Raft DB (binary) | MongoDB | MySQL | PostgreSQL | SQLite |
|---|---|---|---|---|---|---|
| Load (100% insert) | 11,843 | 26,199 | 7,579 | 3,270 | 16,049 | 1,751 |
| A: 50% read, 50% update | 13,087 | 31,270 | 9,729 | 4,789 | 18,403 | 3,444 |
| B: 95% read, 5% update | 14,635 | 43,764 | 16,532 | 14,706 | 29,172 | 15,625 |
| C: 100% read | 14,453 | 45,290 | 18,245 | 21,450 | 32,041 | 66,269 |
| D: 95% read, 5% insert | 14,728 | 46,620 | 14,233 | 14,923 | 29,472 | 15,962 |
| F: 50% read, 50% read-modify-write | 9,466 | 24,913 | 6,651 | 3,793 | 15,063 | 3,446 |
Caveats of the run:
- The PostgreSQL, MongoDB, MySQL and SQLite columns come from the earlier run on the same machine, not re-measured with the binary driver.
- Differences under about 15% are noise (one run per cell, no variance reported).
- SQLite's read figures are not comparable: it runs inside the benchmark's process.
- Raft DB has no key-range scan yet, so workload E is not run for it.
- Raft DB's log is opened write-through on Windows (D37); on Linux the write-through gain must not be assumed.
Linux: Raft DB against PostgreSQL and MySQL#
Run on a 4-core Ubuntu 24.04 server (SATA SSD, ext4), with the machine's owner's permission, fenced to two cores. Raft DB through its binary protocol; PostgreSQL 16.15 and MySQL 8.4.6 with defaults and fsync before every acknowledgement.
| ops/s | Raft DB (binary) | PostgreSQL 16 | MySQL 8.4 |
|---|---|---|---|
| Load (insert) | 11,251 | 9,574 | 3,053 |
| A | 16,656 | 11,725 | 3,628 |
| C | 24,777 | 19,168 | 9,323 |
| F | 12,918 | 9,327 | 2,209 |
The load generator, the database and the client JVM shared two cores, so every number is partly CPU bound. PostgreSQL's read p99 (642 us) is slightly better than Raft DB's (716 us).
The MySQL front-end against MySQL#
With the SQL front-end in one process (embed), the decision log (D66) records throughput through the stock JDBC driver level with or ahead of MySQL 9.7 on every workload of the JDBC benchmark; in two processes reads stay behind MySQL (D66, D69). These are measurements on one machine of 12 processors; see the performance chapter for the figures and their conditions.
How to read this honestly#
- A single-node, in-memory-first engine with a lean binary protocol is expected to be fast on key reads and durable inserts. That says nothing about large data, complex queries, many concurrent transactions or long uptime.
- Not measured yet: CPU, memory and disk bytes per operation, multi-run variance, thread sweeps, data larger than memory, kill-and-restart durability under the benchmark.
- The ordering in this table may change on other hardware. Run your own workload.