Telecom CVM Campaign Engine
A 7-stage Kafka pipeline powering 42+ campaign types for one of Tanzania's major telecom fintechs.
// THE CHALLENGE
A telecom fintech serving millions of subscribers needs to run dozens of customer value management campaigns at once — bonuses, loyalty rewards, win-back offers, usage incentives — each with its own eligibility rules, reward logic, and messaging.
At that scale, a campaign platform cannot be a collection of scripts. One slow stage must not stall every campaign, a failed reward must be traceable and retryable, and the business must be able to launch new campaign types without an engineering rewrite each time.
// THE SOLUTION
I architected the campaign engine as a 7-stage event-driven pipeline on Apache Kafka, separating concerns so each stage — from audience targeting and eligibility through reward fulfilment and messaging — scales and fails independently.
Campaign definitions are data, not code: new campaign types plug into the same pipeline, which is how the platform grew to support 42+ distinct campaign types. Redis handles fast eligibility state, BullMQ manages scheduled and retryable jobs, PostgreSQL with Prisma provides the system of record, and the whole platform runs on Kubernetes.
// HOW IT FLOWS
- 01
Ingestion
Subscriber and transaction events stream in over the Kafka backbone.
- 02
Segmentation
Audiences are resolved against campaign definitions — data, not code.
- 03
Eligibility
RedisPer-subscriber rules and velocity checks against fast Redis state.
- 04
Campaign matching
The right campaign type — one of 42+ — is selected for the event.
- 05
Throttling & scheduling
BullMQBullMQ paces sends, schedules windows, and retries failures.
- 06
Reward & delivery
Rewards are fulfilled and messages dispatched, idempotently.
- 07
Tracking
PostgreSQL · PrismaOutcomes land in PostgreSQL via Prisma and feed the next cycle.
// THE OUTCOME
The engine powers 42+ campaign types in production for a major Tanzanian telecom fintech, with new campaigns onboarded as configuration rather than new systems.