Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

RocksDB Blog 10 min read Deep dive hardMaster

Native Async/Coroutine Reads in RocksDB

RocksDB 11.10.0 adds experimental native asynchronous Get/MultiGet APIs (callback-based GetAsync/MultiGetAsync and Folly-task-based CoroDB::CoGet/CoMultiGet) that suspend a read at the SST block-miss filesystem boundary and resume it on the same io_uring-backed EventBase thread, so a small read executor can sustain high storage queue depth without one parked thread per read. Per-request PerfContext/IOStatsContext are swapped in and out of TLS via Folly RequestContext, with CPU time counted only during active slices. Benchmarks on four cores with an 11 GB direct-I/O dataset show coroutines losing ~14% at low concurrency with single-key lookups but gaining up to 305% over threads with larger batches, and 8–55% over the older ReadOptions::async_io path at 20+ tasks.

Assumes: C++20 coroutinesRocksDB read path and SST filesFolly executorsio_uring basics

Related posts

  • Evolving our real-time timeseries storage again: Built in Rust for performance at scale

    Datadog Engineering hardMaster

    Datadog's sixth-generation real-time timeseries database (RTDB) is a Rust rewrite that unifies two earlier engines, one for scalar metrics and one for DDSketch distributions, after earlier generations built on Cassandra, Redis, MDBM, a Go B+ tree and RocksDB. Its storage engine, Monocle, is an LSM tree with a worker-per-shard, thread-per-core design. Kafka intake tasks route data over per-shard MPSC channels to single-threaded Tokio shards, which keeps locks off the write path. Permit-based throttling and CoDel-based cost scheduling keep the system stable under load, and snapshots provide recovery. Datadog reports 60x higher ingestion throughput and 5x faster queries at peak scale.

  • Deno KV internals: building a database for the modern web

    Deno hardMaster

    Deno KV's production backend runs on FoundationDB, with a custom "transaction layer" in front of it that handles multi-tenant configuration, JavaScript-native types such as bigint sums, and cross-region replication. To keep latency low, every atomic operation is non-interactive: a single bag of versionstamp checks, set/delete writes and conflict-free mutations that completes in one or two network trips. A sequencer assigns monotonic transaction sequence numbers, and an evaluator turns each batch into a dataflow graph of AND/MUX operations and evaluates it concurrently. Results are reused speculatively before a writer commits them to FoundationDB, which raises throughput without locks.

  • Scale without limits: Multigres, OrioleDB, and dbarena

    Supabase easyNovice

    Supabase launched three Postgres scaling efforts. Multigres, from the Vitess team, adds built-in connection pooling and automated failover across three availability-zone nodes, using a consensus protocol over synchronous replication so no committed write is lost. It is in private alpha. OrioleDB, in public beta, is a storage engine that replaces heap storage with a page-level undo log, removing bloat and the need for VACUUM, and uses 64-bit transaction IDs to avoid wraparound; it reports up to 1.8x heap throughput on TPC-C-derived benchmarks and can be chosen per table with USING orioledb. dbarena publishes reproducible, cost-normalized benchmarks comparing Supabase, RDS and Cloud SQL.

  • Bringing SQLite to Vercel Functions with Turso

    Turso mediumAdept

    Turso's partial sync replicates a subset of SQLite database pages into Vercel Functions so reads run in-process with no network round-trip, while writes go to the remote Turso database for durability and consistency. On cold start the driver fetches the first 128 KiB of the SQLite file, then pulls further 128 KiB segments on demand into the ephemeral /tmp directory, so cold-start cost scales with the working set rather than total database size. The experimental @tursodatabase/vercel-experimental package also auto-provisions databases by name for database-per-tenant or per-agent-session patterns. It offers an optional local-write batching mode that trades consistency for lower write latency, and uses a waitUntil() safety net that pushes pending changes if close() is forgotten.

  • Turso v0.7.0

    Turso hardMaster

    Turso 0.7 drops the beta label and focuses on performance and robustness for embedded, multi-tenant use: the core no longer blocks on I/O, yields CPU via a new StepResult::Yield, moves to fallible allocation so OOM surfaces as an error, and treats the page cache as a soft limit like SQLite. The MVCC engine gets a linear-merge dual cursor that replaces per-row skiplist lookups (about a quarter of CPU time on write-heavy loads), watermark-driven garbage collection, experimental passive checkpoints that don't stop the world, and smaller row versions. SQL additions include PostgreSQL-style sequences (now backing AUTOINCREMENT), ICU collations, REINDEX, ordered-set aggregates and window-function groundwork. The SDKs gain a SQLite-compatible .NET/EF Core provider, GIL release and FTS in Python, and concurrent transactions in JavaScript.

The quest for software engineering knowledge.

Look:
Layout: