← Back to Portfolio
GitHub Project · github.com/arunkumar-dot/hn-scraper

Distributed Hacker News Scraper

Queue-driven ingestion pipeline for Hacker News items, built on Hono, BullMQ, Redis and PostgreSQL

TypeScriptNode.jsHonoBullMQRedisPostgreSQLPrisma
Context

A side project that ingests Hacker News items, top stories and nested comment trees into Postgres through a job queue, with a small HTTP API for search and stats. Runs locally via Docker Compose. Not deployed yet.

Problem

Scraping deeply nested comment trees through recursive API requests quickly exhausts rate limits, starves the single-threaded Node.js event loop, and causes database connection saturation.

Solution

Engineered an asynchronous queue-driven architecture utilizing Hono for lightweight HTTP endpoints, BullMQ with Redis for job scheduling and bounded worker concurrency, and PostgreSQL connection pooling with batched upserts.

Outcome

Ingestion runs across a 50-concurrency worker with five exponential-backoff retry attempts, batched upserts, and a Postgres full-text search index over ingested items.