November 16, 2026•10 min read•...

Rebuilding Omnicrawl: Scaling a Multi-Niche Programmatic Directory Factory in Rust, DuckDB, and Astro

RustDuckDBAstroCloudflare PagesAEOSEOProprietary

Proprietary Notice: Closed-Source Engine

Warning:RESTRICTED ACCESSIBILITY: Omnicrawl is a proprietary, closed-source programmatic directory engine developed exclusively for internal operations. While its flagship live directories run publicly at carrier.aiyoda.app and contractor.aiyoda.app, the underlying Rust ingestion crates, DuckDB lineage engine, and compilation pipeline are not public and will not be released to GitHub. It is documented here strictly as a systems architecture case study.

From Scraper Prototype to Multi-Niche Directory Factory

When I first built Omnicrawl, the goal was never to launch a single directory website. The vision was to engineer a repeatable, programmatic directory factory: swap the regulatory niche, configure demand-weighted slices in a single market.toml blueprint, trigger an in-process Rust data engine, and compile thousands of static pages built for search engines (SEO), AI answer engines (AEO), and high-ticket B2B monetization.

Early iterations leaned on a classic stack: HTML scraping via Firecrawl (crawler.rs), Gemini LLM extraction (enrichment.rs), a PostgreSQL/SQLite split, and Rust Askama HTML templates.

That prototype taught us hard lessons about operational friction. Today, Omnicrawl has graduated into an industrial-scale architecture:

  • Production Scale: Expanded from a 5,000-carrier prototype to 22,700 scoped entities and 27,670+ static pages across two live flagship verticals:

1. Freight Authority Check (carrier.aiyoda.app): 8,700 demand-weighted FMCSA interstate motor carriers across 10 U.S. states, with live Socrata census reconciliation (908,428 registered entities), 1,752 carrier profiles enriched with official inspection/crash safety telemetry, and 13,605 compiled static assets.

2. Texas Contractor Authority Check (contractor.aiyoda.app): 14,000 commercial trade contractors across all 254 Texas counties (HVAC, Electrical, Water Well, Elevator, Appliance, Electrical Sign), featuring within-trade PERCENT_RANK() license seniority, 370 cross-trade multi-license links, and 14,065 compiled static assets.

  • Shared Monorepo Engine (omnicrawl-core): Extracted all common plumbing into a unified crate (crates/omnicrawl-core/), standardizing DuckDB entity_lineage, CORRECTIONS_KV runtime overrides, IndexNow broadcasting, structured AEO schemas, and Cloudflare GraphQL edge telemetry.
  • Closed-Loop Verification: Pre-ingest Socrata census validation (socrata_scout) -> in-process DuckDB snapshot diffing -> offline dist/ parity and BM25 topical coherence (edge_parity) -> post-deploy IndexNow submission and Cloudflare edge audit logging.
┌────────────────────────────────────────────────────────────────────────┐
│                   Omnicrawl Industrial Lifecycle                       │
│                                                                        │
│  [ Regulatory Registries ] ──► [ socrata_scout ] ──► [ market.toml ]   │
│  (FMCSA, TDLR, Form 5500)      (Schema & Census)     (Slices & Limits) │
│                                                             │          │
│                                                             ▼          │
│   [ Astro 5 Static SSG ]   ◄── [ market.json ]   ◄── [ Rust + DuckDB ] │
│   (27,670+ Clean HTML)         (Zero-404 Delta)      (Dedupe, Lineage) │
│             │                                                          │
│             ▼                                                          │
│   [ edge_parity Gate ]     ──► [ Cloudflare Edge ] ──► [ IndexNow API ]│
│   (File Limit, BM25 Topic)     (Wrangler, $0 Host)   (Instant Index)   │
│                                         │                              │
│                                         ▼                              │
│                           [ Cloudflare GraphQL Audit ]                 │
│                           (DuckDB audit_snapshots Table)               │
└────────────────────────────────────────────────────────────────────────┘

1. In-Process Analytical Engine: Replacing PostgreSQL & SQLite with DuckDB

The most consequential architectural decision in Omnicrawl's evolution was replacing the external PostgreSQL (DATABASE_URL) + local SQLite split with embedded DuckDB (duckdb-rs with bundled).

