How to Build a Scalable, Configurable Marketing Engine for High‑Volume Campaigns
This article explains the design of a highly extensible, configurable marketing engine that handles complex business scenarios, supports massive concurrent requests, and provides comprehensive tooling for activity configuration, reward distribution, and real‑time monitoring.
Business Scenario
When a user or a business system triggers an event, marketing actions are required. Typical events include order completion, sign‑in, membership upgrade, birthday, and any other situation that can be marketed.
Marketing Requirements
After the trigger, the system can grant specific rewards such as coupons, points, cash credits, or any other entitlement supported by the platform.
Design Goals
High scalability and reusability to handle complex business needs; avoid writing separate code for each new activity.
Support for large request volumes and high concurrency.
Comprehensive tooling, including an engine backend and a full‑function activity configuration client.
Overview Design
Design Details
Objects in the blue area are dynamic; a new set is generated for each activity request. ActivityContext contains the request, response, and processing details.
Objects in the light‑green area are static, representing merchant‑level activity configuration cached in JVM or Redis.
An Activity represents a merchant’s campaign, built via ActivityBuilder, and includes a filter tree (FilterTree) for participation conditions and a reward tree (RewardProducer) for reward generation. Both support AND‑OR trees for extensive extensibility.
The engine domain constructs the activity.
The AND‑OR‑TREE has two node types: RelationFilter (must have at least one child) and BusinessFilter (leaf node). The filter interface returns a boolean indicating whether the condition passes.
White‑area objects need persistence: ActivityRequest is stored after validation; ActivityRecord records successful participation; RewardRecord links rewards to the activity record, allowing multiple rewards per request.
Concurrency Design
The deployment structure of activity processing ensures high concurrency. Asynchronous processing allows staged node addition based on business needs, while caching minimally changing information guarantees fast handling.
Engine Capabilities
Support for arbitrarily complex participation conditions with dynamic relational extensions.
Unlimited reward expansion per activity, with flexible sharing or exclusive reward models.
Partial condition satisfaction triggers reward distribution (e.g., any three of ten conditions).
Deployed across multiple online services to provide marketing support.
User reward preview functionality.
Event cancellation and reward reclamation.
Conclusion
Hope this article inspires readers; feel free to leave comments and discuss further.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
