1 Search2 Scale3 Flow4 See5 Roles6 Cost7 Smart8 Global01 / 26
NOW
THE ELASTIC STORY · A WHITEBOARD IN MOTION
Elasticsearch, from one box to the whole planet.
The story of Acme Shop : one server, then the world
→ next step · ← back · D draw · N speaker notes · O overview · F fullscreen
The journey: eight questions
Each chapter answers one question and adds one block to the big picture.
1 Search What is Elasticsearch, and why is it fast?
2 Scale How does it grow without breaking?
3 Flow How does data get in, and answers get out?
4 See How do people explore and act on the data?
5 Roles Who does what in a big cluster?
6 Cost How do we keep it fast and affordable?
7 Smart How does it understand meaning?
8 Global How do we run it across regions?
CHAPTER 1 OF 8
Search
What is Elasticsearch, and why is it fast?
THE STORY · ACME SHOP
Acme Shop sells outdoor gear. Customers type “waterproof trail shoes” and the old database search is slow and misses obvious matches.
IN THIS CHAPTER
What it is Fit and non-fit Document Index Mapping Analysis One node
Everything is a search problem
A million documents, one question: which ones mention “payment failed”?
Without an index: read everything Cost grows with every document you add.
scanning 1,000,000 docs…
With an inverted index: look it up For every term, remember which docs contain it.
DOCUMENTS
D1 · payment failed for card
D2 · payment received
D3 · card declined, payment failed
TERM → DOCS
card → 1, 3
declined → 3
failed → 1, 3
payment → 1, 2, 3
received → 2
Query payment AND failed → intersect {1,2,3} ∩ {1,3} = D1, D3 in milliseconds.
What Elasticsearch actually is
A distributed search and analytics engine, built on Apache Lucene, driven over a REST API.
Apache Lucene The search library: inverted index, scoring, segments. Each shard is one Lucene index.
Elasticsearch Shards, replicas, cluster · REST API · aggregations · security · machine learning
The Elastic Stack Kibana to explore · Elastic Agent, Logstash, OpenTelemetry to collect
# everything is an HTTP call with JSON
GET products/_doc/1 # read
POST products/_doc # add
GET products/_search # search
DELETE products/_doc/1 # delete
# official clients: Java, Python,
# JavaScript, Go, .NET, Ruby, PHP
Where it shines, and where to think twice
Choosing it for the right job is half of a successful project.
Great fit ✓ Full-text and relevance search
✓ Filtering and aggregations over huge data
✓ Logs, metrics, traces, security events
✓ Vector and hybrid search for AI apps
Think twice ! Multi-document ACID transactions
! Heavy relational joins
! Sole system of record with no backups
! Needing results the same millisecond (refresh is about 1s)
Typical pattern: your database stays the source of truth, and a copy is indexed into Elasticsearch for search and analytics.
A document : one thing you can find
In Acme Shop, one product is one document.
{
"_id" : "1" ,
"name" : "Trail running shoe" ,
"category" : "footwear" ,
"price" : 129.0 ,
"in_stock" : true ,
"description" : "Light, grippy,
built for wet rock."
}
_id identifies itUnique inside an index. You choose it, or Elasticsearch generates one.
Fields are what you ask about Search the name , filter on category , sort by price .
The original is kept Your JSON is stored as sent, so search results return it unchanged.
Think of it as one book in a library : it has a number, and things you can look up about it.
TERMS Document › Index › Node › Cluster › Shard › Replica
An index : a named collection of documents
All of Acme’s products live in one index called products .
index: products 6 documents (really millions)
_id 1 Trail running shoe $129
_id 2 Hiking boot $189
_id 3 Rain jacket $149
_id 4 2-person tent $320
_id 5 Headlamp $45
_id 6 Sleeping bag $210
One index, one kind of thing products, orders, logs: each gets its own index.
GET products/_search
{ "query" : { "match" : { "name" : "trail shoe" } } }
Think of it as one section of the library catalogue : all the books on one topic.
TERMS Document › Index › Node › Cluster › Shard › Replica
The mapping : how each field is searched
The index schema. It decides how every field is stored and searched.
{
"name" : "Trail running shoe" ,
"sku" : "TR-9041" ,
"price" : 129.0 ,
"created" : "2026-11-02" ,
"description" : "Light, grippy,
built for wet rock."
}
index→
name text full-text search, analyzed into terms
sku keyword exact match, filters, aggregations
price float ranges, sorting, stats
created date time filters, histograms
description semantic_text search by meaning, embeddings made for you
Dynamic mapping guesses. In production, define the mapping .
How text becomes searchable terms
Analysis runs when you index, and again on your query. This is why “shoes” finds “shoe”.
1 · TEXT IN "Light waterproof shoes for wet rocks!"
2 · TOKENIZE Light waterproof shoes for wet rocks split on word boundaries, drop punctuation
3 · NORMALIZE light waterproof shoe for wet rock lowercase · remove filler · reduce to root
QUERY: “Wet Rock Shoes” wet rock shoe → all three terms found in this document ✓
same analyzer on both sides, so the terms line up
Ranking (BM25): a term that is rare across all documents, and sits in a short field, counts for more. That is how the best match rises to the top.
One node. One index. Happy.
This is where everybody starts, and for a while it is perfect.
node-1 all roles
products · 1 primary shard
P0
DISK
94% full · CPU pegged · queries slowing
Then the data grows…
● Disk fills up● One machine does all the work● If it dies, search is down
Scale up Bigger machine. Has a ceiling, costs more per GB, still a single point of failure.
Scale out ✓ Add machines and spread the data. That is a cluster .
CHAPTER 2 OF 8
Scale
How does it grow without breaking?
THE STORY · ACME SHOP
Black Friday. The single server is full, and if it dies the whole shop goes dark.
IN THIS CHAPTER
Nodes and clusters Sharding by example Replicas One index, many machines
Six words explain almost everything
Learn them in this order. Every slide that follows zooms into one of them.
Document One JSON record.
ACME EXAMPLE
Trail running shoe
LIBRARY
≈ a book
Index A named group of documents.
ACME EXAMPLE
products
LIBRARY
≈ a catalogue section
Node One Elasticsearch server. It stores data.
ACME EXAMPLE
node-1
LIBRARY
≈ a room
Cluster Nodes working together as one system.
ACME EXAMPLE
prod-search
LIBRARY
≈ the whole library
Shard A slice of an index. A small search engine of its own.
ACME EXAMPLE
P0 · P1 · P2
LIBRARY
≈ a bookcase
Replica A copy of a shard on another node.
ACME EXAMPLE
R0
LIBRARY
≈ a photocopy kept in another room
THE DATA
SCALE OUT
DIVIDE AND PROTECT
Nodes join up and form a cluster
Same cluster name, a list of seed hosts, and they find each other.
cluster.name: prod-search
node-1 master · data
10.0.1.11 heap 16 GB · disk 1 TB
node-2 master · data
10.0.1.12 heap 16 GB · disk 1 TB
★ elected master
node-3 master · data
10.0.1.13 heap 16 GB · disk 1 TB
node-2 and node-3 discover node-1 and join.
Everyone holds the same cluster state : members, index settings, where every shard lives.
Only the elected master changes that state. Any node can serve any request.
TERMS Document › Index › Node › Cluster › Shard › Replica
Sharding, with real documents
Six Acme products, one index, three shards, three nodes.
index: products · 6 documents
_id 1 Trail running shoe → P2
_id 2 Hiking boot → P0
_id 3 Rain jacket → P1
_id 4 2-person tent → P2
_id 5 Headlamp → P0
_id 6 Sleeping bag → P1
shard = hash(_id) % 3
illustrative numbers; real hash is murmur3
node-1 data
P0 2 Hiking boot5 Headlamp
node-2 data
P1 3 Rain jacket6 Sleeping bag
node-3 data
P2 1 Trail running shoe4 2-person tent
Fetch by id (GET products/_doc/3 ) asks one shard. A text search must ask all shards, in parallel.
The number of primary shards is fixed at creation (default 1). Choose it with growth in mind.
Each shard costs memory and CPU. More shards is not better . Chapter 6 shows how to size them.
TERMS Document › Index › Node › Cluster › Shard › Replica
Add replicas : copies that survive failure
A replica is a full copy of a shard on a different node. Default: 1 replica per primary.
CLUSTER HEALTH
YELLOW
GREEN
RED
YELLOW
GREEN
Primaries are assigned but replicas are not yet. Everything works, with no safety net .
Every primary has a copy on another node. Reads can use either , so capacity grows too.
node-1 dies. P0 has no primary right now. Writes to P0 pause for a moment.
The master promotes R0 to primary on node-2. No data lost, search keeps answering.
Missing copies are rebuilt on the survivors . Back to green on two nodes.
Never together A replica never lives on the same node as its primary.
Self-healing Failure handling is automatic. No pager needed for one node.
Rule of thumb Production: 1 replica , in 2+ zones. Zero replicas only for disposable data.
TERMS Document › Index › Node › Cluster › Shard › Replica
Zoom out: one index , many machines
What your app sees, and what the cluster does for it.
WHAT YOUR APP SEES
products one index, six documents GET products/_search
WHAT THE CLUSTER DOES
3 primary shards, one per node
+ replicas on different nodes: survive a node failure
You think in indices . Elasticsearch handles shards, nodes and failover for you.
TERMS Document › Index › Node › Cluster › Shard › Replica
CHAPTER 3 OF 8
Flow
How does data get in, and answers get out?
THE STORY · ACME SHOP
Orders, clicks and logs now arrive from apps, servers and partners. Each one must be searchable within seconds.
IN THIS CHAPTER
Ingest Elastic Agent and Fleet Templates Write path Search path Queries and aggregations
Getting data in
Many sources, one clean path into the cluster.
Sources
Elastic Agent + Fleet
OpenTelemetry (EDOT / OTLP)
Logstash / Beats
Connectors + crawler
REST / _bulk API + clients
→
Ingest pipeline Processors run in order, before indexing:
grok / dissect date geoip rename · remove enrich inference
→
Data stream One name to write to and search, over time-based backing indices.
logs-nginx-prod├ .ds-…-000001 ├ .ds-…-000002 └ .ds-…-000003 ← writes
Pipelines run on ingest nodes (role: ingest ). Heavy parsing? Give them their own nodes so indexing stays fast.
Collecting data: Elastic Agent and Fleet
One agent per host, managed centrally. No custom collection scripts.
web-01 Elastic Agent nginx system
db-01 Elastic Agent mysql system
k8s-node-01 Elastic Agent kubernetes system
events go straight to Elasticsearch
Fleet Central policies, upgrades and health for every agent. It sends policies, not data .
Data streams logs-nginx.access-prod
metrics-system.cpu-prod
logs-mysql.error-prod
logs - nginx.access - prod type · dataset · namespace
ECS (Elastic Common Schema): the same field names everywhere, like source.ip , host.name , @timestamp . One dashboard works across every source.
Prefer OpenTelemetry ? Elastic Distributions of OpenTelemetry, or any OTLP source, send to the same place.
Templates: set the rules once
New indices appear all the time. A template gives each one the right mappings and settings.
Index template pattern: logs-app-* mappings @timestamp date, message text, service.name keyword
settings 1 primary shard, 1 replica
lifecycle ILM policy logs-30d
applied to→
.ds-logs-app-000001 ✓ mappings ✓ settings ✓ lifecycle
.ds-logs-app-000002 ✓ mappings ✓ settings ✓ lifecycle
.ds-logs-app-000003 ✓ mappings ✓ settings ✓ lifecycle
PUT _index_template/logs-app
{ "index_patterns" : ["logs-app-*" ], "data_stream" : { },
"composed_of" : ["logs-mappings" , "logs-settings" ],
"template" : { "settings" : { "index.lifecycle.name" : "logs-30d" } } }
Change the template once , and every future index follows it.
Follow one document in
A single indexing request, from client to searchable.
doc _id: 42
Client POST /products/_doc/42
Any node Acts as coordinating node
shard = hash(_id) % primaries → shard 1
validate · index · write translog
same operation replayed
Primary waits for replicas, then acknowledges back to the client.
Translog Every op is logged first. A crash can’t lose acknowledged writes.
Refresh · ~1s Buffer becomes a new segment. That is when it becomes searchable .
Merge Small segments merge into bigger ones in the background.
Search is scatter , then gather
Ask every shard, merge the winners, fetch only what you return.
Client GET /products/_search
top 10 ids + scores
top 10 ids + scores
top 10 ids + scores
3 full docs
5 full docs
2 full docs
① Query phase. One copy of every shard searches locally and returns just its top 10 (ids and scores).
② Merge. The coordinator builds the global top 10 from 30 candidates.
③ Fetch phase. Only the shards that own winners are asked for the real documents.
④ Respond. Replicas share the load: adding copies adds read capacity. Fewer, larger responses beat deep pagination.
Three ways to ask
Rank by relevance, narrow with yes/no rules, or summarise. Real requests mix all three.
QUERY “Which products match?” Scored and ranked by relevance.
8.2 Trail running shoe
5.1 Trail sandal
2.4 Approach shoe
match: name = “trail shoe”
FILTER “Is it allowed in?” Yes or no. No score, cached, fast.
✓ Rain jacket · $149
✓ Headlamp · $45
✗ Tent · $320
range: price < 150
AGGREGATION “What does it add up to?” Summaries, not documents.
footwear 214
jackets 96
tents 58
terms: category · example data
GET products/_search
{ "query" : { "bool" : { "must" : { "match" : { "name" : "trail shoe" } },
"filter" : { "range" : { "price" : { "lt" : 150 } } } } },
"aggs" : { "by_category" : { "terms" : { "field" : "category" } } } }
CHAPTER 4 OF 8
See
How do people explore and act on the data?
THE STORY · ACME SHOP
The data is flowing, but only engineers can query it. Support wants dashboards, finance wants reports, and on-call wants alerts.
IN THIS CHAPTER
Kibana The toolbox Data to dashboard to alert Ways to ask ES|QL
Kibana: the window into your data
The web interface of the Elastic Stack. Everything a person does with the data starts here.
Browser Support, finance, on-call, engineers.
HTTPS→
Kibana A web server (Node.js). Stateless. Login with your Elasticsearch users and roles. Spaces separate teams.
queries→
Elasticsearch Your data, plus Kibana’s saved objects in .kibana indices.
Keeps no data of its own Every chart is a live query to Elasticsearch.
Saved objects live in the cluster Dashboards, searches and rules are stored in Elasticsearch, so they are backed up with it.
Scale out Run several Kibana instances behind a load balancer.
Six things you do in Kibana
The toolbox. Observability and Security add their own apps on top.
DISCOVER Search and browse raw documents. Filter with KQL, open any single event.
ACME EXAMPLE
Every checkout error in the last hour.
DASHBOARDS + LENS Drag fields into charts, combine them into dashboards you can share.
ACME EXAMPLE
A “checkout health” board for support.
DEV TOOLS A console for REST requests, plus Search Profiler and Grok debugger.
ACME EXAMPLE
Test a query before it ships.
ALERTS + RULES Notify Slack, email or PagerDuty when a condition is met.
ACME EXAMPLE
Errors above 100 in five minutes.
MAPS + MACHINE LEARNING Geo data on maps. Anomaly detection managed from the UI.
ACME EXAMPLE
Traffic spike from one region.
STACK MANAGEMENT Data views, index management, ILM policies, snapshots, users and roles.
ACME EXAMPLE
Change retention, add a user.
From data to dashboard to alert
One question, followed end to end. (Acme checkout errors.)
checkout errors
DATA VIEW Tell Kibana which data to read, for example logs-* .
DISCOVER Search and filter: service.name: checkout and log.level: error
LENS Drag fields onto a chart: errors per service over time.
DASHBOARD Pin charts together. Share it. One filter changes every panel.
ALERT RULE If errors exceed 100 in 5 minutes, notify Slack or PagerDuty.
Same data, four jobs: explore, visualise, share, act .
Three ways to ask the same question
Checkout errors, three languages. Pick by who is asking.
KQL The Kibana search bar. Easy to type.
service.name: "checkout" and log.level: "error"
Best for: exploring in Discover and dashboards.
QUERY DSL JSON over the API. Full power.
{ "query": { "bool": {
"filter": [
{ "term": { "service.name":
"checkout" } },
{ "term": { "log.level":
"error" } } ] } } }
Best for: application code .
ES|QL Piped. Great for analysis.
FROM logs-*
| WHERE service.name ==
"checkout"
AND log.level == "error"
| STATS errors = COUNT(*)
BY BUCKET(@timestamp, 1h)
Best for: analysis , also in Discover.
Rule of thumb: KQL to explore, Query DSL in application code, ES|QL to analyse. (SQL and Lucene syntax exist too.)
Ask questions with ES|QL
A piped language: each step takes the table from the step before.
FROM logs-*
| WHERE @timestamp > NOW() - 1 hour AND log.level == "error"
| STATS errors = COUNT (*) BY service.name
| LOOKUP JOIN service_owners ON service.name
| SORT errors DESC
| LIMIT 3
Pick the data
Last hour, errors only
Count per service
Add the owning team
Biggest first, top 3
service.name errors team
checkout 1,284 payments
search-api 412 discovery
auth 97 identity
sample output Works across clusters too: FROM eu:logs-*
CHAPTER 5 OF 8
Roles
Who does what in a big cluster?
THE STORY · ACME SHOP
There are dozens of machines now. Someone must decide, someone must store, someone must prepare data, and someone must control access.
IN THIS CHAPTER
Node roles Master quorum Security Health and monitoring
Growing up: nodes get roles
Small cluster: every node wears many hats. Big cluster: specialise.
master Master-eligible Owns the cluster state: creates indices, allocates shards. Keep them light.
voting_only Tie-breaker Votes in elections but never becomes master. Cheap quorum helper.
data_* Data Hold shards, run indexing and search. Split into content, hot, warm, cold, frozen.
ingest Ingest Run ingest pipelines before documents are indexed.
no roles Coordinating Routes requests and merges results. Offloads heavy aggregations.
ml Machine learning Runs anomaly detection jobs and trained models.
transform Transform Pivots and rolls up data into new, summarised indices.
remote_cluster_client Remote client Lets a node talk to other clusters for CCS and CCR.
node.roles: [ data_hot, ingest ] ← roles are just a setting
A brain that survives: quorum
The cluster needs a majority of master-eligible nodes to agree.
master-a master
zone-1
× down
master-b master
zone-2
★ elected
× down
master-c master
zone-3
★ elected
3 of 3 up. Quorum needs 2 votes. Healthy.
2 of 3 up. Still a majority, so a new master is elected in seconds. No outage.
1 of 3 up. No majority, no master. Writes and cluster changes are blocked until quorum returns.
Rule: 3 dedicated master-eligible nodes , in 3 zones. Two masters tolerate no failure at all. Only two zones? Use a voting_only tie-breaker as the third.
Who may do what : security
Every request passes four gates. Security is on by default.
AUTHENTICATION Who are you? Users and passwords, single sign-on (SAML, OpenID Connect), and API keys for apps.
ACME EXAMPLE
analyst-eu signs in with company SSO.
AUTHORIZATION What may you do? Roles grant privileges on indices. Go finer with field and document level security.
ACME EXAMPLE
Role eu-analyst: read orders-eu, hide card_number.
ENCRYPTION Is it private? TLS between nodes and between clients and the cluster. Encrypt data at rest too.
ACME EXAMPLE
All traffic over HTTPS.
AUDIT What happened? Audit logs record who accessed or changed what, and when.
ACME EXAMPLE
Who read orders-eu last Tuesday.
Least privilege: give each person and each app only the role it needs, and nothing more.
Keeping it healthy
Three colours, one disk rule, four signals to watch.
GREEN All primaries and replicas are assigned.
YELLOW Data is safe, some replicas are missing. Fix soon.
RED A primary is missing. Some data is unavailable.
Disk fills first
0% 85% 90% 95%
● 85% low: no new shards placed on this node● 90% high: shards start moving away● 95% flood: indices on it become read-only
Heap pressure Memory for the JVM running out.
Search latency Queries getting slower over time.
Indexing rejections Writes refused because queues are full.
Unassigned shards Copies with no node to live on.
Quick check: GET _cluster/health . Trends and guided fixes: Stack Monitoring or AutoOps .
CHAPTER 6 OF 8
Cost
How do we keep it fast and affordable?
THE STORY · ACME SHOP
Logs grow by terabytes a week and the storage bill explodes, yet most of that data is rarely searched.
IN THIS CHAPTER
Age curve Data streams Tiers ILM Snapshots Shard sizing Back-of-envelope sizing
Why tiers? Data ages
Logs, orders, metrics: time changes how you use them.
today 1 week 1 month 3 months 1 year Data you hold How often it is searched Recent: searched all the time Old: most bytes, few searches Data piles up Logs and orders arrive every second. The volume only grows.
Use drops fast Last hour: searched constantly. Last year: rarely, mostly for audits.
So match cost to use Fast hardware for recent data, cheap storage for the rest.
STORY Age curve › Data stream › Tiers › ILM › Snapshots › Shard size
Logs go into a data stream
One name to write to. Behind it, a new index starts when the current one is full.
data stream: logs-app-prod
.ds-logs-app-000001
● write index
full · read-only
.ds-logs-app-000002
● write index
full · read-only
.ds-logs-app-000003
● write index
›
›
Rollover triggers: about 50 GB per primary shard, or 30 days (Elastic Cloud defaults). Shards never grow too big.
POST logs-app-prod/_doc # write: goes to the newest backing index
GET logs-app-prod/_search # read: searches all backing indices
STORY Age curve › Data stream › Tiers › ILM › Snapshots › Shard size
Four tiers: desk to warehouse
The older the data, the cheaper its home. Same cluster, same queries.
HOT On your desk
HOLDS
Today's data, still being written
ANSWERS
Milliseconds
COST PER GB
$$$$
WARM On the office shelf
HOLDS
Recent data, read-mostly
ANSWERS
Fast
COST PER GB
$$$$
COLD In the basement
HOLDS
Rarely searched. Snapshot-backed, no replicas needed
ANSWERS
Quick enough
COST PER GB
$$$$
FROZEN Off-site warehouse
HOLDS
Archive you can still query, on a tiny cache
ANSWERS
Seconds on first query
COST PER GB
$$$$
older data → slower, far cheaper per GB → same queries
Content tier: product catalogs and other data that is not time-based. It stays on fast storage and never moves.
STORY Age curve › Data stream › Tiers › ILM › Snapshots › Shard size
ILM: the automatic mover
Index Lifecycle Management is a policy. Watch one index travel through it. (Ages are an example.)
logs-app-000001
HOT Day 0
Write and search. Roll over at ~50 GB per shard or 30 days.
WARM Day 7
Read-only. Shrink and force-merge to save space.
COLD Day 30
Snapshot to object storage, mounted as a searchable snapshot.
FROZEN Day 90
Partially mounted. Only a small cache stays local.
DELETE Day 365
Removed automatically.
You write the policy once . ILM moves every index along it, automatically.
STORY Age curve › Data stream › Tiers › ILM › Snapshots › Shard size
Snapshots: your backup
Replicas survive a failed node. Snapshots survive everything else.
Cluster P0 P1 P2
Live data, with replicas for node failure.
→
Snapshot repository S3 · GCS · Azure Blob
snap-mon snap-tue snap-wed
Cheap, durable, outside the cluster.
Replicas are not backups. Delete an index and it vanishes from every copy at once.
Incremental After the first snapshot only new segments are copied.
SLM schedules them Snapshot lifecycle management: for example daily, keep 30.
Restore anywhere One index or everything, into the same or a different cluster.
The same repository also powers the cold and frozen tiers . Next slide.
STORY Age curve › Data stream › Tiers › ILM › Snapshots › Shard size
Cheap storage you can still search
Keep the durable copy in object storage. Query it in place.
Warm node data_warm
P0 R0
Primary and replica both on local disk.
Cold node data_cold
P0
Fully mounted: whole shard cached locally. No replica needed.
Frozen node data_frozen
Partially mounted: tiny shared cache. Only the bytes a query needs are fetched.
Snapshot repository · S3 · GCS · Azure Blob Cheap, durable, and it doubles as your backup.
Trade-off: resilience comes from the snapshot, not replicas. Frozen’s first query is slower , repeats hit the cache.
STORY Age curve › Data stream › Tiers › ILM › Snapshots › Shard size
The Goldilocks shard
Not too many, not too few. Size is the lever.
Oversharded Hundreds of tiny shards.
Heap per shard, a bloated cluster state, slow master.
Undersharded One giant shard.
1 TB
Slow recovery, no parallelism, one hot spot.
Just right 10 to 50 GB per shard.
30G 30G 30G
Fast recovery, parallel search, light master.
10–50 GB per shard, and under ~200M docs
≤ 1000 non-frozen shards per node (default limit)
1 GB heap on master nodes per ~3000 indices
Delete indices not documents. Delete-by-query is expensive.
Fix with: data streams + ILM rollover , then shrink, force-merge, reindex, or fewer indices that cover longer periods.
STORY Age curve › Data stream › Tiers › ILM › Snapshots › Shard size
Back-of-envelope sizing
Size on paper first. (Example numbers: your own data will differ.)
Four inputs Raw data per day 50 GB
Retention 30 days
Replicas 1
Expansion factor (measure it) × 1.1
Multiply 50 × 30 × (1 + 1) × 1.1= 3,300 GB ≈ 3.3 TB
Split and add headroom ● Hot, 7 days: 770 GB ● Warm, 23 days: 2,530 GB Plan for ≤ 75% disk used: about 4.4 TB of disk
Then: aim for 10 to 50 GB shards, choose node counts per tier, and test with realistic data before you commit.
CHAPTER 7 OF 8
Smart
How does it understand meaning?
THE STORY · ACME SHOP
Shoppers search “shoes for wet rocks”, not product codes. Operations wants odd behaviour spotted automatically.
IN THIS CHAPTER
Vector and semantic search ML nodes Three solutions
From matching words to understanding
Each rung adds a capability. You can stop at any of them.
KEYWORD BM25 on terms. Stemming, synonyms, fuzziness. Fast and precise.
VECTOR Text becomes embeddings; kNN finds nearest meaning. BBQ compresses vectors ~32x.
HYBRID Keyword + vector in one query. Ranks merged with RRF .
SEMANTIC semantic_text : map the field, embeddings are made for you.
RERANK + RAG Re-score the top hits, then give the best passages to an LLM.
PUT products/_mapping
{ "properties" : { "description" : { "type" : "semantic_text" } } }
retrievers: standard · knn · rrf · text_similarity_reranker
ML nodes: where the models run
Give the cluster a brain of its own: role ml .
ANOMALY DETECTION Learns normal for each series, flags the odd one out. No thresholds to tune.
TRAINED MODELS Inference at ingest or query time: ELSER , E5, rerankers, your own NLP models.
DATA FRAME ANALYTICS Outlier detection, classification, regression on your indices.
"waterproof trail shoes"
↓ model on ML node
[0.12, −0.88, 0.41, 0.07, …] or sparse tokens
Embeddings power vector and semantic search. Models load into RAM , so ML nodes are sized for memory.
Elastic Inference Service (EIS)
Managed inference for embeddings, reranking and chat. No ML nodes to run , no GPUs to buy.
Available on Elastic Cloud, and reachable from self-managed clusters through Cloud Connect.
Self-hosting models? Keep ML nodes off your data nodes and size for RAM.
One engine, three solutions
Everything so far is the foundation. Pick the job you need on top.
Search Site and app search, product catalogs, enterprise search, RAG and AI assistants.
hybrid · semantic_text · rerank · connectors
Observability Logs, metrics and traces in one place. Find the why, not just the what.
OTel · APM · SLOs · alerting · anomaly detection
Security SIEM, detections, threat hunting, endpoint protection, case management.
detection rules · Elastic Defend · cases
Elasticsearch: store · search · aggregate · ML · ES|QL
Kibana Elastic Agent · OTel Data tiers Cross-cluster Cloud · Serverless · self-managed
CHAPTER 8 OF 8
Global
How do we run it across regions?
THE STORY · ACME SHOP
Acme opens in Europe and Asia. Data must stay in region, yet leadership wants one view.
IN THIS CHAPTER
Many clusters Cross-cluster search Cross-cluster replication Where it runs
Real life has many clusters
One big cluster is rarely the answer. These pressures split things up.
eu-west Customer data that must stay in the EU.
P0 R0 P1
us-east US traffic, close to US users.
P0 R0 P1
on-prem Legacy systems you can’t move yet.
P0 R0 P1
Data residency Law keeps data in region.
Latency Data near its users.
Blast radius One failure stays local.
Ownership Teams and tenants isolated.
Hybrid On-prem plus cloud.
But the business still asks one question: “show me everything.”
One query, many clusters
Cross-cluster search (CCS) moves the question to the data. The data stays put.
hq · coordinating cluster Receives the query, merges the answers.
eu remote cluster alias eu
us remote cluster alias us
onprem remote cluster alias onprem
Connect: register each remote cluster. Secure it with cross-cluster API keys .
GET logs-*,eu:logs-*,us:logs-*/_search
Fewer round trips. By default each remote searches locally and returns one merged result.
Check first. _resolve/cluster tells you which remotes are reachable.
Works everywhere. Query DSL, ES|QL (eu:logs-* ), and Kibana.
Copy the data across: replication
Cross-cluster replication (CCR): a follower index pulls changes from a leader.
us-east LEADER
index orders · read + write
P0 P1
× outage
eu-west FOLLOWER
index orders-eu · read-only read + write
P0 P1
follower pulls changes
US region is down. The EU follower still has the data and keeps serving reads.
Promote it: unfollow, and the follower becomes a normal writable index. Auto-follow patterns do this for new data streams.
CCS · move the query Data stays where it is. One view across clusters. Best for global search and dashboards.
CCR · move the data A copy lives in another cluster. Best for disaster recovery and local reads.
Same engine, your choice of who runs it
The more to the right, the more of this deck becomes your job.
Elastic Cloud Serverless No nodes, shards or tiers to size. Storage and compute scale independently. Pay for what you use.
Elastic Cloud Hosted You pick hardware profiles, tiers and sizes. Autoscaling helps. Elastic handles provisioning, upgrades, snapshots.
ECK · ECE Run it on Kubernetes or your own hosts, with operator automation doing the heavy lifting.
Self-managed Install it yourself. Full control, full responsibility: nodes, upgrades, security, tiers.
Not sure? Start on Serverless or Cloud Hosted , and move the knobs you actually need.
Six mistakes seen in real clusters
Every one of these is cheap to avoid and expensive to fix later.
MISTAKE Oversharding
Hundreds of tiny shards eat heap and slow the master.
FIX
Aim for 10 to 50 GB shards. Rollover and ILM.
MISTAKE Mapping explosion
Dynamic mapping on arbitrary JSON creates thousands of fields (default limit 1,000).
FIX
Define mappings. Use flattened or strict.
MISTAKE No backups
Replicas are not backups: a delete hits every copy.
FIX
Snapshots, scheduled with SLM.
MISTAKE One giant index for logs
Cannot expire old data cheaply or keep shards small.
FIX
Data streams plus ILM.
MISTAKE Deep pagination
from + size beyond 10,000 is refused by default.
FIX
search_after with a point in time.
MISTAKE Leading wildcards
A query like *error scans every term.
FIX
Analyse text properly, or use the wildcard field type.
The whole picture
SOURCES
Agent · Fleet OTel Logstash Connectors REST / bulk
→
cluster: prod
ingest × 2
3 × master 3 zones
coord × 2
ml × 2 or EIS
data streams + ILM move indices → hot → warm → cold → frozen
Snapshot repository S3 · GCS · Azure Searchable snapshots for cold and frozen. Backups for everything.
⇄
REMOTE CLUSTERS
CCS moves the query.CCR moves the data.
ON TOP
Kibana Search Observability Security ES|QL everywhere
The big picture, completed
Eight questions, eight blocks. Everything in the Elastic Stack fits one of them.
1 What is it? An engine that finds documents fast using an inverted index.
2 How does it grow? Split into shards, copy as replicas, spread over many nodes.
3 How does data move? Agents and pipelines feed it; searches scatter, then gather.
4 How do people use it? Kibana: explore, build dashboards, set alerts.
5 Who does what? Roles, security and health keep a big cluster running.
6 How do we afford it? ILM moves data down tiers; snapshots make cold cheap.
7 How does it get smart? Vectors and ML for meaning, three solutions on one engine.
8 How do we go global? Many clusters, joined by CCS (move the query) and CCR (copy the data).
The one-line cheat sheet
When you hear the word, think the sentence.
Questions? Press D and draw your architecture on any slide.