5 причин, по которым mongodb является ведущей nosql СУБД, henrik...

43
5 Reasons that made MongoDB the Leading NoSQL Database Henrik Ingo Solutions Architect, MongoDB

Upload: ontico

Post on 21-Jun-2015

956 views

Category:

Internet


2 download

DESCRIPTION

Доклад Хенрика Инго на HighLoad++ 2014.

TRANSCRIPT

Page 1: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

5 Reasons that made MongoDB

the Leading NoSQL Database

Henrik Ingo

Solutions Architect, MongoDB

Page 2: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

2

Hi, I am Henrik Ingo

@h_ingo

Page 3: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

5 Reasons that made MongoDB

the Leading NoSQL Database

Henrik Ingo

Solutions Architect, MongoDB

Page 4: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

4

1. Open Source

2. Replication

3. Sharding

4. Schemaless

5. Cloud, Big Data...

5 MongoDB features that are

NOT reasons to choose MongoDB

Page 5: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

5

1. Open Source

2. Replication

3. Sharding

4. Schemaless

5. Cloud, Big Data...

Reasons to move FROM relational TO NoSQL

...all NoSQL Databases do this.

Page 6: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

Ok, so what ARE the

Top 5 reasons to choose MongoDB?

Page 7: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

1. General purpose

Page 8: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

8

1. General Purpose Database

Big Data Product & Asset

Catalogs

Security &

Fraud

Internet of

Things

Database-as-a-

Service

Mobile

Apps

Customer Data

Management

Data

Hub

Social &

Collaboration

Content

Management

Intelligence Agencies

Top Investment and Retail Banks

Top US Retailer

Top Global Shipping Company

Top Industrial Equipment Manufacturer

Top Media Company

Top Investment and Retail Banks

Page 9: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

9

5 NoSQL categories

Key Value Wide Column Document

Graph Map Reduce

Redis, Riak Cassandra

Neo4j Hadoop

Page 10: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

10

MongoDB is a Document Database

MongoDBRich Queries

• Find Paul’s cars

• Find everybody in London with a car

built between 1970 and 1980

Geospatial• Find all of the car owners within 5km of

Trafalgar Sq.

Text Search• Find all the cars described as having

leather seats

Aggregation• Calculate the average value of Paul’s

car collection

Map Reduce

• What is the ownership pattern of colors

by geography over time? (is purple

trending up in China?)

{

first_name: ‘Paul’,

surname: ‘Miller’,

city: ‘London’,

location:

[45.123,47.232],

cars: [

{ model: ‘Bentley’,

year: 1973,

value: 100000, … },

{ model: ‘Rolls Royce’,

year: 1965,

value: 330000, … }

}

}

Page 11: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

11

Most popular NoSQL database

Page 12: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

12

Most popular NoSQL database

Document

Wide

ColumnWide

Column

KV

KVGraph DocumentKV KV

Page 13: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

13

Hadoop

Document

Right tool for the right job

Column

KV

Graph

Page 14: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

14

Hadoop

Right tool for the right job

RDBMS .

Document

Column

KV

Graph

Page 15: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

15

Operational Database Landscape

Page 16: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

2. Agile

Page 17: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

17

Ease of use

Paul Downey (17419636)

Easy to use

Page 18: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

18

Integrated single binary

Chalon Handmade (6206864791)

Integrated single binary

Page 19: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

19

Replication & sharding

Replication & Sharding

Daniel Oines (7390222182)

Page 21: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

21

Schemaless iterative development

Page 22: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

22

{

first_name: ‘Paul’,

surname: ‘Miller’,

city: ‘London’,

location:

[45.123,47.232],

cars: [

{ model: ‘Bentley’,

year: 1973,

value: 100000, … },

{ model: ‘Rolls Royce’,

year: 1965,

value: 330000, … }

}

}

Flexible Schema

Page 23: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

23

Rich query language = less code

MongoDBRich Queries

• Find Paul’s cars

• Find everybody in London with a car

built between 1970 and 1980

Geospatial• Find all of the car owners within 5km of

Trafalgar Sq.

Text Search• Find all the cars described as having

leather seats

Aggregation• Calculate the average value of Paul’s

car collection

Map Reduce

• What is the ownership pattern of colors

by geography over time? (is purple

trending up in China?)

