ByteDance Wallet Asset Middle Platform Design for 2022 Spring Festival High‑Traffic Reward Distribution
This article details ByteDance's wallet asset middle platform designed for the 2022 Spring Festival, covering eight‑app reward interoperability, high‑QPS challenges, token‑based asynchronous入账, budget control, stability measures, and fund‑safety guarantees, and includes practical solutions for hot‑key handling, budget throttling, and multi‑stage activity isolation.
The article describes ByteDance's wallet asset middle platform built to support the 2022 Spring Festival activities across eight apps (Douyin, Toutiao, etc.), requiring reward interoperability, diverse reward types, and high‑traffic handling.
Core challenges include: achieving eight‑app reward data互通 despite different account systems, handling peak estimated 1.8 million QPS for cash红包发放, managing over ten reward types, ensuring system stability, user experience, fund safety, and activity isolation across internal test, gray‑scale, and formal phases.
Solutions presented: a unified actID from ByteDance account middle台 to bind reward data across apps; an asynchronous入账 token scheme using encrypted tokens stored client‑side and server‑side, with Redis tracking入账状态 and forced token入账 at withdrawal to hide latency; budget control via Redis incr on card‑template consumption with thresholds and fallback; activity isolation through mother‑child activity configuration switching; stability ensured by degradation, limit‑flow, resource isolation, and storage预估; fund safety guaranteed by idempotency, reconciliation, and real‑time监控.
${actID}_${scene_id}_${rain_id}_${award_type}_${statge}
type RedPacketToken struct { AppID int64 `protobuf:"varint,1,opt json:"AppID,omitempty"` // 端ID ActID int64 `protobuf:"varint,2,opt json:"UserID,omitempty"` // ActID ActivityID string `protobuf:"bytes,3,opt json:"ActivityID,omitempty"` // 活动ID SceneID string `protobuf:"bytes,4,opt json:"SceneID,omitempty"` // 场景ID Amount int64 `protobuf:"varint,5,opt json:"Amount,omitempty"` // 红包金额 OutTradeNo string `protobuf:"bytes,6,opt json:"OutTradeNo,omitempty"` // 订单号 OpenTime int64 `protobuf:"varint,7,opt json:"OpenTime,omitempty"` // 开奖时间 RainID int32 `protobuf:"varint,8,opt,name=rainID json:"rainID,omitempty"` // 红包雨ID Status int64 `protobuf:"varint,9,opt,name=status json:"status,omitempty"` //入账状态 }
Results show the platform successfully handled the Spring Festival traffic, provided stable reward入账 and展示, maintained fund safety, and offered extensible SDK capabilities for future活动. Future work focuses on optimizing上下游需求, enhancing real‑time数据看板, and strengthening configuration and documentation to reduce onboarding costs.
ByteFE
Cutting‑edge tech, article sharing, and practical insights from the ByteDance frontend team.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.