Benchmarks

Real benchmark numbers comparing ALOS DB against MongoDB and PostgreSQL. All databases run as separate server processes accessed over TCP on localhost, with no embedded or in-process shortcuts. The comparison is network-to-network fair.

Overview

These benchmarks test ALOS DB in Remote Mode: full client-server over TCP with MessagePack serialization, connection pooling, and network round-trips on every operation. ALOS DB runs as a standalone TCP server process. PostgreSQL and MongoDB also run as separate server processes (Docker containers) accessed over TCP on localhost. All benchmark comparisons are network-to-network fair. No database runs embedded or in-process during testing. ALOS DB supports two durability modes: Async (group commit, maximum throughput) and Sync (WAL with write-through, every write durable on return). The WAL uses a Leader+Cond pattern inspired by PostgreSQL: writers become flushers via TryLock, non-leaders wait on sync.Cond, achieving perfect batching. Async transactions are crash-safe because they route through WAL via WriteDocumentsRawDurable, and multiple transactions' WAL writes are coalesced together before hitting the WAL.

AEGIS-128L encryption is mandatory on every ALOS DB connection. All ALOS DB numbers below include full authenticated encryption on every packet. PostgreSQL, MongoDB, and ScyllaDB run without application-level encryption. ALOS DB still outperforms them.

150K
InsertOne docs/sec
3.8x faster than MongoDB
165K
FindOne docs/sec
4.2x faster than MongoDB
2.8M
InsertMany docs/sec
4.5x faster than MongoDB
1.0M
Aggregate docs/sec
19.2x faster than MongoDB

Test Environment

CPU AMD Ryzen 7 5700X, 8 cores / 16 threads @ 3.4 GHz (boost 4.6 GHz)
OS Debian 13 (Trixie) Docker containers, all databases on same host
Go Version Go 1.26, 128 concurrent workers, 2.5s per operation
Parallelism 128 workers across 16 TCP connections (all databases use the same worker count)
ALOS DB Remote Mode: client-server over TCP, mandatory AEGIS-128L authenticated encryption on every packet, MessagePack wire protocol, pipelined connection pool (16 connections). Credentials required at startup.
MongoDB mongo:7 Docker container, localhost:27017, Go driver v2
PostgreSQL postgres:16 Docker container, localhost:5432, pgx/v5 driver, 100 pool conns
ScyllaDB scylladb/scylla:latest Docker (--smp 2), localhost:9042, gocql driver

All databases index their primary key. ALOS DB uses CreateIndex for secondary field indexes. Every benchmark uses identical test documents with the same fields and data patterns. Bulk operations use 200 docs per call.

Single Document Operations

Every operation measured with 128 concurrent workers across 16 TCP connections. All values are docs/sec. ALOS DB encrypts every packet with AEGIS-128L. All other databases run unencrypted.

ALOS Async
ALOS Sync
PostgreSQL 16
MongoDB 7
ScyllaDB
Operation ALOS Async ALOS Sync PostgreSQL MongoDB ScyllaDB
InsertOne 150K docs/s
6.67 µs
100K docs/s
10.0 µs
26K docs/s
38.5 µs
39K docs/s
25.6 µs
26K docs/s
38.5 µs
FindOne 165K docs/s
6.06 µs
160K docs/s
6.25 µs
30K docs/s
33.3 µs
39K docs/s
25.6 µs
29K docs/s
34.5 µs
UpdateOne 123K docs/s
8.13 µs
70K docs/s
14.3 µs
25K docs/s
40.0 µs
37K docs/s
27.0 µs
19K docs/s
52.6 µs
DeleteOne 67K docs/s
14.9 µs
44K docs/s
22.7 µs
10K docs/s
100 µs
18K docs/s
55.6 µs
10K docs/s
100 µs
UpsertOne 114K docs/s
8.77 µs
77K docs/s
13.0 µs
24K docs/s
41.7 µs
35K docs/s
28.6 µs
24K docs/s
41.7 µs
Aggregate 1.0M docs/s
1.00 µs
365K docs/s
2.74 µs
201K docs/s
4.98 µs
52K docs/s
19.2 µs
N/A
Transaction 140K docs/s
7.14 µs
106K docs/s
9.43 µs
37K docs/s
27.0 µs
N/A N/A

ALOS DB Async vs competition (single ops)

