BlogsGrabCounter Service Storage Migration

Counter Service Storage Migration

Counter Service Storage Migration

1
posts
2026

This post details the migration of Grab's Counter Service storage from a wide-column database to Aerospike. It covers the redesign of the data model to a map-based schema for improved efficiency, the implementation of a phased rollout strategy with dual-writing and shadow reads for safe cutover, and the separation of the data access layer to decouple business logic from storage concerns. The migration resulted in significant reductions in record count and storage footprint.

2026

Migrating Counter Service storage: Design choices and learnings

7/24/2026

This post details the migration of Grab's Counter Service storage to Aerospike. It describes the challenges with the original row-per-bucket model and the successful adoption of a map-based schema where all bucket counts for a single counter are collapsed into one record. It also outlines the phased migration approach for the reader service, including extracting storage code, introducing a storage facade with enum dispatch for runtime backend selection, and implementing shadow reads and gradual traffic splitting for safe cutover. The writer pipeline was updated to use Aerospike's atomic map operations for writes and explicit pruning for TTL management.