devoxx 2014 : atelier mongodb - decouverte de mongodb 2.6

23
@dwursteisen | @karesti | @tgrall # DevoxxMongoDB {“Developpeur” : “Découvre Mongo” } @dwursteisen : David (SOAT) @karesti : Katia (Freelance) @tgrall : Tug (MongoDB)

Upload: tugdual-grall

Post on 11-Nov-2014

465 views

Category:

Technology


1 download

DESCRIPTION

Atelier MongoDB délivré durant Devoxx France 2014. Application disponible ici: https://github.com/dwursteisen/atelier-mongodb-devoxx

TRANSCRIPT

Page 1: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

{“Developpeur” : “Découvre Mongo”}

@dwursteisen : David (SOAT) @karesti : Katia (Freelance) @tgrall : Tug (MongoDB)

Page 2: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Hand’s On Lab

•Introduction

•MongoDB : Kesako?

•L’atelier • Contenu

• Code

• Application

•A vous de jouer!

Page 3: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

{“about” : “us”}Katia Aresti •@karesti

•Freelance

David Wursteisen •@dwursteisen

•So@t

Tugdual Grall •@tgrall

•MongoDB

Page 4: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

MongoDB

Document Database Open-SourceGeneral Purpose

Page 5: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

MongoDB

•Document : JSON / Flexibilité

•Open Source : tout est sur GitHub

•Written in C++

•Sérialisation en BSON : efficacité / tapage

•Montée en charge horizontale : Sharding

•Haute Disponibilité : Réplication

Page 6: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

De nombreux drivers

Page 7: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Cet Atelier

Mongo Shell Java Code/App

Page 8: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

VocabulaireRDBMS MongoDB

Table, View ➜ Collection

Row ➜ Document

Index ➜ Index

Join ➜ Embedded Document

Foreign Key ➜ Reference

Partition ➜ Shard

Page 9: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Document?

Modèle Relationnel Modèle Document

Page 10: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

{ "title" : "Hello World", "body" : "This is my first blog post", "date" : ISODate("2014-03-20T00:00:00Z"), "author" : {"id" : “jdoe","name" : "John Doe"}, "tags" : [ “adventure”, "mongodb" ], "comments" : [ { "date" : ISODate("2013-03-22T00:00:00Z"), "by" : { "id" : "csmith", "name" : "Charles Smith" }, "text" : "this is the comment" } ] }

Document

Page 11: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Ce que nous allons voir

•Installation

•CRUD

•Recherche Full Text

•Requêtes Geospatiales

•Aggregation Framework

Page 12: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Ce que nous ne verrons pas

•Haute Disponibilité / Réplication

•Sharding

•Administration

• Management/Monitoring

• Sauvegarde/Restauration

•Sécurité

Page 13: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

MongoDB Architecture

Page 14: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

MMS : MongoDB Management Service

Page 15: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Etape 1 : Atelier

•Copier le contenu de la clé sur votre disque

•Ouvrir: • /devoxx-2014/tutorial.html

•Suivre les étapes de l’atelier !

!

•Note: toutes les sources sont disponibles sur GitHub •https://github.com/dwursteisen/atelier-mongodb-devoxx

Page 16: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Etape 2 : Installation

$ tar -xvf mongodb-osx-x86_64-2.6.0.tgz!$ cd mongodb-osx-x86_64-2.6.0/bin!$ mkdir –p /data/db!$ ./mongod

Page 17: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Etape 2 : Tester

:~ $ mongo!MongoDB shell version: 2.6.0!connecting to: test!> db.test.insert({text: 'Welcome to MongoDB'})!> db.test.find().pretty()!{!! "_id" : ObjectId("51c34130fbd5d7261b4cdb55"),!! "text" : "Welcome to MongoDB"!}

Page 18: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Etape 3: Découvrir et Coder

•Suivre l’atelier

•Créer des Services REST

•Les Consommer dans une application

Page 19: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@YourTwitterHandle@dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Demo

Page 20: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@YourTwitterHandle#DVXFR14{session hashtag} @dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Compr

endr

e

Comprendre ce qu’est MongoDB…

Page 21: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@YourTwitterHandle#DVXFR14{session hashtag} @dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Appre

ndre

Apprendre à utiliser MongoDB

Page 22: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@YourTwitterHandle#DVXFR14{session hashtag} @dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Deploy

er

Deployer MongoDB chez vous!!!

Page 23: Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6

@YourTwitterHandle#DVXFR14{session hashtag} @dwursteisen | @karesti | @tgrall #DevoxxMongoDB

Q & A