Stretchy technical whitepaper

This whitepaper describes how Stretchy indexes, scores and serves full-text search at the edge and on disconnected networks, reducing enterprise search infrastructure costs by up to 92%.

Architecture overview

Stretchy is engineered around a dual-runtime poly-engine architecture. In local and air-gapped deployments, Stretchy runs on an embedded Apache Lucene 9.12.0 core with custom type coercion and flat multi-tenant RBAC. In cloud edge environments, it pairs with Cloudflare Workers and D1 serverless storage to deliver sub-50ms global query execution across 330+ points of presence.

Index format and BM25 scoring

Stretchy avoids dynamic mapping exceptions by employing an 'Index Flattened, Store Original' strategy. Raw payloads are preserved exactly as ingested, while nested attributes are indexed into high-performance Lucene DoublePoint and LongPoint trees. Text fields are scored using BM25 relevance with customizable term saturation (k1) and document length normalization (b).

Probabilistic anomaly detection

Unlike legacy search stacks that require separate telemetry processing clusters, Stretchy integrates Welford's algorithm directly into ingestion pipelines. Online mean and variance are computed in single-pass O(1) time and O(1) space, instantly flagging statistical outliers via dynamic Chebyshev Z-score thresholds.

Deployment: edge, on-prem and air-gapped

A single Stretchy Docker container requires under 150MB of RAM, making it deployable on edge gateways, developer laptops, and sovereign bare-metal servers. Rich document ingestion for PDF, DOCX, and XLSX is powered by lightweight native parsers, eliminating the 100MB+ memory tax of external tools like Apache Tika.

Security and licensing

Enterprise editions feature air-gapped Ed25519 signature verification, MAC/UUID hardware node-locking, and encrypted monotonic clock-rollback defenses, ensuring sovereign operation without cloud dependencies.