DBSYNC V0.8.0•C++20 & Linux io_uring

The shared-nothing databasefor multi-core hardware.

DbSync partitions data and I/O across isolated reactor cores. Zero mutex contention, lock-free SPSC inter-core message passing, and kernel-bypass io_uring for deterministic sub-millisecond predictability.

2.14Mops/sec
Peak Throughput
Single-node benchmark
34ms
P99 Latency
Full load saturation
0locks
Shared-Nothing
Core-pinned reactors
28MB
Container Image
Ultra-lean footprint
// 01 Architecture

Engineered without global locks.

Traditional multi-threaded databases waste up to 40% of compute cycles arbitrating mutex contention and cache line invalidation. DbSync partitions both state and I/O strictly per physical core.

Arch 01.01 // Core Sharding
shared-nothing

Isolated Reactor Cores

Each physical core runs an independent, single-threaded reactor thread with exclusive ownership of its data partition. Global locks, mutex arbitration, and cross-socket cache line bouncing are completely eliminated.

REACTOR COREMEMORY PARTITIONSTATE
core_00──► shard_00exclusive
core_01──► shard_01exclusive
core_N──► shard_Nexclusive
Arch 01.02 // Kernel I/O
io_uring

Kernel-Bypass io_uring Rings

Zero syscall overhead per network operation. DbSync submits socket read/write operations into kernel Submission Queues (SQ) and harvests completions from Completion Queues (CQ) using registered buffer rings.

USERSPACE◄── SHARED RING ──►LINUX KERNEL
SQ_RING (Submit)0 syscall batching
CQ_RING (Complete)Polled kernel ring
Arch 01.03 // Inter-Core Bus
lock-free spsc

SPSC Lock-Free Message Steering

When a connection on Core A issues a command for a key sharded to Core B, the request hops across dedicated SPSC (Single-Producer Single-Consumer) ring buffers with acquire/release memory semantics in under 150 nanoseconds.

MEMORY ORDERINGALIGNMENT
std::memory_order_releasealignas(64)
std::memory_order_acquirecache-line isolated
Arch 01.04 // Zero Allocation
c++20 arena

Zero-Copy RESP Parsing

Custom high-speed parser evaluates Redis Serialization Protocol (RESP) commands directly over raw network buffers using std::string_view. No heap allocation, no string copies on hot command execution.

// Hot-path zero copy parser
struct RespCommand {
std::string_view command;
std::span<std::string_view> arguments;
};
// 02 Benchmarks

Audited empirical throughput.

Eliminating locks yields dramatic performance dividends as core count scales. Under full workload saturation, DbSync sustains over 2.14 million operations per second on a single machine.

Predictability Under Load
34.0 ms
P99 latency at 2.14M ops/sec saturation
METRICDBSYNCREDISDFLY
P50 Latency0.42 ms1.04 ms0.88 ms
P95 Latency1.28 ms3.15 ms2.64 ms
P99 Saturation34.0 ms112.0 ms75.2 ms
Lock Contention0.00%18.4%12.8%
Shared-nothing architecture guarantees P99 tails remain flat by eliminating CPU thread waitqueues.
Throughput (ops / sec)higher is better
DbSync (C++20)Baseline (+74.6%)
2.14M ops/s
Redis v7.2-42.7%
1.23M ops/s
DragonflyDB v1.14-45.7%
1.16M ops/s
Harness: memtier_benchmark --ratio=1:1 -c 200 -t 8 --pipeline=16
Full benchmark methodology
// 03 Deployment

Deploy in seconds.

Run the 28 MB official multi-architecture image or build straight from source with native C++20 flags. Drop-in compatible with standard Redis CLI and client libraries.

# Run official high-performance container
docker run -d --name dbsync --network host -p 6379:6379 ayushv1/dbsync:latest
Container Image
ayushv1/dbsync:latest
Image Size
28.2 MB (compressed)
Architectures
linux/amd64, linux/arm64
Protocol
RESP2 / RESP3 (Port 6379)
Kernel Requirement
Linux 5.10+ (io_uring)
License
Apache 2.0 Open Source
Test connection: redis-cli -p 6379 PING
Docker Hub Registry
// 04 Milestones

Systematic evolution.

The progression from a simple 18 RPS prototype to a 2.14M RPS production engine through methodical hardware alignment and zero-lock architecture.

PHASE 01M1
Synchronous POSIX
18 ops/s
Baseline

Initial reference implementation using blocking POSIX sockets and naive RESP string parsing. Validated protocol correctness and baseline execution flow.

POSIX socketsBlocking I/OReference parser
PHASE 03M2
Linux io_uring Kernel Loop
200k ops/s
11,100x increase

Shifted to Linux io_uring submission/completion queue rings. Kernel-space socket polling eliminated per-operation syscall context switching.

io_uringSQE / CQE ringsAsync event loop
PHASE 05M3
Zero-Allocation Arena
332k ops/s
+66% single-core

Removed all heap allocations from the hot path. Implemented monotonic arena allocators and zero-copy std::string_view parsing over kernel-registered buffers.

std::string_viewArena allocatorsZero copy
PHASE 07M4
Shared-Nothing SPSC Steering
2.14M ops/s
Linear multi-core scale

Full shared-nothing reactor model. Reactor threads pinned per CPU core communicate across lock-free SPSC ring buffers with zero mutex contention.

Shared-nothingLock-free SPSCThread affinity