India’s Leading Domain & Web Hosting Provider
Apparel retailer serves 6 million loyalty members from Cosmos DB at 8 ms p99 reads
Fashion and apparel chain, 280 stores, app and web storefront, 6 million loyalty members · Pan-India · 10 weeks
As-is situation
The loyalty program ran on a MySQL database behind the POS and mobile app, storing member profiles, points ledger and tier rules in rigid tables. Each new campaign type, such as birthday multipliers or partner vouchers, needed a schema change and a two-week release. During end-of-season sales, POS terminals waited 2-4 seconds for points balance, and at peak the database hit 100 percent CPU, forcing stores to issue paper vouchers. Marketing could not run real-time offers because the app read balances from a nightly batch extract, and the CRM team exported member data to spreadsheets to build segments.
- POS points-balance lookup of 2-4 seconds during end-of-season sales
- Schema change and two-week release for every new campaign type
- App showing balances from a nightly extract, up to 24 hours stale
- Database CPU at 100 percent during sale peaks, forcing paper voucher fallback
Selected Microsoft Azure services and architecture
NTSPL modelled the loyalty domain in Cosmos DB for NoSQL in Central India with a members container partitioned by memberId and a transactions container with a hierarchical key of memberId and yearMonth, keeping each logical partition well under 20 GB. Campaign rules are stored as versioned JSON documents, so new campaign types need no schema change. Autoscale is set to a 40,000 RU/s maximum on transactions, dropping to 4,000 overnight. The change feed triggers Azure Functions that recompute tier status and push offers to the app within seconds. South India is a read region with service-managed failover; session consistency keeps each member's view correct.
Implementation approach
Measured results
Operational improvements
- Marketing ships new campaign rules as JSON documents without a database release
- Sale-day capacity is handled by autoscale with no pre-scaling ticket
- Store teams no longer run a paper voucher fallback procedure
Cost considerations
RU consumption drove cost, so the indexing policy excludes free-text and image fields and most reads are point reads at about 1 RU. Autoscale was chosen over provisioned throughput because traffic swings 8-10x between night and sale afternoons. Multi-region writes were rejected as unnecessary; a South India read region gives DR at lower cost.
Return on investment
Real-time offers lifted loyalty-linked repeat purchases by an estimated 4-7 percent in the first sale season, worth an indicative INR 2-3.5 crore in incremental gross margin. Cosmos DB running cost of about INR 3-4 lakh a month is offset several times over, and campaign launches no longer queue behind database releases.