Click here to load reader

MongoDB et Elasticsearch, meilleurs ennemis ?

  • View
    923

  • Download
    0

Embed Size (px)

Text of MongoDB et Elasticsearch, meilleurs ennemis ?

  • MongoDB et Elasticsearch,

    meilleurs ennemis ?

  • 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 trs fiable ...

  • Dmarrage rapide

  • Developer friendly

  • Vers le Minimum Viable Product

  • Installation dun cluster Elasticsearch

    2 minutes

    cluster.name: my_cluster

    $ ./elasticsearch$ ./elasticsearch

    config/elasticsearch.yml

  • Installation dun 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(":27018")rs.add(":27019")

    mongo shell

    2 minutes + 30 sec

  • Dmarrer 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 INData 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

  • Agrgations

  • Les agrgations

  • MongoDB aggregation pipeline

    jsonjson

    json

    json

    $match $unwind $group

    $sum $avg $min $max

    $addToSet$year $month$week

    http://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sumhttp://docs.mongodb.org/manual/reference/operator/aggregation/sum/#grp._S_sum

  • Les agrgations dans Elasticsearch

    2015

    1974jsonjson

    jsonjson

    jsonjson

    2015

    batte sabre

    1974

    gun sabre

    2015

    sabre145.3

    1974

    gun2.4

    sabre0.34

    batte245.3

  • Stockage de fichiers

  • GridFS

  • Attachment Type

  • GridFS / Attachment Type

  • Pour stocker des fichiers...

  • Modle distribu

  • Modle distribu

  • Modle distribu

  • Write Consistency

  • Modle distribu

  • Sharding

  • CAP

  • Call me maybe : Kyle Kingsbury

    https://aphyr.com/tags/jepsen

    https://aphyr.com/tags/jepsenhttps://aphyr.com/tags/jepsen

  • Call me maybe - Elasticsearch

    http://bit.ly/1FWvOr2

  • Call me maybe - MongoDB

  • Performances

  • Benchmark

  • Benchmark

  • Benchmarks sucks !

  • Production

  • Allez, on passe en Prod !

  • Systmes vivants !

  • Ecosystme

  • Ecosystme MongoDB

  • Ecosystme MongoDB

  • Client Elastic

  • Ecosystme Elastic

  • Cloud

  • Alors, Mongo ou Elasticsearch ?

  • Alors ? MongoDB ou ElasticSearch ?

  • Les deux ?

  • Mme paradigme

  • Une solution

    write read

  • Mais ...

    write read

    ?

  • Teeing

    write read

    write

  • Batch Maison

    write read

  • Message Queue

    write read

    read write

    Write

    Push

  • Rle de lIndexer

  • Dnormaliser

  • Exemple (sans Parent Child)

    Tweets

    Users

    Tweets

  • Exemple update

    Tweets

    Users

    Tweets

  • Prcalculer

  • Exemple pr-calcul : nbTweets

    Tweets

    Users

    Tweets

  • Exemple pr-calcul

    Tweets

    Users

    Tweets

  • Pour conclure

  • Conclusion

  • Conclusion

  • Storage Mashup ;-)

  • Merci !

  • Drink & Food Time

Search related