Our loyalty program processes about 500K transactions daily and we’re debating architectural approaches for points calculation. Currently running batch jobs every 30 minutes but considering moving to real-time event-driven processing.
The main driver is customer experience - members want to see points reflected immediately after purchase, especially for mobile app users. Our current 30-minute delay generates support calls and complaints. However, I’m concerned about eventual consistency issues and system load from processing events in real-time.
We’re also looking at caching strategies since many calculations involve complex tier multipliers and promotional rules. Batch processing allows us to reconcile discrepancies easily, but real-time makes that harder. Has anyone dealt with provisional points calculations where you show estimated points immediately then reconcile later?
Would appreciate insights on event-driven architecture patterns that work well for loyalty calculations at scale.
We migrated from batch to event-driven last year. The key is accepting eventual consistency as a feature, not a bug. We calculate provisional points synchronously on transaction events (usually completes in 80-120ms) and display those immediately to customers. Then asynchronous validators run within 5 minutes to verify against promotional rules, tier qualifications, and fraud checks. If discrepancies occur (happens in about 2% of cases), we adjust and notify the customer. This hybrid approach gives instant gratification while maintaining accuracy.
Batch reconciliation is still critical even with real-time processing. We run nightly batch jobs that compare real-time calculated points against authoritative calculations using complete data. This catches edge cases where events arrived out of order or were processed during rule transitions. The batch job identifies discrepancies and creates adjustment transactions. In three months of production, we’ve found 0.3% discrepancy rate - mostly timing issues around promotional period boundaries. Customers appreciate the transparency when we credit missing points with explanatory messages.
From a mobile app perspective, provisional points display transformed our user engagement. We show points updating in real-time with a small indicator that says ‘pending verification’ for the first 2 minutes, then it becomes solid once async validation completes. Users love seeing immediate feedback. The technical implementation uses WebSocket connections for point updates - when the async validator completes, we push the final confirmed total to connected clients. Conversion rates on our loyalty-driven offers increased 23% after implementing real-time updates.