Managing Elasticsearch Reindex at Scale: Performance, Reliability, and Observability
Palantir's Gotham document store rebuilds Elasticsearch indices from its transactional database (the source of truth) rather than using Elasticsearch's _reindex API, so search keeps serving live traffic throughout. The design writes to both the primary index and a shadow index, swaps them using aliases, and resolves conflicting writes with external_gte versioning. A background loop compares persisted metadata against actual cluster state and queues repairs. Later improvements added a parallel paging and indexing job runner with resumable checkpoints, three-way batch limits (document count, memory, batches per run), crash-safe idempotent state machines for index lifecycle operations, and layered logs, metrics and diagnostics for observability.
Related posts
- Break Stuff on Purpose
Slack Engineering mediumAdeptSlack's internal Kibana cluster failed in January 2024 after running out of disk, a consequence of co-locating its Elasticsearch storage on the same hosts as the application. The rebuild exposed a nearly two-year-old unmonitored backup that failed to restore and an outdated runbook, so users' dashboards and visualizations were lost. The team added scheduled backups, checked S3 retention, rewrote runbooks, and then deliberately filled the disks on a development cluster to rehearse recovery. The drill succeeded but missed the one-hour recovery goal and surfaced missing firewall rules in infrastructure as code. A later Kubernetes migration finished with about 30 minutes of downtime, and the backup script became a CLI that restores from cloud storage with a single command.
- Timeseries indexing at scale
Datadog Engineering mediumAdeptDatadog replaced its timeseries index, which auto-generated materialized indexes from a log of slow queries, with an inverted index that unconditionally indexes every metric;tag pair, much like search engines map words to documents. The original Go service used SQLite for index definitions and the query log and RocksDB for Tagsets, Metrics and Indexes. It worked for predictable programmatic queries, but unpredictable user queries fell back to full scans, causing timeouts and manual index toil. The next-gen design drops SQLite, keeps RocksDB, and answers tag filters by intersecting posting lists of timeseries IDs. The two generations are compared on performance and reliability.
- How Rakbank built centralized observability at scale with Amazon OpenSearch Service
AWS Architecture Blog mediumAdeptRakbank's retail digital banking platform ingests about 150 GB/day of logs from EKS microservices via a Fluent Bit DaemonSet into a cross-account, three-AZ Amazon OpenSearch Service domain reached privately over Transit Gateway, while dual-writing raw logs to S3 for 7-year compliance retention queried with Athena. ISM policies age append-only indices from gp3-backed Graviton hot nodes (0–15 days) to UltraWarm (15–30 days) to node-free S3 cold storage (30–60 days). Indices are force-merged before warm migration, and warm/cold tiers run with zero replicas because S3 provides durability. The result is roughly 55% savings over an all-hot r8g cluster. Rakbank chose Multi-AZ without Standby because Standby's 99.99% SLA reserves a third of search capacity and requires two replicas per index.
- How we rebuilt the search architecture for high availability in GitHub Enterprise Server
GitHub Engineering mediumAdeptGitHub Enterprise Server's HA mode is replacing its single Elasticsearch cluster spanning primary and replica nodes with independent single-node clusters per server, linked by Elasticsearch Cross Cluster Replication (CCR). The old clustered design let Elasticsearch move primary shards onto read-only replicas, which could deadlock upgrades and maintenance: the replica waited for a healthy cluster that couldn't recover until the replica rejoined. CCR copies only data already persisted to Lucene segments and fits the leader/follower model. Because auto-follow only covers new indexes, GitHub added a bootstrap step that attaches followers to existing indexes and built custom workflows for failover, index deletion and upgrades. CCR mode is opt-in from 3.19.1 via `ghe-config app.elasticsearch.ccr true` and will become the default over the next two years.
- How MDN’s site-search works
Mozilla Hacks mediumAdeptMDN's site search builds every page nightly in a GitHub Action, emitting index.json files. A Python script strips the HTML and bulk-publishes about 50,000 documents to a managed Elasticsearch cluster in roughly 3.5 minutes, deleting and recreating the index each day for simplicity. A Django endpoint queries it with elasticsearch-dsl, ranking by phrase and term boosts on title and body plus a Google Analytics-derived popularity score (rank = popularity*10 + score), and adds "Did you mean" suggestions. The cost of the daily rebuild is a brief window of incomplete results, softened by publishing the most popular en-US Web/ pages first.