Elasticsearch → Static JSON / D1 Migration — You Don't Need a Search Engine for Small Datasets
I implemented three search backends — Elasticsearch, Cloudflare D1 (SQLite), and Static JSON (in-memory) — for a Japanese text search API running on Cloudflare Pages, and compared their performance. Background I’ve been running a full-text search API for classical Japanese texts. The existing setup used an external Elasticsearch cluster, but I wanted to explore alternatives for several reasons: Reduce external service dependencies Keep everything within Cloudflare Pages The dataset is small (~1,800 records) — a full-text search engine might be overkill Dataset Metric Value Records 1,812 Total text (UTF-8) ~2.5 MB Average per record ~1.4 KB Each record contains classical Japanese text (a few to ~15 lines), a page number, volume name, and IIIF canvas URL. ...