Skip to main content
← PROBLEMS / SYSTEM-DESIGN
An end-to-end domain learning journey

Design a Multi-Modal Content Moderation
& Spam Filtering System.

Design a scalable Multi-Modal Content Moderation & Spam Filtering platform handling 15K uploads/sec across text, images, and video with <200ms sync text checks and <5s async video verdicts.
Start the journey7 stages· Last modified Nov 24, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When inference latency or GPU memory limits bind throughput, split synchronous Pre-Filter ingestion from an async Kafka-backed GPU Worker Pool, backed by a Redis Reputation & Velocity store and a Policy Engine.

TL;DR30-second simplified summary
▾

To scale to 15K uploads/sec, use S3 staging + Kafka URIs, split sync text/image checks (<200ms) from async video (<5s), and tune thresholds dynamically using Redis account velocity.

Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
Multi-Modal Content Moderation Cascades & Perceptual Hashing
Multi-Modal Content Moderation Cascades filter text, images, audio, and video at massive scale by placing sub-5ms perceptual hashes and regexes in front of expensive GPU vision, speech, and LLM classifiers.
Full walkthrough · 7 stages
01
foundation

Throughput, Media Sizing & Sync vs Async SLAs.

Why this matters: Separate synchronous text/hash checks (<200ms) from async video pipelines (<5s).

15K uploads/sec splits into 11K text/links, 3K images, and 1K videos.

Text and image perceptual hashes run synchronously in <200ms before publishing.

SLA Split

15K Uploads/sec Sync vs Async SLA Split

11K Text/s (<200ms)Fast path3K Images/s (<200ms)Pre-publish gate1K Videos/s (<5s)Deep media pathVisibility StateUser stateBlocks known hashes

1.UX vs Safety: Sync text/image checks stop instant spam; async video keeps upload UX snappy.

2.Pre-Viral Window: 5-second video SLA catches violations before algorithmic feed distribution.

Splitting sync text/hash checks from async video GPU pipelines balances UX and safety.

02
foundation

End-to-End Ingestion & GPU Worker Topology.

Why this matters: Connect S3 staging, Kafka, CPU Pre-Filters, GPU Workers, and Policy Engine.

Think of End-to-End Ingestion & GPU Worker Topology as the intuition layer for Design a Multi-Modal Content Moderation & Spam Filtering System: Connect S3 staging, Kafka, CPU Pre-Filters, GPU Workers, and Policy Engine.

Media binaries upload directly to S3 Staging via pre-signed URLs while metadata enters the Ingestion API. Kafka streams events through the CPU Pre-Filter (PhotoDNA + Aho-Corasick) to the GPU Worker Pool, which writes scores to the Policy Engine backed by Redis Reputation.

System Topology

S3 Staging + Kafka + GPU Worker Pool

Ingestion API + S3Upload entryCPU Pre-FilterTier 1 gateGPU Worker PoolTier 2 extractorsPolicy Engine +RedisEnforcementStreams novel via Kafka

1.Zero Kafka Blobs: Pass S3 URIs through Kafka, never multi-megabyte video payloads.

2.Modular Workers: Autoscale GPU pools independently from stateless CPU pre-filters.

Staging binaries in S3 and passing lightweight pointers through Kafka keeps messaging fast.

Engineering Decision Framework
Problem
How to implement Design a Multi-Modal Content Moderation & Spam Filtering System without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
When inference latency or GPU memory limits bind throughput, split synchronous Pre-Filter ingestion from an async Kafka-backed GPU Worker Pool, backed by a Redis Reputation & Velocity store and a Policy Engine.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When Design a Multi-Modal Content Moderation & Spam Filtering System experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
intermediate

Redis Reputation & Posting Velocity Store.

Why this matters: Amplify enforcement against coordinated bot farms and repeat offenders.

Think of Redis Reputation & Posting Velocity Store as the intuition layer for Design a Multi-Modal Content Moderation & Spam Filtering System: Amplify enforcement against coordinated bot farms and repeat offenders.

A borderline spam post from a 5-year-old verified account should be treated differently from the same post sent by a 10-minute-old account firing 50 links/minute. Redis tracks sliding-window post velocity, account age, and prior strikes to adjust policy thresholds dynamically.

Account Reputation

Redis Reputation & Velocity Threshold Tuner

Account HistoryTrust priorRedis VelocityCounterSpam signalDynamic PolicyEngineAdaptive gateQuarantine /TakedownEnforcementFlags burst activity

1.Coordinated Brigading: Tracking URL-hash velocity across accounts catches botnet link-spam.

2.Low-Friction Veterans: Trusted accounts avoid false-positive takedowns on borderline satire.

