How Glean uses Apache Beam Streaming to efficiently read a large corpus from MySQL
Aug 10, 2026

Summary
This post details the implementation of a streaming pipeline using Apache Beam with the Google Cloud Dataflow runner to efficiently read and process a large corpus from MySQL. It describes the creation of a custom UnboundedSource and UnboundedReader that queries a cache of documents maintained by a scanner object. The scanner issues parallel database reads, fetching documents in batches ordered by document ID to ensure each document is processed at most once per full scan. This approach replaces a batch job, enabling daily reprocessing of documents and improving scalability and cost-effectiveness.
More from the Enterprise Data Crawler trail
- Why building a workplace ChatGPT requires a great crawler
- Unlock rich insights across your entire business and BigQuery environments with Glean’s new structured query agents
- Using our identity schema to deliver personalized, permissions-aware results
- What is an intranet search engine, and what should modern enterprise search actually do?
- Make every business decision a better-informed one with Glean's Deep Research