Slide 1

Slide 1 text

Technical Evangelist, MongoDB
 @tgrall Tugdual Grall @EspritJUG Some cool features of MongoDB

Slide 2

Slide 2 text

@tgrall [email protected] Agenda • Analytics • Full Text Search • Geospatial

Slide 3

Slide 3 text

Real Time Analytics

Slide 4

Slide 4 text

@tgrall [email protected] State • We're storing our data in MongoDB • We need to do ad-hoc reporting, grouping, common aggregations, etc. • What are we using for this?

Slide 5

Slide 5 text

@tgrall [email protected] Data Warehousing

Slide 6

Slide 6 text

@tgrall [email protected] Data Warehousing • SQL for reporting and analytics • Infrastructure complications • Additional maintenance • Data duplication • ETL processes • Real time?

Slide 7

Slide 7 text

@tgrall [email protected] Aggregation Framework

Slide 8

Slide 8 text

@tgrall [email protected] Aggregation Framework • Declared in JSON, executes in C++ • Flexible, functional, and simple • Operation pipeline • Computational expressions • Plays nice with sharding

Slide 9

Slide 9 text

@tgrall [email protected] Pipeline • Process a stream of documents • Original input is a collection • Final output is a result document • Series of operators • Filter or transform data • Input/output chain

Slide 10

Slide 10 text

Slide 11

Slide 11 text

Slide 12

Slide 12 text

Search…

Slide 13

Slide 13 text

@tgrall [email protected] I want all the “tweets” about “xxx”

Slide 14

Slide 14 text

Slide 15

Slide 15 text

@tgrall [email protected] MongoDB Full Text Search • Turnkey search for apps • Lowest cost • Simplest ops • Multi Language Support

Slide 16

Slide 16 text

GeoSpatial

Slide 17

Slide 17 text

@tgrall [email protected] • Store Geographical Informations • … and query them! GeoSpatial

Slide 18

Slide 18 text

@tgrall [email protected] How do you store information? http://geojson.org/

Slide 19

Slide 19 text

@tgrall [email protected] Point {! ! "loc" : ! ! ! {! ! ! ! "type" : "Point",! ! ! ! "coordinates" : [1.4528388, 43.5956005] ! ! ! }! }

Slide 20

Slide 20 text

@tgrall [email protected] LineString {! ! "loc" : ! ! ! {! ! ! ! "type" : "LineString",! ! ! ! "coordinates" : [ [1.4528388, 43.5956005], 
 ! ! ! ! ! ! ! [1.3996881, 43.5976828] ] ! ! ! }! }

Slide 21

Slide 21 text

@tgrall [email protected] Polygon {"loc" : ! ! ! { "type" : "Polygon",! ! ! ! "coordinates" : [! [1.4528388, 43.5956005],! ! ! ! ! ! ! ! ! [1.3996881, 43.5976828],! ! ! ! ! ! ! ! ! [1.4001065, 43.6364262],! ! ! ! ! ! ! ! ! [1.4518624, 43.6324835],
 ! ! ! ! ! ! ! ![1.4528388, 43.5956005] ] ! ! ! }! }

Slide 22

Slide 22 text

@tgrall [email protected] Query the data?

Slide 23

Slide 23 text

Slide 24

Slide 24 text

@tgrall [email protected] Near a point db.points.find( { "loc" :{$near : {$geometry : { type : "Point", coordinates : [1.4528388, 43.5956005] }, $maxDistance : 500

Slide 25

Slide 25 text

@tgrall [email protected] Query : “in” the polygon db.points.find(! ! { "loc" :{!! ! ! ! $geoIntersects : {! ! ! ! ! $geometry : ! ! ! ! ! {type : "Point", ! ! ! ! ! coordinates:[1.443934, 43.604446]}! ! ! ! }! ! ! }! ! });

Slide 26

Slide 26 text

@tgrall [email protected] Query : all points in a Polygon db.points.find(! { "loc" :{ $geoWithin : ! ! ! {$geometry :! ! ! ! { "type" : "Polygon",! ! ! ! ! "coordinates" : [[! ! ! ! ! [1.4528388, 43.5956005],[1.3996881, 43.5976828],! ! ! ! ! [1.4001065, 43.6364262],[1.4518624, 43.6324835],! ! ! ! ! [1.4528388, 43.5956005]]] ! ! ! ! }}}});

Slide 27

Slide 27 text

Questions?

Slide 28

Slide 28 text

#ConferenceHashtag Thank You