Engineering Guide: Gradual Rollout of New-User Promotional Offers During Mega Sales
This guide explains why some new users "can't see" a promotional offer during major sales events, and how to solve it by treating offer eligibility as a versioned, observable, and rollback-capable distributed system. It covers eligibility rule modeling, consistent-hash-based gradual rollout, configuration propagation latency, observability with structured reason codes, change management, and a pre-launch checklist for engineering teams.
1. The Technical Essence: A Promotion Is Not “One Switch”
Complaints like “other people got the discount but I didn’t” during a major sale may look like an operations issue, but in engineering practice the root cause is almost always an overly long eligibility-check chain with no gray-scale observability. A valid promotional offer is typically the intersection of four layers of conditions:
- Identity layer: account registration time, identity/verification and risk-control status, historical orders and refund records;
- Subscription layer: whether the account is currently within a paid subscription period, and whether there are unfinished trial or downgrade flows;
- Campaign layer: campaign ID, time window, region/currency, channel source, and plan tier (monthly/annual);
- Inventory layer: budget quota,名额 caps, and risk-control blocklists.
If the data source for any layer is out of sync, the user-visible symptom is “everyone else has it, I don’t.” So the correct approach is not to add an if (isNewUser) check, but to build eligibility evaluation as a versioned, replayable, and observable rule set.
2. The Data Model and Evaluation Chain for Eligibility
It is recommended to abstract the evaluation input into two immutable objects — a “user snapshot” and a “campaign configuration” — and keep the evaluation function pure, which makes stress testing and replay easy:
campaign:id: BF_NEWUSER_2026window: {start: "2026-11-27T00:00:00+08:00", end: "2026-12-01T23:59:59+08:00"}region_whitelist: ["CN", "TW", "US"]new_user_rule:register_before: "P-90D" # registered at least 90 days agopaid_subscription_ever: false # never had a paid subscriptiontrial_active: falseoffer:plan: PRO_ANNUALdiscount: 0.5quota: 100000
def evaluate(snapshot, campaign, bucket):if not in_window(campaign.window, now()):return Deny("WINDOW_CLOSED")if snapshot.region not in campaign.region_whitelist:return Deny("REGION_MISS")if not campaign.new_user_rule.match(snapshot):return Deny("ELIGIBILITY_MISS", snapshot.reason_codes)if not campaign.offer.reserve_quota(snapshot.user_id):return Deny("QUOTA_EXHAUSTED")if bucket(snapshot.user_id) >= campaign.rollout_ratio:return Deny("ROLLOUT_NOT_REACHED")return Allow(campaign.offer)
The key point: every rejection branch must return a structured reason code and be logged. Without reason codes, complaint investigations rely on guesswork — this is the number-one reason incident triage is slow during major sales.
3. Gradual Rollout: Replace “All-or-Nothing” with a Continuously Adjustable Knob
Campaign rollout must be continuous and controllable. A recommended four-stage progression is: internal allowlist → 1% bucketing → regional 10%/50% → full rollout. Bucketing must use consistent hashing rather than random numbers, so that the same user gets a stable result across repeated page refreshes — otherwise you get the classic secondary complaint of “the discount disappeared after I refreshed a few times.”
bucket = murmur3(user_id + campaign.id) % 10000 / 100.0
Rollout ratio, allowlists, and region sets should all live in a configuration center, with changes going through approval and versioning — never hardcoded into release packages. A good rule of thumb: observe at least one full traffic peak cycle at each rollout stage before advancing to the next.
4. Propagation Latency: Three Traps in List Synchronization and Caching
- Audience list sync: offline-computed audience lists typically lag by hours. Pre-warm them at T-1 before the sale, then backfill increments via a real-time pipeline once the campaign starts;
- Multi-level caching: a long local cache TTL makes configuration changes “look like they never took effect.” Recommended: local cache in seconds, distributed cache in minutes, with support for active invalidation broadcasts;
- Price caching: if the cache key for the product detail page and checkout page does not include the campaign ID and user bucket, you get the classic inconsistency of “discount on the listing page, full price at checkout.”
The core metric to monitor is configuration propagation latency at P99, not “whether the push has been sent.”
5. Observability and Validation: Make Every Rejection Explainable
Three types of signals are essential:
- Business metrics: eligibility hit rate, discount exposure rate, order conversion rate, complaint rate, inventory consumption rate;
- Technical logs:
user_id, campaign_id, bucket, decision, reason_code, config_version, sampled at full volume into a logging service; - Alerts: a sudden drop in hit rate, a spike in the share of a specific reason code, or abnormal inventory consumption should all trigger alerts within minutes.
Before launch, replay historical traffic in shadow mode and compare the difference rate between evaluation results and the expected audience list — this is the lowest-cost safety net. When deploying on Baidu AI Cloud, these capabilities can directly reuse general product categories such as configuration management, logging services, and monitoring/alerting, without building the full infrastructure stack in-house.
6. Change Management, Rollback, and External Expectation Management
- One-click rollback: rollout ratio and switches must support rollback within seconds, and the rollback path must be rehearsed before launch;
- Announcements and status page: campaign rules, eligible audience, and start times should be published through a single authoritative channel to avoid inconsistent statements across channels;
- Traceable commitments: externally promised timelines should be entered into the change management system with reminders and owners before their due dates, to prevent “a promise expires and nobody follows up”;
- Fallback compensation: provide configurable compensation-voucher templates for affected users, turning complaint handling from manual, case-by-case approval into a standardized process.
7. Pre-Launch Checklist
- Are eligibility rules pure functions and replayable?
- Are rejection reasons structured and logged?
- Is bucketing stable, and is rollout continuously adjustable?
- Is there a metric for configuration propagation latency?
- Are prices and discounts consistent across listing/detail/checkout pages?
- Has rollback been rehearsed?
- Is the external announcement from a single, authoritative, traceable source?
The fundamental solution to “breaking promises” during a mega sale is to govern promotional eligibility as a distributed system that requires gradual rollout, observability, and rollback — not as a one-off operations configuration.
