an introduction to mongodb by césar trigo #openexpoday 2014

29
César Trigo Esteban Backend Development Director Twitter: @CesarTrigoEs www.mongodbspain.com Twitter: @MongoDBSpain An Introduction to

Upload: openexpoes

Post on 24-Jan-2015

47 views

Category:

Technology


2 download

DESCRIPTION

An introduction to MongoDB by César Trigo #OpenExpoDay 2014

TRANSCRIPT

Page 1: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

César Trigo EstebanBackend Development DirectorTwitter: @CesarTrigoEs

www.mongodbspain.comTwitter: @MongoDBSpain

An Introduction to

Page 2: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

1 What is MongoDBOVERVIEW

World Wide leading NoSQL Databasethat allows companies to be more agile and scalable

1. Improving the customer experience

2. Allowing schemes to change quickly to adapt easily to changes

3. Enabling Big-Data

4. Accelerating time to market

5. Reducing costs

Page 3: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

2 What is MongoDBWHO IS USING MONGODB

More at: www.mongodb.com/customers

Page 4: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

3 What is MongoDBCOMMUNITY

7Million +Downloads

200k +Education Registrations

30k +MongoDB User Group Members

Fastest-growing community in Big Data

Page 5: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

4 What is MongoDBDEFINITION

MongoDB is a ...

… database

❖ Open source

❖ Document oriented

❖ Non-relational & Schema-less

❖ Scalable

❖ High performance

❖ Full featured

Page 6: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

4 What is MongoDBDEFINITION

MongoDB is a ...

… database

❖ Open source

❖ Document oriented

❖ Non-relational & Schema-less

❖ Scalable

❖ High performance

❖ Full featured

Page 7: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesOPEN SOURCE

Source and supported drivers are open source and hosted at Github:

https://github.com/mongodb

Supported drivers for most programming languages

4.1

Page 8: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

What is MongoDBDEFINITION

MongoDB is a ...

… database

❖ Open source

❖ Document oriented

❖ Non-relational & Schema-less

❖ High performance

❖ Scalable

❖ Full featured

5

Page 9: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

5.1 MongoDB Main FeaturesDOCUMENT ORIENTED

● JSON-like format (BSON) documents as independent units

● Makes it easier to distribute data across multiple servers

● Natural object mapping due to JSON Objects

databasedatabase

collectiontable

documentrow

SQL Term MongoDB Term

SQL to MongoDB

fieldcolumn

embedding & linkingjoin

Page 10: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

What is MongoDBDEFINITION

MongoDB is a ...

… database

❖ Open source

❖ Document oriented

❖ Non-relational & Schema-less

❖ Scalable

❖ High performance

❖ Full featured

6

Page 11: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesNON-RELATIONAL & SCHEMA-LESS

User Hobbies

Addresses

Relational Databases (RDBMS) Data Model

6.1

Page 12: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesNON-RELATIONAL & SCHEMA-LESS

User

Hobbies

Addresses

With MongoDB we can store related content in

the same document

Non-Relational Data Model

6.2

Page 13: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesNON-RELATIONAL & SCHEMA-LESS

User Info- name - creation- nick - ...- age

Hobbies

Addresses

db.user.findOne();{

_id: objectId("535c56cbdf1790f4e1c80074"),name: "César Trigo",nick: "CesarTrigo",age: 25,creation: ISODate("2014-04-27T01:00:59.448Z"),hobbies: ["coding", "football", "basket"],address:[{

street: "Calle Serrano",number: 127,city: "Madrid"

},{

street: "Avenida Diagonal",city: "Barcelona"

}],}

coding basket

address address

MongoDB Document

6.3

football

Page 14: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesNON-RELATIONAL & SCHEMA-LESS

User Info- name - creation- nick - ...- age

Hobbies

Addresses

db.user.findOne();{

_id: objectId("535c56cbdf1790f4e1c80074"),name: "César Trigo",nick: "CesarTrigo",age: 25,creation: ISODate("2014-04-27T01:00:59.448Z"),hobbies: ["coding", "football", "basket"],address:[{

street: "Calle Serrano",number: 127,city: "Madrid"

},{

street: "Avenida Diagonal",city: "Barcelona"

}],}

