case study · Web crawler & search engine
DistributedCrawler
A horizontally-scalable crawler and full-text search engine running across a 7-container Dockerized system.
JavaSpring BootRabbitMQRedisMongoDBDocker
queued 0indexed 0dupes dropped 0
workers
↑ live model of the system — interactive
[01] the problem
Crawling at scale means many workers racing over the same URLs — without coordination you fetch duplicates, waste bandwidth and corrupt results.
[02] architecture
- hop 01APISpring Boot — seeds crawls & serves search
- hop 02QueueRabbitMQ producer-consumer pipeline
- hop 03Workers ×3ExecutorService pools + CompletableFuture
- hop 04DedupLocal ConcurrentHashMap + Redis SETNX
- hop 05StoreMongoDB with weighted text indexes
[03] what I built
- Producer-consumer queue across API, 3 workers, RabbitMQ, Redis and MongoDB containers.
- Two-layer dedup (ConcurrentHashMap + distributed Redis SETNX) for idempotent at-least-once delivery.
- Concurrent fetch pipeline with ExecutorService + CompletableFuture, depth limits and domain boundaries.
- Full-text search API with MongoDB weighted text indexes, ranked results and dynamic snippets.
[04] decisions
#1
Dedup in two layers: a cheap in-process check first, then a distributed Redis SETNX lock as the source of truth.
#2
At-least-once delivery + idempotent processing instead of fragile exactly-once guarantees.
#3
Workers are stateless containers, so throughput scales by adding replicas.
[05] media
screenshot 1 · coming soon
screenshot 2 · coming soon
next worker →
Talent IQ