How Aerospike Handles High-Speed Counters
Aerospike is an in-memory database optimized for real-time counters and fraud detection at extreme scale. Learn how it replaces wide-column stores and cuts latency and cost.
GrabJia Long LohProblem & solution
Grab’s Counter Service supports time-windowed fraud queries at tens of thousands of QPS and about a billion requests per day, but an infrastructure review prompted migration from a wide-column database to Aerospike. The team first separated Rust business logic from storage, then added an enum-dispatched facade with Single, WithShadow, and WithSplit modes so traffic could be compared and shifted without downtime. They also redesigned the writer path around Aerospike, including a map-based schema and a single atomic increment, while testing index placement and reverting from an NVMe-backed primary index after hot-key p99 spikes. Production p99 read latency improved by roughly 50%, disk usage fell from about 3 TB to 1 TB, and per-node cost dropped 45–50%; the rollout reported zero downtime and no data-integrity issues.
Counter Service had tight coupling between its Rust business logic and a wide-column storage layer, while the service’s high query volume, latency requirements, and infrastructure review motivated evaluation of an alternative backend. The migration also exposed data-model and access-pattern optimizations.
The team separated storage access from orchestration, introduced an enum-dispatched Rust facade with config-driven Single, WithShadow, and WithSplit modes, redesigned the writer data model for Aerospike, and used shadow reads and writes followed by gradual traffic shifting. It tested an NVMe-backed primary index but reverted after hot-key p99 latency spikes.
The reader facade avoided trait-object boxed-future allocations by using enum dispatch, while keeping backend-specific driver access inside storage modules.
Aerospike’s map-based schema and single atomic increment replaced the original three-table read-modify-write path, contributing to lower disk usage and simpler writes.
The migration reported roughly 50% better production p99 read latency, 45–50% lower per-node cost, zero downtime, and no data-integrity issues.
Summaries are generated from the original by a language model. Check the original before relying on it.
See the idea
Aerospike is an in-memory database optimized for real-time counters and fraud detection at extreme scale. Learn how it replaces wide-column stores and cuts latency and cost.
Keep reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
One useful email. Unsubscribe anytime.