Introduction

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 DBMySQL / MariaDBPostgreSQLMongoDBSQLite
Data modelDocuments in tables; SQL front-ends and a JSON filter APIRowsRows (plus jsonb)DocumentsRows
Query languageSQL (MySQL or MariaDB dialect), JSON filtersSQLSQLIts own query languageSQL
Wire protocolOwn binary protocol, HTTP/JSON, MySQL, MariaDB, SQL Server (TDS), PostgreSQLMySQLPostgreSQLMongoDBIn process
Durable by defaultYes: acknowledged after fsyncYes (InnoDB defaults)YesOnly with the journal optionDepends on synchronous
Isolation between SQL transactionsPer table, READ-COMMITTED (a writer holds its tables until the end; no snapshot reads)YesYesYesYes
TLS for client connectionsYes (MySQL, MariaDB, SQL Server and PostgreSQL front-ends; not the other links)YesYesYesNot applicable
ReplicationLog shipping, synchronous option, watcher-quorum failoverYesYesYesNo
MaturityPre-releaseDecadesDecadesYearsDecades

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/sRaft DB (HTTP)Raft DB (binary)MongoDBMySQLPostgreSQLSQLite
Load (100% insert)11,84326,1997,5793,27016,0491,751
A: 50% read, 50% update13,08731,2709,7294,78918,4033,444
B: 95% read, 5% update14,63543,76416,53214,70629,17215,625
C: 100% read14,45345,29018,24521,45032,04166,269
D: 95% read, 5% insert14,72846,62014,23314,92329,47215,962
F: 50% read, 50% read-modify-write9,46624,9136,6513,79315,0633,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/sRaft DB (binary)PostgreSQL 16MySQL 8.4
Load (insert)11,2519,5743,053
A16,65611,7253,628
C24,77719,1689,323
F12,9189,3272,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.

See also#