---
title: "Managing Elasticsearch Reindex at Scale: Performance, Reliability, and Observability"
description: "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."
url: "https://swe.quest/articles/managing-elasticsearch-reindex-at-scale-performance-reliability-and-12c26b4dcf9e376c"
canonical: "https://blog.palantir.com/managing-elasticsearch-reindex-at-scale-performance-reliability-and-observability-cf948d0efd47"
source: "Palantir"
published: "2026-06-08"
difficulty: "medium"
kind: "Case study"
reading_minutes: 14
tags: ["search","schema-migrations","resilience","observability","system-design"]
---

# Managing Elasticsearch Reindex at Scale: Performance, Reliability, and Observability

A post on [Palantir](https://swe.quest/sources/palantir.md), published 2026-06-08, 14 min read, Case study. Original: [https://blog.palantir.com/managing-elasticsearch-reindex-at-scale-performance-reliability-and-observability-cf948d0efd47](https://blog.palantir.com/managing-elasticsearch-reindex-at-scale-performance-reliability-and-observability-cf948d0efd47)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)

## Prerequisites

- Elasticsearch indices and mappings ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))
- Index aliases
- Thread pools and bounded queues ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))

## Keywords

Elasticsearch, Palantir Gotham, index aliases, shadow index, version\_type external\_gte

## Related posts

- [Break Stuff on Purpose](https://swe.quest/articles/break-stuff-on-purpose-87dc2221ffb9f4a6.md): Slack Engineering · 2024-12-10 · Medium · 5 min read · Chaos engineering, Incidents & postmortems, Observability, SRE
  Slack'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.
- [Timeseries indexing at scale](https://swe.quest/articles/timeseries-indexing-at-scale-cbd6b9bd5fe12d35.md): Datadog Engineering · 2024-06-28 · Medium · 20 min read · Storage engines, Search, Databases, Observability, Scaling
  Datadog 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.
- [How Rakbank built centralized observability at scale with Amazon OpenSearch Service](https://swe.quest/articles/how-rakbank-built-centralized-observability-at-scale-with-amazon-opensearch-1bb98e77fef163aa.md): AWS Architecture Blog · 2026-11-17 · Medium · 9 min read · Observability, Cost optimization, Cloud platforms, Search, Kubernetes
  Rakbank'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.
- [How we rebuilt the search architecture for high availability in GitHub Enterprise Server](https://swe.quest/articles/how-we-rebuilt-the-search-architecture-for-high-availability-in-github-01873f5db2c5c7f0.md): GitHub Engineering · 2026-03-03 · Medium · 5 min read · Search, Replication, System design, Distributed systems
  GitHub 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).
- [How MDN’s site-search works](https://swe.quest/articles/how-mdn-s-site-search-works-3d88867dabcc5021.md): Mozilla Hacks · 2021-03-22 · Medium · 6 min read · Search, System design, Python
  MDN's site search builds every page nightly in a GitHub Action, emitting index.json files.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
