MVC Simplify Revamp — Streamlined Coupon Creation
Revamped a merchant coupon-creation platform end-to-end — shop-tier feature capability, recurring coupon creation, and discount support — with a go-routine batch pipeline that creates up to 12 coupons in under one second, aligned with five cross-functional teams and released in October 2022.
- Role
- Senior Backend Engineer
- Timeline
- 2022
- Team
- 5
- Domain
- E-Commerce / Promotion & Discounts
- Stack
- 9 tech
- Status
- Live
Overview
The MVC Simplify Revamp project rebuilt the merchant coupon-creation platform to make it faster to use and cheaper to extend. As Senior Backend Engineer with a team of about five — including junior engineers and an intern — I owned the end-to-end tech design, DB storage, batch pipeline, and cross-team coordination, and shipped new capabilities for shop-tier, recurring coupon creation, and discount support for a release in October 2022.
Gallery
A backend has no screens, so its "UI" is the operational surface: the batch coupon-creation API contract, the shop-tier and recurring-coupon configuration flow, and coupon-throughput dashboards.
Problem & Solution
The existing coupon-creation endpoint took roughly one second to create just one coupon, which made bulk workflows painful for sellers and blocked the roadmap for recurring coupons and tier-based quotas. On top of the latency ceiling, the revamp had to introduce a coherent shop-tier feature, a recurring-creation flow, and discount support — while aligning promotion, catalog, discount, seller-console, and a downstream platform team on interface contracts.
I designed and led the revamp end-to-end: the interaction flow, DB storage, and the data surfaced on the seller dashboard, plus a quota calculation model that combines shop tier, per-month allowance, and custom shop quotas. The core latency win came from go-routine parallelization — the batch handler fans out per-coupon inserts, shares a single tier/quota resolution from Redis, and returns the aggregated result — bringing 12-coupon batch latency below 1s versus ~1s for a single coupon on the old path. I coordinated with five cross-functional teams, kept the timeline, testing, and monitoring on track, and guided junior engineers and an intern through the build to the October 2022 release.
Workflow
Three actors interact with the service; the diagrams are written in English to stay consistent across both languages.
Architecture
The merchant-promotion service owns coupon creation and delegates tier and quota resolution to a shop-tier & quota resolver backed by a Managed RDS, with Redis caching hot tier/quota reads. On a batch request, the service fans out go-routines — one per coupon — and each writes to the coupon tables independently; per-coupon failures do not block the rest of the batch. Recurring coupon schedules and discount metadata are modeled as first-class relations, so shop-tier changes and recurring jobs stay consistent with the seller console. Prometheus and Grafana track batch latency and coupon-creation throughput.
Features
- Shop-tier feature capability (TRD)
- Recurring coupon creation (TRD)
- Discount support for coupon creation
- Coupon-creation quota by shop tier and per-month
- Custom shop quota calculation
- Seller-dashboard data surfacing
- End-to-end tech design (interaction flow & DB storage)
- Cross-functional alignment with five teams
- Guidance for junior engineers and an intern
Tech Stack
Engineering Challenges
The existing endpoint already took ~1s to create a single coupon, and the revamp had to support creating up to 12 coupons in one request under 1s. Fix: fan out the per-coupon work with go-routines behind a bounded batch handler, share tier/quota lookups from Redis to avoid redundant round-trips, and treat each insert as an idempotent unit — dropping batch latency below 1s.
The revamp touched seller-console, catalog, promotion, discount, and a downstream platform team simultaneously, on top of new TRDs for shop-tier and recurring creation. Fix: periodic PRD/TRD sync, clear interface contracts per boundary, and a staged rollout — landing the release for October 2022 on schedule.
Coupon-creation quota had to reconcile three inputs — shop tier, per-month allowance, and a custom shop quota — without conflicting or blocking recurring creation. Fix: a single quota resolver as first-class logic in the merchant-promotion service, so tier upgrades and recurring schedules stayed consistent across the seller console and the coupon lifecycle.
Outcomes
Lessons Learned
Parallelizing the right unit of work matters more than raw concurrency: fanning out per-coupon inserts with go-routines, while sharing a single tier/quota lookup, was what pushed 12-coupon batch latency under 1s. Modeling quota as a first-class resolver — instead of scattering shop-tier, monthly, and custom-quota checks across handlers — made the follow-up work (recurring creation, discount support) far cheaper to extend. And a revamp this broad is as much about aligning five cross-functional teams and mentoring newer engineers as it is about the code.
Related Santekno Tutorials
Interested in working together?
Order, payment, or high-traffic event pipelines — let's talk architecture and trade-offs.