Skip to main content
Kayvan Mazaheri
Case Studies

Portfolio

Notable production outcomes across high-scale backend and AI systems.

case-study

Ad Platform Rebuild — 10× revenue over two years

Moved Cafebazaar's ad placement from a brittle monolith to a microservices platform without downtime. Architecture, pricing, ad-placement A/B testing, ML-model A/B testing, and graceful ML fallbacks all contributed — the headline outcome was 10× ad revenue sustained over two years.

stack · Microservices · Python · Go · Kafka

→ read case study
case-study

Legal-tech RAG — multi-tenant retrieval with citations

Built the document ingestion, embeddings pipeline, and citation-anchored RAG chatbot for an AI legal-tech startup. Multi-tenant across orgs, lawyers, and cases. Migrated the vector store from Pinecone to a self-hosted Elasticsearch cluster on GCP.

stack · RAG · Embeddings · Elasticsearch · Pinecone

→ read case study
case-study

Real-Time Estimation — 700ms p99 → 25ms

Cut p99 on the real-time ad estimation service from 700ms to 25ms — same endpoint, more traffic — through multi-tier caching, async refresh, request deduplication, batch inference, and graceful fallback when the model service was degraded.

stack · Machine Learning · Python · Redis · System Design

→ read case study
case-study

Kafka + Redis Event Pipeline — 50K events/sec

Built the event pipeline behind the ad platform — Kafka topics, Redis-tracked deduplication, batched DB writes. At-least-once delivery with idempotency keys gives effectively exactly-once at the application layer.

stack · Kafka · Redis · Python · Distributed Systems

→ read case study
case-study

Company-wide Feature Flags and A/B Testing at Divar

Designed and built the feature-flag and A/B testing service used across Divar's engineering teams — proposed to the CTO, approved, adopted org-wide, kept as standard.

stack · Python · Go · System Design · Backend

→ read case study
case-study

P2P Payment Fraud Detection at Cafebazaar

Rule-based fraud scoring on the peer-to-peer payment platform — cut manual review workload by ~70% by auto-deciding the obvious cases and prioritising the rest.

stack · Python · Django · Fraud Detection · Payment Systems

→ read case study