{

first_name: ‘Paul’,

surname: ‘Miller’,

city: ‘London’,

location:

[45.123,47.232],

cars: [

{ model: ‘Bentley’,

year: 1973,

value: 100000, … },

{ model: ‘Rolls Royce’,

year: 1965,

value: 330000, … }

}

}

Page 24: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

24

Query language = JSON & JavaScript

db.collection.find( { "firstname" : "Henrik" } )

Page 25: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

25

Real life agility

Customer Project RDBMS MongoDB

360O customer view

$22M

2 years

Failed

Minimal

90 days

In production

Subscriber database

20 tables

35 joins

login = 5 joins

high latencies

15 months

20 persons

5 collections

2 queries

login = 1 query

10x faster

4 months

10 persons

eCommerce analyticsprototyped only

perf challenges

prototype in 1 week

good perf

http://www.mongodb.com/lp/whitepaper/quantifying-business-advantage

Page 26: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

3. JSON & JavaScript

Page 27: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

27

MEAN stack

Express.js

Page 28: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

28

MEAN stack

Express.js

JSON

JSON

Page 29: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

29

JavaScript

JVM stack

JVM

RDBMS

JDBC Spring, Morphia

JSON

Tomcat, Jetty, Play, Spring...

JSON

Page 30: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

4. Aggregation Framework

Page 31: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

31

OpenStreetMap data as JSON

db.collection.find( { "firstname" : "Henrik" } )

{ "_id" : 98684990,"addr:housenumber" : "4","website" : "http://www.ravintolapohjanpoika.fi/","amenity" : "pub","addr:city" : "Helsinki","addr:postcode" : "00770","location" : {

"type" : "Point","coordinates" : [

25.0760622,60.261145

]},"addr:street" : "Jakomäenkuja","addr:country" : "FI","name" : "Pohjanpoika"

}

http://rosslawley.co.uk/posts/the-most-popular-pub-name/

Page 32: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

32

OpenStreetMap data as JSON

db.collection.find( { "firstname" : "Henrik" } )

db.pubs.aggregate( [ { $match : { "addr:city" : { $in :

[ "Helsinki", "Turku", "Tampere" ] } } },{ $group : { "_id" : "$addr:city", "count" : { "$sum" : 1 } } },{ $sort : { "count" : -1 } }

] )

{ "_id" : "Helsinki", "count" : 150 }{ "_id" : "Tampere", "count" : 53 }{ "_id" : "Turku", "count" : 23 }

Page 33: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

33

Big Data warning: data may be dirty

db.collection.find( { "firstname" : "Henrik" } )

db.pubs.find( { "addr:city" : { $exists : false } } ).count()

2291

db.pubs.find( { "addr:city" : { $exists : true } } ).count()

701

Page 34: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

34

Sharding is a first class citizen

db.collection.find( { "firstname" : "Henrik" } )

{ $match : ... }{ $group : ... }{ $sort : ... }

DB DB DB

Query Router

Page 35: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

35

Sharding is a first class citizen

db.collection.find( { "firstname" : "Henrik" } )

{ results }

{ $match : ... }{ $group : ... }{ $sort : ... }

{ $match : ... }{ $group : ... }{ $sort : ... }

{ $match : ... }{ $group : ... }{ $sort : ... }

{ $group : ... }{ $sort : ... }

Page 36: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

5. Ecosystem

Page 37: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

37

7,000,000+ MongoDB Downloads

150,000+ Online Education Registrants

35,000+ MongoDB Management Service (MMS) Users

30,000+ MongoDB User Group Members

20,000+ MongoDB Days Attendees

Global Community

Page 38: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

38

MongoDB Partners (500)

Software & Services

Cloud & Channel Hardware

Page 39: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

39

MongoDB Inc

350+ employees 1,000+ customers

Over $231 million in funding13 offices around the world

Page 40: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

Summary

Page 41: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

41

1. Open Source

2. Replication

3. Sharding

4. Schemaless

5. Agile, Cloud, Big Data...

5 MongoDB features that are

NOT reasons to choose MongoDB

Page 42: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)

42

1. General purpose

2. Agile

3. JSON & JavaScript

4. Aggregation framework

5. Ecosystem

Top 5 reasons to choose MongoDB

Page 43: 5 причин, по которым MongoDB является ведущей NoSQL СУБД, Henrik Ingo (MongoDB)