Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Elasticsearch
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Matheus Moraes
June 14, 2019
Technology
0
160
Elasticsearch
Matheus Moraes
June 14, 2019
Tweet
Share
More Decks by Matheus Moraes
See All by Matheus Moraes
Nova Era de Políticas no Kubernetes: Explorando Abordagens Nativas de Policy Enforcement
matheusfm
0
58
Kubernetes Operator with Go
matheusfm
0
170
Observability before and after Service Mesh
matheusfm
0
110
Incorpore a Supernanny para seus microservices e entenda o que andam aprontando em produção
matheusfm
0
340
Other Decks in Technology
See All in Technology
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1.3k
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
200
Agile Leadership Summit Keynote 2026
m_seki
1
560
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
1
160
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
170
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
100
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
200
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
460
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.1k
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
3
1k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Being A Developer After 40
akosma
91
590k
How GitHub (no longer) Works
holman
316
140k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
270
New Earth Scene 8
popppiees
1
1.5k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
49
What's in a price? How to price your products and services
michaelherold
247
13k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Music & Morning Musume
bryan
47
7.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Agile that works and the tools we love
rasmusluckow
331
21k
Transcript
Buscas poderosas em BILHÕES de documentos? Seu sistema pode prover
isso de forma escalável e resiliente com o Elasticsearch Matheus de Faria Moraes
Agenda ▰ What is Elasticsearch; ▰ Use Cases; ▰ Basic
Concepts; ▰ Document and Index; ▰ Cluster and Nodes; ▰ Primary Shards and Replica Shards; ▰ Near Real Time (NRT); ▰ Demo.
whoami I am Matheus Moraes Developer and Speaker @Sensedia Java,
NoSQL and Microservices enthusiast
What is Elasticsearch?
What is Elasticsearch? ▰ Full-text search and analytics engine; ▰
Highly scalable; ▰ Open-source; ▰ Store, search, and analyze big volumes of data in near real time; ▰ REST APIs; ▰ Good documentation; ▰ Apache Lucene.
Use Cases
2 billion documents 8 million code repositories 4 million active
users ~ 300 search / minute
None
Basic Concepts
Document and Index curl -X PUT localhost:9200/cities/_doc/1 \ -H 'Content-Type:
application/json' \ -d '{ "city": "Tanabi", "state": "SP", "country": "BR", "population": 25000 }'
CLUSTER NODE 1 ★ NODE 2 NODE 3 Cluster and
Nodes
CLUSTER NODE 1 ★ NODE 2 NODE 3 P0 P1
Primary Shards
Primary Shard Benefits ▰ Elasticity ▰ Horizontal Scaling
CLUSTER NODE 1 ★ NODE 2 NODE 3 P0 R0
R1 R1 R0 P1 Replica Shards 2/2
CLUSTER NODE 1 ★ NODE 2 NODE 3 P0 R0
R1 R1 R0 P1 A A A B B B Cluster, Nodes and Shards 2/2
CLUSTER NODE 1 ★ NODE 2 NODE 3 P0 R0
R1 R1 R0 P1 A A A B B B Cluster, Nodes and Shards 2/2
Replica Shard Benefits ▰ H.A. ▰ Resilience ▰ Search Throughput
Topologies ▰ Default 7.0 1 / 1 ▰ Old Default
5 / 1 ▰ Search performance 1 / 10 ▰ Index performance 20 / 1
Index creation with shards curl -X PUT localhost:9200/cities \ -H
'Content-Type: application/json' \ -d '{ "settings": { "number_of_shards": 2, "number_of_replicas": 1 } }'
Searchable and Persistent Documents
curl -X PUT localhost:9200/cities/_doc/1 \ -H 'Content-Type: application/json' \ -d
'{ "city": "Tanabi", "state": "SP", "country": "BR", "population": 25000 }' && \ curl -X GET localhost:9200/cities/_search?pretty&q=name:Tanabi N R T
Search by segment (Lucene) Searchable Commit Point
Lucene commits are expensive ▰ fsync ▰ Disk Searchable Commit
Point
In-memory buffer and Translog
1. Documents are indexed In-memory buffer Searchable Commit Point {
} { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } Translog
2. Refresh In-memory buffer Searchable Commit Point { } {
} { } { } { } { } { } { } Translog
3. The translog keeps accumulating documents In-memory buffer Searchable Commit
Point { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } { } Translog { } { } { } { } { } { } { } { } { }
4. Flush (Lucene commit) In-memory buffer Searchable Commit Point Translog
Big picture CLUSTER NODE 1 ★ P0 R1 NODE 3
R0 R1 NODE 2 P1 R0 Searchable Commit Point { }{ }{ } In-memory buffer Translog { }{ }{ }{ }{ }{ }
Refresh interval curl -X PUT localhost:9200/cities/_settings \ -H 'Content-Type: application/json'
\ -d '{ "index" : { "refresh_interval" : "3s" } }'
?refresh (Index, Update, Delete, and Bulk) ▰ Empty or true
▰ wait_for ▰ false (default) POST cities/_refresh Refresh
Demo matheusfm/elasticsearch-demo
Thank you! matheusfm matheusfm mfariam