SlideShare une entreprise Scribd logo
MongoDB et
Elasticsearch,
meilleurs ennemis ?
<Nous />
<Serli />
Petit sondage ...
MongoDB
Elasticsearch
Projets types Mongo et Elasticsearch
Beaucoup de points communs
Mongo ou Elasticsearch ?
Comment choisir ?
Popularité ?
db-engines.com
db-engines.com
db-engines.com
Pas très fiable ...
Démarrage
rapide
Developer friendly
Vers le Minimum Viable Product
Installation d’un cluster Elasticsearch
2 minutes
cluster.name: my_cluster
$ ./elasticsearch
$ ./elasticsearch
config/elasticsearch.yml
Installation d’un replicaset Mongo
$ mongod --dbpath=~/mongo-data/0 --replSet rs0
$ mongod --dbpath=~/mongo-data/1 --replSet rs0 --port 27018
$ mongod --dbpath=~/mongo-data/2 --replSet rs0 --port 27019
rs.initiate()
rs.add("<hostname>:27018")
rs.add("<hostname>:27019")
mongo shell
2 minutes + 30 sec
Démarrer un noeud Elasticsearch en
Java
Settings settings = Settings. builder()
.put("http.port", "9200")
.put("network.host" , "localhost")
.put("path.home", "/tmp/es-unit-tests" )
.put("path.data", "/tmp/es-unit-tests-data" )
.build();
Node node = NodeBuilder. nodeBuilder()
.local( true)
.data(true)
.clusterName( "elasticsearch-unit-tests" )
.settings(settings)
.build();
node.start();
Data IN
Data OUT
MongoDB
MongoDB
Index dans MongoDB
Storage Engines (Mongo > 3.0)
Ecriture dans Elasticsearch
Near real-time ?
Index Inversé
⇒
Terme Documents
brian #1
sens #2
vie #2 #1
Mise à jour dans Elastic
Relations
Disclaimer
Relations dans MongoDB
⇒
Relations dans MongoDB
⇒
Relations dans Elasticsearch
Full Text Search
Je veu fair du fotbal
MongoDB Full Text Search
Full Text Search
Agrégations
Les agrégations
MongoDB aggregation pipeline
json
json
json
json
$match $unwind $group
$sum $avg $min $max
$addToSet$year $month$week
Les agrégations dans Elasticsearch
2015
1974json
json
json
json
json
json
2015
batte sabre
1974
gun sabre
2015
sabre
145.3
1974
gun
2.4
sabre
0.34
batte
245.3
Stockage de
fichiers
GridFS
Attachment Type
GridFS / Attachment Type
Pour stocker des fichiers...
Modèle
distribué
Modèle distribué
⇒
Modèle distribué
Write Consistency
Modèle distribué
⇒
Sharding
CAP
⇒
Call me maybe : Kyle Kingsbury
https://aphyr.com/tags/jepsen
Call me maybe - Elasticsearch
Call me maybe - MongoDB
Performances
Benchmark
Benchmark
Benchmarks sucks !
Production
Allez, on passe en Prod !
Systèmes vivants !
Ecosystème
Ecosystème MongoDB
Ecosystème MongoDB
Client Elastic
Ecosystème Elastic
Cloud
Alors, Mongo ou
Elasticsearch ?
Alors ? MongoDB ou ElasticSearch ?
Les deux ?
Même paradigme
Une solution
write read
Mais ...
write read
?
Teeing
write read
write
Batch Maison
write read
Message Queue
write read
read write
Write
Push
Rôle de l’Indexer
Dénormaliser
Exemple (sans Parent Child)
Tweets
Users
Tweets
Exemple update
Tweets
Users
Tweets
Précalculer
Exemple pré-calcul : nbTweets
Tweets
Users
Tweets
Exemple pré-calcul
Tweets
Users
Tweets
Pour conclure
Conclusion
Conclusion
Storage Mashup ;-)
Merci !
Drink & Food Time

Contenu connexe

PDF
BigData_Chp3: Data Processing
PDF
Chapitre1 introduction
PDF
Thinking Big - Big data: principes et architecture
PDF
Introduction aux bases de données NoSQL
PDF
BigData_TP2: Design Patterns dans Hadoop
PDF
BigData_TP3 : Spark
PPTX
Les Base de Données NOSQL
PPTX
02 big data definition
BigData_Chp3: Data Processing
Chapitre1 introduction
Thinking Big - Big data: principes et architecture
Introduction aux bases de données NoSQL
BigData_TP2: Design Patterns dans Hadoop
BigData_TP3 : Spark
Les Base de Données NOSQL
02 big data definition

Tendances (20)

