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
Les BD NoSQL
PPTX
Base de données NoSQL
PDF
Cours Big Data Chap5
PPTX
Basics of MongoDB
PPT
Introduction to MongoDB
ODP
Introduction to MongoDB
PDF
Modélisation de données pour MongoDB
PPTX
Mongo db intro.pptx
Les BD NoSQL
Base de données NoSQL
Cours Big Data Chap5
Basics of MongoDB
Introduction to MongoDB
Introduction to MongoDB
Modélisation de données pour MongoDB
Mongo db intro.pptx

Tendances (20)

PPTX
Les modèles NoSQL
PPTX
introduction à MongoDB
PDF
Cours Big Data Chap3
PPTX
Mongodb basics and architecture
PDF
BigData_Chp4: NOSQL
PDF
BigData_TP5 : Neo4J
PPTX
NoSQL databases - An introduction
PDF
Cours HBase et Base de Données Orientées Colonnes (HBase, Column Oriented Dat...
PDF
BigData_Chp1: Introduction à la Big Data
PPT
Content Storage With Apache Jackrabbit
PDF
MongoDB Fundamentals
PDF
Maven et industrialisation du logiciel
PDF
TP1 Big Data - MapReduce
PDF
Introduction aux bases de données NoSQL
PPT
Introduction to mongodb
PDF
Cours Big Data Chap2
PPTX
Introduction to NoSQL
PDF
Action Jackson! Effective JSON processing in Spring Boot Applications
PDF
alphorm.com - Formation Oracle Database 11g DBA 1 (1Z0-052)
Les modèles NoSQL
introduction à MongoDB
Cours Big Data Chap3
Mongodb basics and architecture
BigData_Chp4: NOSQL
BigData_TP5 : Neo4J
NoSQL databases - An introduction
Cours HBase et Base de Données Orientées Colonnes (HBase, Column Oriented Dat...
BigData_Chp1: Introduction à la Big Data
Content Storage With Apache Jackrabbit
MongoDB Fundamentals
Maven et industrialisation du logiciel
TP1 Big Data - MapReduce
Introduction aux bases de données NoSQL
Introduction to mongodb
Cours Big Data Chap2
Introduction to NoSQL
Action Jackson! Effective JSON processing in Spring Boot Applications
alphorm.com - Formation Oracle Database 11g DBA 1 (1Z0-052)
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é

Similaire à MongoDB et Elasticsearch, meilleurs ennemis ? (20)

PDF
PPTX
Réussir une montée en charge avec MongoDB
PDF
Présentation mongoDB et mongoId
PDF
Tout ce que le getting started MongoDB ne vous dira pas
PDF
Tout ce que le getting started mongo db ne vous dira pas
ODP
Ruby et MongoDB dans la pratique, MongoFR
PDF
Mesurer la performance dans le milieu hostile du développement Java
PDF
PDF
Installation Et Configuration De Nutch
PDF
Installation Et Configuration De Monkey Spider
PPTX
JBoss clustering et tuning (lab 3/3)
PDF
Confoo 2022 - le cycle d'une instance MySQL
PDF
Pgbackrest meetup
PDF
SQL Debug avec Django @ PyConFr 2015
PPTX
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01
PDF
Sec day cuckoo_workshop
PDF
Meetup CMS Rubedo 12 décembre 2013
PDF
Guide (un tout petit peu) pratique (et totalement subjectif) du stream proces...
PDF
Breizhcamp : Guide de survie du développeur dans une application (Java) qui rame
PPTX
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01-rev.
Réussir une montée en charge avec MongoDB
Présentation mongoDB et mongoId
Tout ce que le getting started MongoDB ne vous dira pas
Tout ce que le getting started mongo db ne vous dira pas
Ruby et MongoDB dans la pratique, MongoFR
Mesurer la performance dans le milieu hostile du développement Java
Installation Et Configuration De Nutch
Installation Et Configuration De Monkey Spider
JBoss clustering et tuning (lab 3/3)
Confoo 2022 - le cycle d'une instance MySQL
Pgbackrest meetup
SQL Debug avec Django @ PyConFr 2015
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01
Sec day cuckoo_workshop
Meetup CMS Rubedo 12 décembre 2013
Guide (un tout petit peu) pratique (et totalement subjectif) du stream proces...
Breizhcamp : Guide de survie du développeur dans une application (Java) qui rame
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01-rev.

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

MongoDB et Elasticsearch, meilleurs ennemis ?