For a programmatic directory engine managing periodic snapshot ingestions, persistent database daemons introduce unnecessary operational overhead:

  • Zero Server Ops Per Niche: Setting up managed Postgres databases, configuring connection pools, and migrating schemas for every vertical slows execution. DuckDB runs directly inside the compiled Rust binary, operating against a single portable database file (freight_authority.duckdb or contractor.duckdb).
  • Direct Ingestion of Massive Regulatory CSVs (read_csv_auto): Government datasets often span 140+ columns with inconsistent formatting, blank strings, and unescaped characters. DuckDB parses millions of rows directly in SQL using read_csv_auto(..., all_varchar=true, ignore_errors=true), inspects schemas dynamically via DESCRIBE, and adapts seamlessly between federal exports and local test fixtures.
  • Automated Snapshot Diffing & entity_lineage (prev vs. current): By rotating yesterday's snapshot into a carriers_prev or contractors_prev table, a single SQL query identifies status changes (revocations, reinstatements, new issuances). The engine persists this in an entity_lineage table (first_seen_at, last_seen_at, snapshot_appearances, change_count, last_change_summary) with same-day idempotency, directly populating /revocations/, /recent-reinstatements/, and /digest/ feeds.
  • Complex Analytical SQL in Rust: DuckDB executes window functions in milliseconds to compute within-trade seniority percentiles (PERCENT_RANK() OVER (PARTITION BY license_type ORDER BY issue_date ASC)) and discover cross-trade business entities across 14,000 contractor records.

#### Hard-Won Engineering Takeaways with duckdb-rs (Windows)

  1. Release vs. Debug Memory Spikes: Compiling duckdb with features = ["bundled"] compiles the C++ DuckDB amalgamation via MSVC /O2. Parallel release builds can spike system memory aggressively. Keeping routine local iterations on cached debug builds links in seconds.
  2. Explicit Typing on NULL Literals: DuckDB infers untyped SQLNULL for bare NULL literals, breaking Rust row deserialization (Option<T>). All nullable projected columns require explicit casting: CAST(NULL AS VARCHAR).
  3. Read Strings First, Cast Safely Second: Government data is notoriously dirty. Ingesting raw columns as strings first and casting with TRY_CAST(NULLIF(TRIM(col), '') AS UINTEGER) prevents an isolated malformed row from failing a 50,000-record import.

2. Extracted Core Engine: crates/omnicrawl-core

Rather than copying and pasting ingestion utilities, SEO schemas, and edge scripts across directories, Omnicrawl centralizes all core mechanisms into crates/omnicrawl-core/:

  • audit.rs & audit_snapshots: Queries Cloudflare's GraphQL analytics API (--audit), categorizes crawlers (Googlebot, Bingbot, OAI-SearchBot, Claude-SearchBot, PerplexityBot), tracks 4xx/5xx error paths, and logs daily performance into DuckDB to generate Week-over-Week delta comparisons in AUDIT_REPORT.md and AUDIT_REPORT.json.
  • indexnow.rs: Handles automatic URL batching (key-authenticated chunks up to 10,000 URLs) and submits modified paths to the IndexNow protocol immediately following edge deployments.
  • lineage.rs: Maintains longitudinal entity tracking across periodic snapshots, ensuring historical status changes remain verifiable over time.
  • overrides.rs: Integrates with Cloudflare Workers CORRECTIONS_KV to synchronize verified entity corrections and verified owner claims into DuckDB without touching raw government census data.
  • static_artifacts.rs: Generates standardized root discovery artifacts (/llms.txt, sitemap.xml, /ads.txt, BingSiteAuth.xml) across all target directories.

3. Presentation Architecture: Rust Analytical Core -> Astro Static SSG