PDF
Cours Big Data Part I
PDF
BigData_TP1: Initiation à Hadoop et Map-Reduce
PDF
BigData_TP5 : Neo4J
PDF
BigData_TP4 : Cassandra
PPTX
Quand utiliser MongoDB … Et quand vous en passer…
PDF
BigData_Chp4: NOSQL
PDF
Chapitre 2 hadoop
PDF
PDF
BigData_Chp5: Putting it all together
PDF
Cours Big Data Chap1
PDF
Chapitre 3 spark
PDF
Resume de BI
PDF
BigData_Chp1: Introduction à la Big Data
PDF
Bases de Données non relationnelles, NoSQL (Introduction) 1er cours
PPTX
Chp2 - Les Entrepôts de Données
PDF
Base de données graphe, Noe4j concepts et mise en oeuvre
PDF
Power Bi, le tour complet 2017
PDF
MongoDB Fundamentals
PDF
Cours Big Data Chap2
PDF
Technologies pour le Big Data
Cours Big Data Part I
BigData_TP1: Initiation à Hadoop et Map-Reduce
BigData_TP5 : Neo4J
BigData_TP4 : Cassandra
Quand utiliser MongoDB … Et quand vous en passer…
BigData_Chp4: NOSQL
Chapitre 2 hadoop
BigData_Chp5: Putting it all together
Cours Big Data Chap1
Chapitre 3 spark
Resume de BI
BigData_Chp1: Introduction à la Big Data
Bases de Données non relationnelles, NoSQL (Introduction) 1er cours
Chp2 - Les Entrepôts de Données
Base de données graphe, Noe4j concepts et mise en oeuvre
Power Bi, le tour complet 2017
MongoDB Fundamentals
Cours Big Data Chap2
Technologies pour le Big Data
Publicité

En vedette (12)

PPTX
Splunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDB
PPT
Comparação de desempenho entre SQL e NoSQL
PDF
Business Track: Building a Private Cloud to Empower the Business at Goldman ...
PPT
Making Pretty Charts in Splunk
PDF
Unified IT Monitoring: Beautiful Dashboards vs. Deep Reporting - What’s More ...
PDF
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
PPT
The Reference Model for an Open Archival Information System (OAIS)
PPTX
Real-Time Analytics Visualized w/ Kafka + Streamliner + MemSQL + ZoomData, An...
PPTX
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
PDF
The Enterprise Service Bus is Dead! Long live the Enterprise Service Bus, Rim...
PDF
[Breizhcamp 2015] MongoDB et Elastic, meilleurs ennemis ?
PPT
API Management architect presentation
Splunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDB
Comparação de desempenho entre SQL e NoSQL
Business Track: Building a Private Cloud to Empower the Business at Goldman ...
Making Pretty Charts in Splunk
Unified IT Monitoring: Beautiful Dashboards vs. Deep Reporting - What’s More ...
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
The Reference Model for an Open Archival Information System (OAIS)
Real-Time Analytics Visualized w/ Kafka + Streamliner + MemSQL + ZoomData, An...
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
The Enterprise Service Bus is Dead! Long live the Enterprise Service Bus, Rim...
[Breizhcamp 2015] MongoDB et Elastic, meilleurs ennemis ?
API Management architect presentation
Publicité

Plus de Sébastien Prunier (11)

PDF
De votre idée géniale à votre Minimum Viable Product - Café Techno Niort ...
PDF
De votre idée géniale à votre Minimum Viable Product - Rencontres National...
PDF
[Breizhcamp 2015] Refactoring avec 1,22% de code couvert par les tests ... Go...
PDF
MongoDB Aggregation Framework in action !
PDF
Refactoring avec 1,22% de code couvert par les tests ... Golden Master testin...
PDF
Nantes JUG - Les News - 2013-10-10
PDF
JugSummerCamp 2013 - Un backend NoSQL pour Geektic avec MongoDB
PDF
Poitou Charentes JUG - Traçabilité dans une architecture distribuée avec Node...
PPTX
Nantes JUG - Traçabilité dans une architecture distribuée avec Node.js et Mon...
PPTX
Add BPM to your business applications with Bonita Open Solution - JugSummerCa...
PPTX
Nantes Jug - Java 7
De votre idée géniale à votre Minimum Viable Product - Café Techno Niort ...
De votre idée géniale à votre Minimum Viable Product - Rencontres National...
[Breizhcamp 2015] Refactoring avec 1,22% de code couvert par les tests ... Go...
MongoDB Aggregation Framework in action !
Refactoring avec 1,22% de code couvert par les tests ... Golden Master testin...
Nantes JUG - Les News - 2013-10-10
JugSummerCamp 2013 - Un backend NoSQL pour Geektic avec MongoDB
Poitou Charentes JUG - Traçabilité dans une architecture distribuée avec Node...
Nantes JUG - Traçabilité dans une architecture distribuée avec Node.js et Mon...
Add BPM to your business applications with Bonita Open Solution - JugSummerCa...
Nantes Jug - Java 7

Dernier (7)

PDF
FORMATION COMPLETE EN EXCEL DONE BY MR. NYONGA BRICE.pdf
PPTX
Presentation_Securite_Reseaux_Bac+2.pptx
PDF
Modems expliqués- votre passerelle vers Internet.pdf
PDF
Tendances tech 2025 - SFEIR & WENVISION.pdf
PPTX
Souveraineté numérique - Définition et enjeux pour les entreprises et les dév...
PDF
presentation_with_intro_compressee IEEE EPS France
PDF
FORMATION EN Programmation En Langage C.pdf
FORMATION COMPLETE EN EXCEL DONE BY MR. NYONGA BRICE.pdf
Presentation_Securite_Reseaux_Bac+2.pptx
Modems expliqués- votre passerelle vers Internet.pdf
Tendances tech 2025 - SFEIR & WENVISION.pdf
Souveraineté numérique - Définition et enjeux pour les entreprises et les dév...
presentation_with_intro_compressee IEEE EPS France
FORMATION EN Programmation En Langage C.pdf

MongoDB et Elasticsearch, meilleurs ennemis ?