Santekno
Projects/Voucher Status Reconciliation
ByteDance logoPart of ByteDance · Software Engineer, Promotion Platform Team
Backend / APILive

Voucher Status Reconciliation

Owned a state machine based voucher reconciliation module ensuring data consistency, idempotency, and correctness across usage and reversal flows.

2025-voucher-status-reconciliation · main
# E-Commerce / Promotion
$ go -X POST /2025-voucher-status-reconciliation/v1/sync
→ 201 Created
{ "status": "ok" }
publish 2025-voucher-status-reconciliation.synced
Role
Backend Engineer
Timeline
2025
Team
2
Domain
E-Commerce / Promotion
Stack
8 tech
Status
Live
01

Overview

The Voucher Status Reconciliation initiative kept voucher state consistent across usage and reversal scenarios. I independently owned the core reconciliation module end-to-end, from technical design through implementation, release, and post-deployment monitoring.

A backend has no screens, so its "UI" is the operational surface: the reconciliation API, the event flow, and stability monitoring.

API contract — voucher state & reconciliation endpoints
Event flow — RocketMQ state-change consumption
Ops view — reconciliation monitoring & abnormal signals
03

Problem & Solution

Problem

Voucher state could drift between usage and reversal flows, risking data integrity and incorrect reconciliation under exceptional conditions. The module needed strong idempotency guarantees and reliable event handling on an unfamiliar, configuration-heavy platform.

Solution

I designed and implemented a state machine based use case flow that enforces data integrity, idempotency, and reconciliation correctness. I consumed voucher state changes via RocketMQ and integrated CDC / event bus / MQ mechanisms, aligning synchronous versus asynchronous flows with reconciliation business rules and validating operational safety.

04

Workflow

Three actors interact with the service; the diagrams are written in English to stay consistent across both languages.

flowchart diagram

use or reverse voucher

state event

subscribe

User / Order

Voucher Service

RocketMQ

Reconciliation Module

CDC pipeline / event bus

Use case interaction
sequence diagram
Reconciliation ModuleRocketMQVoucher ServiceOrder FlowReconciliation ModuleRocketMQVoucher ServiceOrder Flowuse / reverse voucherpublish state changedeliver eventvalidate state transition (idempotent)reconciled state
Sequence flow
05

Architecture

flowchart diagram

metrics

Voucher Service · Go

State Machine Module

CDC pipeline / event bus

RocketMQ

Voucher State Store

Prometheus / Grafana

System architecture
Architecture notes

The Voucher Service publishes state changes to RocketMQ, which the reconciliation module consumes and validates through the state machine before persisting reconciled state. A CDC pipeline and the event bus support online data handling, and Prometheus / Grafana provide post-release stability monitoring.

state diagram

redemption

reversal

state check

state check

issued

used

reversed

reconciled

Voucher state lifecycle
06

Features

Reconciliation
  • State machine based use case flow
  • Idempotent state transitions
  • Usage & reversal reconciliation
Platform
  • RocketMQ event consumption
  • CDC pipeline / event bus integration
07

Tech Stack

language
Go
messaging
RocketMQ
platform
reconciliation platformCDC pipelineevent bus
database
Managed RDS (relational database)
observability
PrometheusGrafana
08

Engineering Challenges

01
Ensuring voucher state consistency

Voucher state had to stay correct across usage and reversal under both normal and exceptional conditions. Fix: a state machine based flow with idempotent transitions and clear reconciliation logic that isolates edge cases.

02
Onboarding to an unfamiliar platform

The reconciliation platform, RocketMQ, a CDC data pipeline, and the event bus were all new. Fix: rapid ramp-up plus tight alignment with the tech owner to apply the mechanisms correctly in production without heavy dependency on others.

03
Balancing correctness, performance, and delivery

A complex reconciliation module still had to ship on time. Fix: self-documented code, well-defined abstractions, and early risk surfacing to keep rework low while protecting design quality.

09

Outcomes

2
reconciliation scenarios covered
1
core module owned end-to-end
idempotent
state-transition guarantee
live
release status
10

Lessons Learned

Reconciliation correctness depends on disciplined state design and idempotency more than raw code volume. Frequent, proactive alignment with the tech owner was essential to apply a new toolchain correctly and to surface abnormal signals early.

11

Related Santekno Tutorials

Interested in working together?

Order, payment, or high-traffic event pipelines — let's talk architecture and trade-offs.