---
title: "Migrating Counter Service storage: Design choices and learnings"
url: https://daily.dev/posts/migrating-counter-service-storage-design-choices-and-learnings-ojnk4sfr4
source_url: https://engineering.grab.com/counter-service-storage-migration
type: article
source: "Grab Tech Blog"
published: 2026-07-03T01:40:44.692Z
updated: 2026-07-03T04:21:28.933Z
tags: ["database", "rust", "fraud-detection"]
reading_time: 15
upvotes: 11
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating Counter Service storage: Design choices and learnings

**[Grab Tech Blog](https://daily.dev/sources/grab)** · 15 min read · 11 upvotes · 0 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://engineering.grab.com/counter-service-storage-migration>

## Similar posts on daily.dev

- [How Grab’s Migration from Go to Rust Cut Costs by 70%](https://daily.dev/posts/how-grab-s-migration-from-go-to-rust-cut-costs-by-70--v3arjekxa) · ByteByteGo · 94 upvotes · 3 comments
- [Moving From C\+\+ to Rust? Clickhouse Has Some Advice](https://daily.dev/posts/moving-from-c-to-rust-clickhouse-has-some-advice-oun8fhmil) · The New Stack · 24 upvotes · 0 comments
- [Myth Busters: Is Rust a Slam Dunk?](https://daily.dev/posts/myth-busters-is-rust-a-slam-dunk--giwzgswyv) · InfoQ · 0 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#rust](https://daily.dev/tags/rust), [#fraud-detection](https://daily.dev/tags/fraud-detection)

[View this post on daily.dev](https://daily.dev/posts/migrating-counter-service-storage-design-choices-and-learnings-ojnk4sfr4)
