迁移 Counter Service 存储:设计选择与经验总结

Introduction

简介

Counter Service is used across Grab’s anti-fraud platform to answer time-windowed count questions, such as recent ride requests by a user or failed payment attempts on a card. The service handles tens of thousands of queries per second (QPS) with about a billion requests per day, while maintaining strict requirements around latency and reliability to support real-time fraud rule evaluation.

Counter Service 被广泛应用于 Grab 的反欺诈平台,用于回答时间窗口内的计数问题,例如用户最近的打车请求或某张卡的支付失败尝试。该服务每秒处理数万次查询(QPS),每天约处理十亿次请求,同时保持严格的延迟和可靠性要求,以支持实时欺诈规则评估。

For most of its life, Counter Service was backed by a wide-column database that served the workload reliably as the service scaled. As part of a broader infrastructure review mandated at an organizational level, our database team evaluated alternatives to this storage that many services relied on, including Counter Service. Based on their assessment, Aerospike emerged as a good fit for our use-case. We also used the migration as an opportunity to decouple storage concerns from business logic, a necessary first step for this migration, and one that would reduce the effort required for future storage changes. As part of the same effort, we revisited the data model and access patterns in detail, which helped us identify and apply several straightforward optimizations.

在其大部分生命周期中,Counter Service由一个宽列数据库提供支持,该数据库在服务扩展时可靠地处理工作负载。作为组织层面强制进行的更广泛基础设施审查的一部分,我们的数据库团队评估了许多服务(包括Counter Service)所依赖的此存储的替代方案。根据他们的评估,Aerospike成为我们用例的绝佳选择。我们还利用这次迁移的机会将存储问题与业务逻辑解耦,这是此次迁移必要的第一步,也将减少未来存储更改所需的工作量。作为同一工作的一部分,我们详细重新审视了数据模型和访问模式,这帮助我们识别并应用了几个简单的优化。

This post walks through how we did it. What we built on the reader-side to make the migration safe, how we redesigned the writer-side data model around the new backend, and what we ran into during the gradual rollout.

本文将详细介绍我们是如何做到这一点的。我们在读取端构建了什么来确保迁移的安全,我们如何围绕新后端重新设计写入端数据模型,以及在逐步推出过程中遇到了什么问题。

Setting the stage

背景介绍

Counter data is stored in three time granularities: 15-minute, hourly, and daily buckets. A typical read would be along the lines of, “give me the c...

开通本站会员,查看完整译文。

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-05 14:47
浙ICP备14020137号-1 $mapa de visitantes$