coding basket

address address

MongoDB Document

6.3

football

Page 15: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesNON-RELATIONAL & SCHEMA-LESS

User Info- name - creation- nick - ...- age

Hobbies

Addresses

db.user.findOne();{

_id: objectId("535c56cbdf1790f4e1c80074"),name: "César Trigo",nick: "CesarTrigo",age: 25,creation: ISODate("2014-04-27T01:00:59.448Z"),hobbies: ["coding", "football", "basketball"],address:[{

street: "Calle Serrano",number: 127,city: "Madrid"

},{

street: "Avenida Diagonal",city: "Barcelona"

}],}

coding footbal basket

address address

MongoDB Document

6.3

Page 16: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

What is MongoDBDEFINITION

MongoDB is a ...

… database

❖ Open source

❖ Document oriented

❖ Non-relational & Schema-less

❖ Scalable

❖ High performance

❖ Full featured

7

Page 17: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesSCALABLE

Replication: provides redundancy and high data availability

Primary

Secondary

Secondary

DRIVER

APP

write

readAsynchronousReplication

● Automated replication and failover

● Multi-datacenter support

● Data durability and consistency

7.1

Page 18: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesSCALABLE

Sharding: Storing data records across multiple machines to meeting the demands of data growth

Shard 1 Shard 2 Shard 3 Shard N

● Increase capacity as you grow reducing the amount of data that each server needs to store

● Reduces the number of operations each shard handles

● Automatic balancing of data

...

7.2

Page 19: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesSCALABLE INFRASTRUCTURE

Application

Driver

Query Router Query Router

Primary

Secondary

Secondary

Primary

Secondary

Secondary

Primary

Secondary

Secondary

Primary

Secondary

Secondary

Shard 1 Shard 2 Shard 3 Shard N

...

...

7.3

Page 20: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

What is MongoDBDEFINITION

MongoDB is a ...

… database

❖ Open source

❖ Document oriented

❖ Non-relational & Schema-less

❖ Scalable

❖ High performance

❖ Full featured

8

Page 21: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesHIGH PERFORMANCE

vs

Better data locality In-memory caching Atomic operations

8.1

Relational MongoDB

Page 22: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesHIGH PERFORMANCE

Driver

Secondary

Secondary

Write Concern: customizable write concerns for Replica Sets

Primary

write

replicate

replicate

respo

nse

apply

apply

Write operation to a replica set

Write to the primary and at least one secondary

8.2

Page 23: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

What is MongoDBDEFINITION

MongoDB is a ...

… database

❖ Open source

❖ Document oriented

❖ Non-relational & Schema-less

❖ Scalable

❖ High performance

❖ Full featured

9

Page 24: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

● Geospatial indexes to support geographic data structures

● GeoJSON support

● 2d support for Flat / Euclidean plane distance calculation

MongoDB Main FeaturesFULL FEATURED

Geospatial features

9.2

Page 25: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

A solution for the real Worldbecause the Earth is not flat!

2d Sphere Indexes: provides spherical geometry support for Earth-like sphere

distance calculation

MongoDB Main FeaturesFULL FEATURED9.2

Page 26: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesFULL FEATURED9.3

Page 27: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesFULL FEATURED

Real time Aggregation: Aggregations are operations that process data records and return computed results

9.3

Aggregation Pipelines

The pipeline provides efficient data aggregation using native operations within MongoDB

Map-Reduce

Uses custom JavaScript functions to perform the map and reduce operations, as well as the optional finalize operation.

Page 28: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

MongoDB Main FeaturesFULL FEATURED

MongoDB Management Service

● Server status monitoring

● Custom, metric-based alerting

● Fully managed backups

● Activity and logging viewers

● Automation coming soon

9.4

Page 29: An introduction to MongoDB by César Trigo #OpenExpoDay 2014

[email protected]@CesarTrigoEs

@MongoDBSpain

MongoDB Spain www.mongodbspain.com

www.gigigo.com

César Trigo EstebanBackend Development Director