Santekno
Projects/Upgrade Seller Voucher Deactivation on Regulatory Penalty
ByteDance logoPart of ByteDance · Software Engineer, Promotion Platform Team
Backend / APILive

Upgrade Seller Voucher Deactivation on Regulatory Penalty

Redesigned penalty-triggered voucher deactivation by evaluating methods across multiple services to fix operator-side/customer-side discrepancies without hurting latency.

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

Overview

The Upgrade Seller Voucher Deactivation on Regulatory Penalty project reworked a critical voucher deactivation method triggered by a regulatory penalty. I owned the analysis and improvement end-to-end, targeting data consistency and voucher-state safety across systems while keeping latency in check.

A backend has no screens, so its "UI" is the operational surface: the deactivation RPC, self-test scenarios, and the method evaluation report.

API contract — penalty-triggered deactivation RPC
Self-test — deactivation scenarios & edge cases
Report — cross-service method evaluation matrix
03

Problem & Solution

Problem

The existing deactivation flow produced operator-side and customer-side data discrepancies and voucher-state risks, particularly under large-scale processing. Multiple deactivation methods existed across different services, each with different correctness, performance, and compatibility characteristics, making a naive choice risky.

Solution

I ran a deep technical assessment to pinpoint inconsistency points in the penalty-triggered deactivation flow, then produced a detailed technical design evaluating alternative methods across multiple services and balancing correctness with latency impact. I aligned the design with the reviewer, paid close attention to data-handling efficiency at scale, and prepared comprehensive self-test documentation covering edge cases and multiple scenarios.

04

Workflow

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

flowchart diagram

trigger

deactivate

update

sync

Regulatory Penalty

Campaign Core Service

Voucher Service

Operator-Side State

Customer-Side State

Use case interaction
sequence diagram
Managed RDSTarget ServiceVoucher DeactivationRegulatory PenaltyManaged RDSTarget ServiceVoucher DeactivationRegulatory Penaltyregulatory-penalty eventselect deactivation methoddeactivate voucher / promocodeupdate stateresultstates aligned
Sequence flow
05

Architecture

flowchart diagram

RPC

Regulatory Penalty Flow

Voucher Deactivation · Go

Service · voucher path

Service · promocode path

Managed RDS

Upstream Services

System architecture
Architecture notes

A regulatory-penalty event flows into the voucher deactivation service (Go / RPC), which selects the appropriate deactivation method and dispatches to the target service before updating state in a managed RDS (relational database). The design keeps operator-side and customer-side state aligned and evaluates each service path on compatibility, performance, and maintainability.

state diagram

regulatory penalty trigger

method selected

states aligned

active

penalized

deactivating

deactivated

Voucher deactivation lifecycle
06

Features

Analysis
  • Cross-service deactivation method evaluation
  • Operator-side / customer-side discrepancy assessment
Design
  • Refined deactivation approach
  • Latency & scale considerations
Validation
  • Self-test with edge cases
  • Promocode compatibility check
07

Tech Stack

language
Go
framework
RPC
protocol
RPC
services
Multiple services
platform
Regulatory Penalty
database
Managed RDS
08

Engineering Challenges

01
Operator-side and customer-side data discrepancies

The existing deactivation method caused inconsistencies between operator-side and customer-side state and voucher-state risks, especially under large-scale processing. Fix: a refined approach ensuring accuracy and cross-system alignment during deactivation.

02
Choosing the right method across multiple services

Several deactivation methods existed across different services with different trade-offs. Fix: a detailed technical design comparing methods on correctness, performance, and maintainability, aligned with the reviewer before implementation.

03
Promocode gap discovered in testing

During self-testing I found one method did not support promocode deactivation. Fix: a timely redesign to a compatible method, preventing a potential production issue.

09

Outcomes

3
deactivation methods evaluated
1
functional gap caught pre-release
100%
self-test scenario coverage
0
post-release regressions
10

Lessons Learned

Analyzing and comparing multiple deactivation methods early let me reduce unnecessary changes during implementation and stay aligned with the original design. Comprehensive self-test documentation proved its worth: it surfaced a promocode incompatibility that prompted a reassessment and the selection of a more compatible method before release.

11

Related Santekno Tutorials

Interested in working together?

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