Presentation is strictly separated from data ingestion. Rust and DuckDB focus exclusively on data cleaning, deduplication, and exporting a clean market.json payload, while Astro handles static page compilation (astro build):

  • Sub-50ms Global Edge Latency: Every single company profile (e.g. /carrier/930837/ or /contractor/10482/) is pre-rendered static HTML. By pairing Astro static generation with Cloudflare Pages' global CDN, pages load without server runtime overhead or database query latency.
  • Zero-Database Client-Side Instant Search: Instead of shipping heavy databases to the browser or hitting dynamic search endpoints, Omnicrawl generates a lightweight /search-index.json containing normalized entity names, license numbers, and county slugs. Instant lookup and exact-ID routing execute entirely in the client's browser.
  • Defensive Crawl-Budget & Funnel Protection:
  • Affiliate bridges and commercial claim routes are isolated behind Disallow: /go, Disallow: /go/, Disallow: /claim, and Disallow: /claim/ in robots.txt.
  • All outbound partner links enforce rel="nofollow", and funnel target pages carry <meta name="robots" content="noindex, nofollow">.
  • CLS-Safe Display Ad Layouts: Ad banners (AdSlot.astro) enforce strict, fixed-height CSS reservations (min-height: 280px) without responsive shifts, preventing Cumulative Layout Shift (CLS) penalties while integrating Google Consent Mode v2 (gtag('consent', 'default')) directly in <head>.

4. Quality Verification & Telemetry Gates (edge_parity)

Before any directory deployment is uploaded to Cloudflare Pages, the compiled dist/ directory is audited locally by edge_parity:

  1. File Count Cap Gate: Ensures total static output remains strictly under the Cloudflare Pages 20,000-file cap.
  2. Zero-404 Link & Fragment Parity: Cross-references all <loc> tags in sitemap.xml and entries in search-index.json against the physical filesystem, while verifying that #fragment anchor targets actually exist in target HTML files.
  3. BM25 siteRadius Topical Focus: Measures topical cohesion across pages to verify the directory maintains sharp architectural focus without semantic drift.
  4. AEO/SEO Scoring: Verifies that AI search bots are allowed access to /llms.txt and /articles/ while deep API routes remain protected.

Frequently Asked Questions (AEO & AI Search Reference)

How does Omnicrawl achieve zero-cost edge hosting while publishing tens of thousands of programmatic directory pages?

Omnicrawl decouples data processing from runtime delivery. Instead of serving pages dynamically through web servers and database instances, the engine runs analytical SQL and snapshot diffs in-process with DuckDB inside a compiled Rust pipeline, exporting static JSON datasets. Astro compiles these datasets into pure static HTML, CSS, and client-side JSON search indices during build time. The resulting static directory is deployed directly to Cloudflare Pages' global CDN via Wrangler. Because all entity profiles, state hubs, and search indices are served as pre-rendered static files without running server daemons or database queries at request time, hosting costs remain $0 even under high crawl volumes.

Why does Omnicrawl use embedded DuckDB instead of a centralized PostgreSQL or MySQL database?

In a programmatic multi-niche architecture, running an external database server introduces significant network latency, connection pooling complexity, schema migration maintenance, and cloud hosting expenses for every new vertical. Embedded DuckDB runs in-process inside the Rust binary, operating on a single portable database file. DuckDB's analytical engine excels at columnar operations, ingesting massive 140+ column government CSV files directly via SQL (read_csv_auto), computing complex window functions (such as PERCENT_RANK() for license seniority), and executing full snapshot diffs (carriers_prev vs carriers) in milliseconds without maintaining external infrastructure.

How does Omnicrawl balance AI search crawler discovery with crawl-budget protection?

Omnicrawl implements a tiered crawler access model. Answer Engine Optimization (AEO) grounding bots (such as OAI-SearchBot, Claude-SearchBot, and PerplexityBot) are explicitly granted crawl permissions in robots.txt for informational hubs, entity profiles, and /llms.txt discovery endpoints, allowing AI models to extract accurate regulatory citations. Simultaneously, commercial monetization routes (/go/, /claim/), internal API handlers, and proxy endpoints are strictly disallowed, marked with rel="nofollow", and tagged with noindex, nofollow to prevent search spiders and aggressive training harvesters (Bytespider, CCBot) from wasting crawl budget on non-indexable utility funnels.


Architectural Conclusions

Omnicrawl demonstrates that modern programmatic publishing does not require fragile web scrapers, bloated relational database servers, or low-quality AI text generation.

By anchoring directories to authoritative public registries, executing transformations in in-process analytical engines (DuckDB), sharing core plumbing across crates/omnicrawl-core, and enforcing strict build and edge invariants with edge_parity, Omnicrawl provides a hardened blueprint for building profitable, ultra-fast B2B web directories at scale.

Thanks for reading! Support our development efforts.
Support AIYoda on Ko-fi