Performance

Comparison on Windows

YCSB results of Raft DB against MongoDB, MySQL, PostgreSQL and SQLite on one Windows laptop, with the exact setup and caveats.

Source: the project's comparison log, first run 2026-11-09. Relative numbers only. One Windows 11 laptop (i7-10750H, 6 cores / 12 threads, 31.8 GB RAM, 512 GB NVMe); clients and servers compete for the same CPU. Harness: Raft DB's own (YCSB 0.17.0, Java client, driven by a script). Raw results are kept by the project and are not published here.

Conditions#

  • 100,000 records of 10 fields x 100 bytes; 100,000 operations per workload (workload E: 10,000); 8 client threads, closed loop; Zipfian (D: latest); insertorder=hashed; writeallfields=true, so an update replaces the whole record everywhere (Raft DB has no partial update).
  • Durability: a write is acknowledged only after fsync in every database. Raft DB: default WAL (sync on, group commit, 2 shards). MongoDB 8.2.2 w=1&journal=true. MySQL 9.7.1 InnoDB flush_log_at_trx_commit=1, sync_binlog=1. PostgreSQL 18.0 fsync=on, synchronous_commit=on, wal_sync_method=open_datasync. SQLite 3.54 WAL with synchronous=FULL.
  • Not tuned: MySQL innodb_buffer_pool_size 128 MB and PostgreSQL shared_buffers 128 MB are defaults; MongoDB uses its default cache. A tuned comparison is future work.
  • Raft DB was first measured through its HTTP/JSON API, its slowest interface (keep-alive, one request per operation). Raft DB has no key-range scan in this benchmark, so workload E was not run for it.
  • One run per cell, no variance reported. Treat differences under about 15 % as noise.

Throughput, first run (operations/s)#

WorkloadRaft DB (HTTP)MongoDBMySQLPostgreSQLSQLite
Load (100% insert)6,5577,5793,27016,0491,751
A 50% read / 50% update8,9639,7294,78918,4033,444
B 95% read / 5% update13,29816,53214,70629,17215,625
C 100% read14,19218,24521,45032,04166,269
D 95% read / 5% insert (latest)13,85014,23314,92329,47215,962
E 95% scan / 5% insertn/a2,5854,1775,0102,652
F 50% read / 50% read-modify-write7,0706,6513,79315,0633,446

Latency, first run (microseconds, average / 99th percentile)#

Raft DB (HTTP)MongoDBMySQLPostgreSQLSQLite
read, workload C532 / 1,523376 / 1,101339 / 755219 / 38699 / 286
insert, load1,191 / 2,3071,001 / 1,5452,407 / 12,375475 / 1,0514,216 / 8,335
update, workload A1,289 / 2,5111,227 / 2,1653,006 / 14,799587 / 1,3473,779 / 7,131

Update the same day: write-through log and the binary protocol#

Studying how PostgreSQL commits on Windows led to D37: Raft DB's log is opened write-through and kept zero-filled. A new YCSB driver speaks Raft DB's binary protocol (RaftDBBinClient). Same setup, one run per cell. The PostgreSQL and MongoDB columns are from the earlier run, not re-measured.

ops/sRaft DB HTTP (before)Raft DB HTTP (now)Raft DB binary (now)PostgreSQLMongoDB
Load (insert)6,55711,84326,19916,0497,579
A8,96313,08731,27018,4039,729
B13,29814,63543,76429,17216,532
C14,19214,45345,29032,04118,245
D13,85014,72846,62029,47214,233
F7,0709,46624,91315,0636,651

Raft DB binary latency (average / p99, us): read C 169 / 465 (PostgreSQL 219 / 386); insert 298 / 460 (PostgreSQL 475 / 1,051); update A 335 / 681 (PostgreSQL 587 / 1,347). PostgreSQL still has the better read p99.

What the comparison concludes#

  • On the HTTP path Raft DB is in the range of MongoDB for durable writes (about 85-90 % of it) and about 2x behind PostgreSQL.
  • SQLite's reads are not comparable: it runs inside the benchmark's process, with no network or protocol cost.
  • About 500 inserts per database in workload E fail with ERROR because workload D already inserted those keys; scan figures are unaffected.
  • Not measured: CPU, memory and disk bytes per operation, multi-run variance, thread sweeps, larger-than-memory data, kill-and-restart durability.
  • Windows only. The write-through gain comes from FlushFileBuffers being expensive on NTFS; do not assume it on Linux (Comparison on Linux).

See also#