Santekno
Projects/MVC Full-Budget Vouchers — Anniversary Support
Tokopedia logoPart of Tokopedia · Senior Software Engineer, Promotion Team
Backend / APILive

MVC Full-Budget Vouchers — Anniversary Support

Designed a platform-funded (100% budget) voucher feature with a bulk CSV pipeline that handles up to 100k vouchers per upload, cutting operator processing from days to hours in support of a major anniversary campaign.

2023-mvc-budget-full-anniversary · main
# E-Commerce / Vouchers
$ go -X POST /2023-mvc-budget-full-anniversary/v1/sync
→ 201 Created
{ "status": "ok" }
publish 2023-mvc-budget-full-anniversary.synced
Role
Backend Engineer (Voucher Platform)
Timeline
2023
Team
3
Domain
E-Commerce / Vouchers
Stack
9 tech
Status
Live
01

Overview

The merchant voucher platform needed a new voucher type in which the platform — not the merchant — funds the discount ("100% budget"). I led the design and implementation of the flow and database architecture for these platform-funded vouchers on the legacy marketplace, and shipped the feature in time to power a major anniversary campaign.

A backend has no screens, so its "UI" is the operational surface: the bulk upload flow, the async processing pipeline, and the voucher-store dashboards.

Ops view — bulk CSV upload of platform-funded vouchers
Pipeline — async voucher generation & voucher-store writes
Grafana — ingestion throughput and voucher-store health
03

Problem & Solution

Problem

Campaign operators had to load very large voucher batches — up to 100k vouchers in a single CSV — quickly enough to run a major anniversary campaign. The existing manual process took 2–3 days per batch, offered no clean data model for platform-funded (as opposed to merchant-funded) vouchers, and could not comfortably absorb the campaign's traffic spike.

Solution

I designed the end-to-end flow and DB architecture and delivered it end to end: a CSV bulk-upload endpoint with template validation, an async processing pipeline that streams rows into workers, and a voucher-store schema for platform-funded vouchers with the indexes needed for fast checkout-time lookup. The result was that operator processing time dropped from 2–3 days to hours, a single upload comfortably carried 100k vouchers, and the pipeline supported the anniversary campaign as transaction value grew ~3x.

04

Workflow

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

flowchart diagram

upload bulk CSV

validate template

enqueue batch

lookup

Ops

Merchant Voucher Platform

Async Queue

Voucher Workers

Voucher Store

Checkout / Redemption

Use case interaction
sequence diagram
Voucher StoreVoucher WorkerAsync QueueMerchant Voucher PlatformOpsVoucher StoreVoucher WorkerAsync QueueMerchant Voucher PlatformOpsupload bulk CSV (up to 100k rows)validate template & rowsenqueue batch jobdispatch chunkswrite platform-funded vouchersbatch result summary
Sequence flow
05

Architecture

flowchart diagram

hot reads

metrics

Ops Console

Merchant Voucher Platform

Async Queue

Voucher Workers

Managed RDS - Voucher Store

Redis

Prometheus / Grafana

System architecture
Architecture notes

Operators upload CSVs to the merchant voucher platform over HTTP. Rows are validated against a shared template, then enqueued to an async queue and consumed by worker processes over gRPC/RPC. Workers batch-write platform-funded vouchers into a Managed RDS voucher store with indexes tuned for checkout lookup, and update campaign state through a small state machine. Redis fronts hot voucher reads; Prometheus and Grafana track ingestion rate, queue depth, and voucher-store latency.

state diagram

template & rows ok

batch enqueued

workers pick up

rows persisted

campaign window

uploaded

validated

queued

processing

stored

active

Bulk voucher upload lifecycle
06

Features

Operations
  • Bulk CSV upload of up to 100k vouchers per submission
  • Template validation with row-level error reporting
  • Campaign scheduling & activation windows for the anniversary event
Platform
  • New platform-funded (100% budget) voucher type
  • Async processing pipeline for high-volume ingestion
  • Voucher-store schema and indexes for fast lookup
System
  • Flow architecture for high-throughput CSV ingestion
  • Database design for platform-funded vouchers
  • Prometheus/Grafana observability on the pipeline
07

Tech Stack

language
Go
framework
RPC framework
protocol
gRPCRPCHTTP
database
Managed RDS (relational database)
cache
Redis
observability
PrometheusGrafana
08

Engineering Challenges

01
Bulk-ingesting up to 100k vouchers in a single CSV

Operators needed to submit very large voucher batches in one shot without blocking the API. Fix: a validated CSV endpoint that persists the upload, then hands work to an async pipeline where workers chunk and write into the voucher store, keeping the request path responsive.

02
Slashing operator processing time from days to hours

Preparing and loading vouchers previously took 2–3 days of manual, row-by-row work. Fix: a shared CSV template, upfront validation, and batched writes into the voucher store cut end-to-end processing to hours and removed the manual bottleneck.

03
Absorbing a major anniversary campaign spike

Transaction value grew roughly 3x during the anniversary window, stressing both ingestion and lookup. Fix: back-pressure at the async queue, indexed voucher-store reads, and Prometheus dashboards to spot hotspots before they touched the checkout path.

09

Outcomes

3x
transaction value growth vs. the pre-launch baseline
100k
vouchers per bulk CSV upload
hours
operator processing time (was 2–3 days)
10

Lessons Learned

The biggest operational wins came from moving synchronous work off the request path. A validated CSV template, an async pipeline, and a well-indexed voucher store turned a multi-day operator chore into an hours-long routine — and let the platform ride out a major campaign without hand-holding.

11

Related Santekno Tutorials

Interested in working together?

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