Grab Tech Blog
Read post

Migrating Counter Service storage: Design choices and learnings

Grab's Counter Service handles billions of fraud-detection queries daily. This post details a zero-downtime migration from a wide-column database to Aerospike, covering three major workstreams: decoupling the reader's storage layer in Rust using enum dispatch and a concrete facade (avoiding trait objects for performance), redesigning the writer's data model from row-per-bucket to a map-based schema that collapses all bucket counts into a single record per counter, and implementing dual read-write shadow paths for gradual traffic rollout with data parity validation. The map-based schema reduced on-disk storage from ~3 TB to ~1 TB, cut p99 read latency by ~50%, and lowered per-node costs by 45–50%. Key learnings include the Aerospike Rust client's sync-only limitation requiring spawn_blocking workarounds, a DNS re-resolution bug during cluster topology changes, and the trade-offs of NVMe-backed primary index under hot-key I/O contention.

    #database#rust#fraud-detection
Jul 03•15m read time•From engineering.grab.com
Post cover image
Table of contents
IntroductionSetting the stageReader: Separating the data access layerWriter: redesigning the data modelReader: How each backend actually serves a queryExperiment with indexingOverall impactConclusionJoin us
37.3K Impressions
Grab Tech Blog's image
Grab Tech Blog

Grab is a leading technology company in Southeast Asia, offering a wide range of services, including...

51 Followers

•

225 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard