Writing a prototype RSS reader takes an afternoon. Operating an ingestion engine across hundreds of publisher feeds on a continuous schedule without overlapping runs, exhausting database connection pools, or re-ingesting the same articles dozens of times is a different engineering problem entirely.

As Lynto's source registry expanded across global wires, national broadsheets, specialized science journals, and syndicated regional feeds, we hit two operational bottlenecks: slow XML feeds caused scheduled runs to collide, and syndicated redirect URLs tricked our pre-check into re-downloading stories we already had.

Here is how we designed our tiered polling scheduler and seen-URL deduplication ledger so unchanged feed items are dropped before touching our article extractor or AI pipeline.

1. Stateless Queue Locking & Tiered Polling Schedules

In a containerized worker environment, you cannot hold a database transaction open while waiting for remote HTTP servers to return XML feeds and article pages. Holding transactions across network I/O starves the connection pool within minutes.

Instead of deploying an external lock manager, we built a millisecond-duration stateful queue lock directly in our database layer:

ClaimDueSources(BatchLimit) : Status('idle' → 'scraping') WITH AtomicNonBlockingLock

When a scraper worker starts a cycle, it atomically claims a batch of due feeds whose scheduled poll time has arrived, flips their status from idle to scraping, reads each publisher's priority tier and custom polling interval, and closes the database transaction before making its first HTTP request.

  • Tiered Polling Cadence: High-velocity global wires and breaking desks poll frequently, whereas slower specialized or academic journals poll on longer multi-hour intervals tailored to their publication rhythm.
  • Self-Healing Stale Lock Reaper: Before each cycle begins, a pre-flight check resets any feed stuck in scraping status beyond a safe timeout window back to idle, ensuring an interrupted worker never leaves a feed permanently locked.
  • Automated Circuit Breaker: When a feed completes, its next poll is scheduled automatically. If a publisher feed throws consecutive crawl failures, our circuit breaker temporarily deactivates the feed and alerts our engineering inbox rather than hammering a broken endpoint.

2. The Redirect Trap: Why Naive URL Pre-Checks Fail

Once the scraper parses an RSS XML document, it checks whether the feed's item URLs already exist in storage before making expensive HTTP requests to download the full article text.

That check works for direct publisher feeds, but it breaks whenever a feed wraps its links in syndication, tracking, or redirect URLs. In those feeds, the link inside the XML tag is an opaque redirect wrapper, whereas the URL stored in our database after extraction is the resolved canonical publisher URL.

When a naive pre-check compares the raw feed wrapper URL against stored canonical URLs, the two strings never match. Without a secondary guard, three things happen on every run:

  1. The scraper re-downloads and re-parses the full HTML of articles it already ingested hours ago.
  2. The clustering engine compares the newly fetched text against recent prime stories, sees an identical match with itself, and risks attaching the article as a redundant self-citation.
  3. Because each feed enforces a per-run ingestion quota, sticky items at the top of the XML document consume the entire quota on every cycle, starving genuinely new stories further down the feed.

3. The Seen-Feed-Items Ledger & Transient Retry Cooldowns

To solve this permanently, we introduced a dedicated Seen-Feed-Items Ledger indexed by the exact raw URL string as it appears inside the RSS XML feed, prior to any redirect resolution. Every time the scraper processes a feed item, it records one of four outcomes:

Ledger Outcome Pre-Check Behavior Engineering Purpose
Saved Skipped permanently (rolling TTL) Item was extracted and stored as a net-new Prime Story. Never fetch again.
Cited Skipped permanently (rolling TTL) Item matched an existing event cluster and was linked as a cross-source publisher citation.
Duplicate Skipped permanently (rolling TTL) Redirect resolved to a canonical URL already in storage. Discarded without counting against the feed's per-run quota.
Extraction Failed Retried after a cooldown window (up to a strict attempt cap) Protects against temporary publisher timeouts or rate limits without re-hammering broken links on every cycle.

Treating Extraction Failed differently from final outcomes is critical. If a publisher's CDN briefly returns a 503 timeout, permanently blacklisting that URL would drop legitimate news. By enforcing a cooldown period and a strict maximum attempt ceiling, transient network blips recover automatically on a later cycle while permanently broken links are silenced once their retry budget is exhausted. Old ledger entries are pruned automatically once they age past the window where RSS feeds retain items.

4. Pre-LLM Clustering: Deterministic Similarity Matching

When a feed item passes both the canonical URL check and the seen-items ledger check, we extract its clean article text and compare it against recent prime stories before invoking any language model.

Rather than calling an external embedding API or LLM for every candidate pair, our scraper computes a fast in-memory similarity score combining Headline Similarity, Body Text Similarity, and Named Entity Overlap. When two articles cover the same underlying event above our clustering threshold, the new article is attached as a clickable publisher citation on the existing prime story (with an explicit guard blocking self-citations and duplicate URLs). This saves a full round of AI synthesis while enriching the story card with multi-publisher verification.

5. Honest Trade-Offs in Our Ingestion Design

Our scraper is intentionally polite. We space feed requests with randomized jitter, throttle individual article fetches, and cap each source at a strict per-run ingestion quota.

That means Lynto is not designed to beat a high-frequency financial terminal by 30 seconds on a wire flash. We readily trade away sub-minute crawl aggressiveness in exchange for polite publisher access, zero self-citations, and a clean, deduplicated story graph ready for your next morning or evening briefing.