Operation vs MongoDB vs PostgreSQL vs ScyllaDB
InsertOne3.8x faster5.8x faster5.8x faster
FindOne4.2x faster5.5x faster5.7x faster
UpdateOne3.3x faster4.9x faster6.5x faster
DeleteOne3.7x faster6.7x faster6.7x faster
UpsertOne3.3x faster4.8x faster4.8x faster
Aggregate19.2x faster5.0x fasterN/A
TransactionN/A3.8x fasterN/A

Visual Comparison

Bar length represents throughput (docs/sec). Longer is better.

ALOS Async
ALOS Sync
PostgreSQL 16
MongoDB 7
ScyllaDB
InsertOne
ALOS Async
150K docs/s
ALOS Sync
100K docs/s
MongoDB
39K docs/s
Postgres
26K docs/s
ScyllaDB
26K docs/s
FindOne
ALOS Async
165K docs/s
ALOS Sync
160K docs/s
MongoDB
39K docs/s
Postgres
30K docs/s
ScyllaDB
29K docs/s
Aggregate
ALOS Async
1.0M docs/s
ALOS Sync
365K docs/s
Postgres
201K docs/s
MongoDB
52K docs/s
InsertMany
ALOS Async
2.8M docs/s
ALOS Sync
2.3M docs/s
MongoDB
617K docs/s
ScyllaDB
113K docs/s
Postgres
108K docs/s
FindMany
ALOS Async
9.5M docs/s
ALOS Sync
9.0M docs/s
Postgres
6.6M docs/s
MongoDB
682K docs/s
ScyllaDB
227K docs/s

Bulk Operations (200 docs per call)

Each operation processes 200 documents per call. All values are docs/sec.

Operation ALOS Async ALOS Sync PostgreSQL MongoDB ScyllaDB
InsertMany 2.8M docs/s
71.4 µs
2.3M docs/s
87.0 µs
108K docs/s
1.85 ms
617K docs/s
324 µs
113K docs/s
1.77 ms
FindMany 9.5M docs/s
21.1 µs
9.0M docs/s
22.2 µs
6.6M docs/s
30.3 µs
682K docs/s
293 µs
227K docs/s
881 µs
UpdateMany 2.4M docs/s
83.3 µs
1.9M docs/s
105 µs
21K docs/s
9.52 ms
1.2M docs/s
167 µs
20K docs/s
10.0 ms
DeleteMany 900K docs/s
222 µs
1.0M docs/s
200 µs
11K docs/s
18.2 ms
270K docs/s
741 µs
11K docs/s
18.2 ms
UpsertMany 2.2M docs/s
90.9 µs
1.7M docs/s
118 µs
25K docs/s
8.00 ms
1.1M docs/s
182 µs
24K docs/s
8.33 ms

ALOS DB Async vs competition (bulk ops)

Operation vs MongoDB vs PostgreSQL vs ScyllaDB
InsertMany4.5x faster25.9x faster24.8x faster
FindMany13.9x faster1.4x faster41.9x faster
UpdateMany2.0x faster114.3x faster120.0x faster
DeleteMany3.3x faster81.8x faster81.8x faster
UpsertMany2.0x faster88.0x faster91.7x faster
InsertMany
ALOS Async
2.8M docs/s
ALOS Sync
2.3M docs/s
MongoDB
617K docs/s
Postgres
108K docs/s
FindMany
ALOS Async
9.5M docs/s
ALOS Sync
9.0M docs/s
Postgres
6.6M docs/s
MongoDB
682K docs/s

Async vs Sync Mode

ALOS DB supports two durability modes, configured at server startup with --sync-mode. The WAL uses a Leader+Cond pattern (PostgreSQL-inspired): writers become flushers via TryLock, non-leaders wait on sync.Cond, achieving perfect batching. Multiple transactions' WAL writes are coalesced together before hitting the WAL.

Aspect Async Mode Sync Mode
Mechanism Group commit: writes buffered in memory, flushed periodically WAL with FILE_FLAG_WRITE_THROUGH: every write durable on return
InsertOne 150K docs/s 100K docs/s
FindOne 165K docs/s 160K docs/s
Crash safety Last ~10ms of writes may be lost on power failure (group commit flushes every 10ms) Zero data loss for acknowledged writes
Best for Logs, telemetry, game state, caches, analytics User accounts, purchases, financial records, inventory
Encryption AEGIS-128L (mandatory) AEGIS-128L (mandatory)
Transaction safety Crash-safe: async transactions route through WAL via WriteDocumentsRawDurable (140K docs/s) Crash-safe: all writes go through WAL write-through (106K docs/s)