Combining content scores with Redis account reputation and velocity stops coordinated spam.

04
intermediate

GPU Worker Autoscaling & Priority Queues.

Why this matters: Prevent video transcoding backlogs from delaying live-stream or viral content.

Video uploads spike during live events.

We split Kafka into Priority Tiers: High-Priority (live streams, viral >100 views/min, reported posts) and Standard-Priority (low-reach uploads).

Queue Isolation

Priority-Tiered Kafka & KEDA GPU Autoscaling

Priority KafkaTopicFast laneStandard Kafka TopicBulk laneKEDA GPU AutoscalerElastic computeGPU Worker PoolExecution tier20% worker capacity

1.Head-of-Line Guard: Bulk backfills or spam floods never starve live-stream safety scans.

2.80/20 Weighted Fair: Reserving 20% for standard prevents complete starvation of normal users.

Priority Kafka topics and KEDA autoscaling protect high-impact scans during traffic spikes.

05
intermediate

Human-in-the-Loop Escalation & Appeals.

Why this matters: Provide fast moderator tooling, consensus QA, and user appeal workflows.

Think of Human-in-the-Loop Escalation & Appeals as the intuition layer for Design a Multi-Modal Content Moderation & Spam Filtering System: Provide fast moderator tooling, consensus QA, and user appeal workflows.

The Policy Engine routes 0.60–0.95 confidence items to a Human-in-the-Loop (HITL) queue with pre-extracted keyframes, Whisper transcripts, and highlighted policy spans. High-severity bans require 2-moderator consensus, and overturned appeals feed back as hard-negative training examples.

HITL Workflow

HITL Evidence Bundle & 2-Mod Consensus

Evidence BundleFast contextModerator WorkbenchHuman review2-Mod ConsensusGateQuality assuranceAppeals & RetrainLoopModel improvementValidates severe bans

1.Pre-Digested Evidence: Showing flagged keyframes and transcripts cuts average handle time from 90s to 20s.

2.Hard Negatives: Overturned appeals are gold-standard training data to reduce false positives.

Pre-packaged multimodal evidence and 2-moderator consensus improve HITL speed and accuracy.

06
advanced

Viral Link-Spam & Coordinated Campaign Detection.

Why this matters: Detect botnets posting slightly mutated spam across thousands of accounts.

Think of Viral Link-Spam & Coordinated Campaign Detection as the intuition layer for Design a Multi-Modal Content Moderation & Spam Filtering System: Detect botnets posting slightly mutated spam across thousands of accounts.

Spammers rotate domains via URL shorteners and tweak 2 words per post. A streaming Flink MinHash/LSH deduplicator clusters near-duplicate text and resolves final redirect URLs in a sandboxed fetcher, auto-quarantining entire bot campaigns in seconds.

Campaign Defense

Flink MinHash LSH & Redirect Resolver

Cross-Account PostsBotnet trafficFlink MinHash LSHNear-dup detectorSandboxed URLUnfurlerRedirect tracerCampaign QuarantineMass takedownUnfurls shortlinks

1.MinHash Clustering: Catches 'spin-text' spam where every post swaps a few synonyms.

2.Sandboxed Unfurling: Always resolve redirects in isolated egress containers to prevent SSRF.

Streaming MinHash clustering and sandboxed URL unfurling catch coordinated spam campaigns.

07
advanced

Immutable Audit Trails & Hash-List Sync.

Why this matters: Maintain regulatory compliance and propagate newly confirmed abuse hashes in <30s.

Think of Immutable Audit Trails & Hash-List Sync as the intuition layer for Design a Multi-Modal Content Moderation & Spam Filtering System: Maintain regulatory compliance and propagate newly confirmed abuse hashes in <30s.

Regulations (like the EU DSA) require explainable moderation logs and fast takedowns. Every verdict writes an immutable Iceberg audit record, and newly confirmed human-reviewed violations immediately push their PDQ/PhotoDNA hashes to Tier 1 Redis/memory Bloom filters in <30s.

Compliance & Sync

30-Second Hash Propagation & DSA Audit Log

Confirmed ViolationSource of truthIceberg Audit LakeCompliance storeHash UpdateBroadcast<30s syncTier 1 Pre-FilterInstant immunityBroadcasts PDQ hash

1.30s Global Immunity: Once one copy is caught, all Tier 1 filters block re-uploads within 30 seconds.

2.Explainable Logs: Storing model version and policy rule IDs satisfies regulatory audits.

Broadcast hash updates turn every caught violation into instant Tier 1 immunity.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

Why should the Ingestion API stage uploaded videos in S3 and pass only the S3 URI through Kafka to the GPU Worker Pool?

Recommended Learning Flow