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.
- Role
- Backend Engineer (Voucher Platform)
- Timeline
- 2023
- Team
- 3
- Domain
- E-Commerce / Vouchers
- Stack
- 9 tech
- Status
- Live
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.
Gallery
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.
Problem & Solution
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.
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.
Workflow
Three actors interact with the service; the diagrams are written in English to stay consistent across both languages.
Architecture
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.
Features
- 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
- New platform-funded (100% budget) voucher type
- Async processing pipeline for high-volume ingestion
- Voucher-store schema and indexes for fast lookup
- Flow architecture for high-throughput CSV ingestion
- Database design for platform-funded vouchers
- Prometheus/Grafana observability on the pipeline
Tech Stack
Engineering Challenges
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.
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.
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.
Outcomes
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.
Related Santekno Tutorials
Interested in working together?
Order, payment, or high-traffic event pipelines — let's talk architecture and trade-offs.