some cool features of mongodb

Post on 12-May-2015

299 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Some cool features of MongoDB : Geospatial, Full Text Search, Aggregation Framework. Presentation delivered May 2014 at the ESPRIT JUG Day 2014, Tunis

TRANSCRIPT

Technical Evangelist, MongoDB@tgrall

Tugdual Grall

@EspritJUG

Some cool features of MongoDB

@tgralltug@mongodb.com

Agenda

• Analytics

• Full Text Search

• Geospatial

Real Time Analytics

@tgralltug@mongodb.com

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?

@tgralltug@mongodb.com

Data Warehousing

@tgralltug@mongodb.com

Data Warehousing

• SQL for reporting and analytics

• Infrastructure complications

• Additional maintenance

• Data duplication

• ETL processes

• Real time?

@tgralltug@mongodb.com

Aggregation Framework

@tgralltug@mongodb.com

Aggregation Framework

• Declared in JSON, executes in C++

• Flexible, functional, and simple

• Operation pipeline

• Computational expressions

• Plays nice with sharding

@tgralltug@mongodb.com

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

@tgralltug@mongodb.com

@tgralltug@mongodb.com

Search…

@tgralltug@mongodb.com

I want all the “tweets” about “xxx”

@tgralltug@mongodb.com

@tgralltug@mongodb.com

MongoDB Full Text Search

• Turnkey search for apps

• Lowest cost

• Simplest ops

• Multi Language Support

GeoSpatial

@tgralltug@mongodb.com

• Store Geographical Informations

• … and query them!

GeoSpatial

@tgralltug@mongodb.com

How do you store information?

http://geojson.org/

@tgralltug@mongodb.com

Point

{!! "loc" : !! ! {!! ! ! "type" : "Point",!! ! ! "coordinates" : [1.4528388, 43.5956005] !! ! }!}

@tgralltug@mongodb.com

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

@tgralltug@mongodb.com

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] ] !! ! }!}

@tgralltug@mongodb.com

Query the data?

@tgralltug@mongodb.com

@tgralltug@mongodb.com

Near a pointdb.points.find(

{ "loc" :{$near : {$geometry : { type : "Point", coordinates : [1.4528388, 43.5956005] }, $maxDistance : 500

@tgralltug@mongodb.com

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

@tgralltug@mongodb.com

Query : all points in a Polygondb.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]]] !! ! ! }}}});

Questions?

#ConferenceHashtag

Thank You

top related