Having implemented loyalty tier systems for several large retailers, I can share insights on all three dimensions of this challenge.
Tier Rule Extensibility:
The JSON-based flexible rule approach sounds attractive but creates significant technical debt at scale. Marketing teams rarely need to change tier thresholds more than quarterly, so the “no developer involvement” benefit is overstated. Instead, I recommend a middle ground: create a Tier Definition entity with structured fields (point_threshold, spend_threshold, qualification_period_days, tier_name, tier_benefits) rather than free-form JSON.
This gives marketing users a proper UI for managing tiers through model-driven apps while keeping rules queryable and indexable. You avoid JSON parsing overhead and can validate rule logic at entry time rather than execution time. For complex rules (like “10 purchases in 90 days AND 5000 points”), store rule components as separate records in a Tier Rule Criteria child table with AND/OR logic flags.
The hybrid approach mentioned earlier is key - use a “tier_evaluation_required” flag on member records to trigger real-time evaluation only when needed. For the 99% of members who haven’t made recent purchases, rely on nightly batch calculations.
Query Performance Tuning:
Materializing tier assignments is essential for your scale. Create a Member Current Tier table (one record per member with current tier, effective date, next evaluation date) and a separate Member Tier History table for temporal tracking. This separation prevents the current tier query from scanning historical records.
For 2M members, your nightly batch should:
- Process in chunks of 10K members to avoid timeout issues
- Use ExecuteMultiple requests for bulk tier updates (50-100 records per request)
- Only evaluate members whose points/spend changed since last run
- Update the Current Tier table immediately and append to History table
Index strategy is critical:
- Member Current Tier: Clustered index on memberid, non-clustered on (tierid, effectivedate)
- Member Tier History: Partition by year, clustered index on (memberid, effectivedate DESC)
- Add filtered indexes for common query patterns like “active premium tier members”
For dashboard queries showing tier distribution, create a daily aggregate table:
Tier_Name | Member_Count | Avg_Points | Avg_Tenure_Days
This prevents scanning 2M member records every time someone views the loyalty dashboard.
Historical Data Archiving:
Don’t try to keep 50M tier history records in the live Dataverse environment. Implement a three-tier archival strategy:
- Hot data (last 12 months): Keep in Dataverse Member Tier History table for operational queries
- Warm data (1-3 years): Archive to Azure SQL Database with indexed tables for analytical queries
- Cold data (3+ years): Move to Azure Data Lake Storage in Parquet format for compliance/audit access
Use a monthly Azure Function to move records from hot to warm storage. This keeps your Dataverse database size manageable and query performance high. Power BI can create composite models that union hot data from Dataverse with warm data from Azure SQL for complete historical analysis.
For member tier progression analytics, pre-calculate key metrics during the archival process:
- Total days in each tier
- Number of tier upgrades/downgrades
- Longest consecutive tier streak
- Average points earning rate by tier
Store these as aggregate records rather than making analysts compute from raw history.
Implementation Recommendation:
Start with the materialized batch approach with real-time evaluation for recent activity. This gives you 95% of the flexibility benefits while maintaining performance at scale. Use structured tier definition entities rather than JSON for maintainability. Implement aggressive archival from day one - don’t wait until you have performance problems. With proper indexing and partitioning, your tier queries should complete in under 2 seconds even with 2M members.
The rule versioning point raised earlier is crucial - always store the tier_rule_version_id with each tier assignment so you can audit which rules were in effect when members qualified. This is essential for handling disputes and ensures compliance with loyalty program terms.