open-source, high-performance, document-oriented database - - PowerPoint PPT Presentation

open source high performance document oriented database
SMART_READER_LITE
LIVE PREVIEW

open-source, high-performance, document-oriented database - - PowerPoint PPT Presentation

open-source, high-performance, document-oriented database Non-relational Operational Stores (NoSQL) New Gen. OLAP RDBMS (vertica, aster, greenplum) (Oracle, MySQL) NoSQL Really Means:


slide-1
SLIDE 1
  • pen-­‑source, ¡high-­‑performance, ¡

document-­‑oriented ¡database

slide-2
SLIDE 2

RDBMS

(Oracle, ¡MySQL)

New Gen. OLAP

(vertica, ¡aster, ¡greenplum)

Non-relational Operational Stores

(“NoSQL”)

slide-3
SLIDE 3

non-­‑relational, ¡next-­‑generation ¡

  • perational ¡datastores ¡and ¡databases

NoSQL Really Means:

slide-4
SLIDE 4

Horizontally Scalable Architectures

no ¡joins no ¡complex ¡transactions

+

slide-5
SLIDE 5

New Data Models

no ¡joins no ¡complex ¡transactions

+

slide-6
SLIDE 6

New Data Models

improved ¡ways ¡to ¡develop ¡applications?

slide-7
SLIDE 7

Data Models

Key ¡/ ¡Value

memcached, ¡Dynamo

Tabular

BigTable

Document ¡Oriented

MongoDB, ¡CouchDB, ¡JSON ¡stores

slide-8
SLIDE 8

depth ¡of ¡functionality scalability ¡& ¡performance

  • memcached
  • key/value
  • RDBMS
slide-9
SLIDE 9

JSON-style Documents

{“hello”: ¡“world”} \x16\x00\x00\x00\x02hello \x00\x06\x00\x00\x00world \x00\x00

http://bsonspec.org

represented ¡as ¡BSON

slide-10
SLIDE 10

Flexible “Schemas”

{“author”: ¡“mike”, ¡“text”: ¡“...”} {“author”: ¡“eliot”, ¡“text”: ¡“...”, ¡“tags”: ¡[“mongodb”]}

slide-11
SLIDE 11

Dynamic Queries

slide-12
SLIDE 12

Atomic Update Modifiers

slide-13
SLIDE 13

Focus on Performance

slide-14
SLIDE 14

Replication

master slave slave slave master slave master slave master master slave master

slide-15
SLIDE 15

Auto-sharding

client mongos ... mongos

mongod mongod mongod mongod mongod mongod

... Shards

mongod mongod mongod Config Servers

slide-16
SLIDE 16

Many Supported Platforms / Languages

slide-17
SLIDE 17

Best Use Cases

The ¡Web

Caching T Scaling ¡Out High ¡Volume

slide-18
SLIDE 18

Less Good At

highly ¡transactional ad-­‑hoc ¡business ¡intelligence problems ¡that ¡require ¡SQL

slide-19
SLIDE 19

A Quick Aside

special ¡key present ¡in ¡all ¡documents unique ¡across ¡a ¡Collection any ¡type ¡you ¡want

_id

slide-20
SLIDE 20

Post

{author: ¡“mike”, ¡date: ¡new ¡Date(), ¡text: ¡“my ¡blog ¡post...”, ¡tags: ¡[“mongodb”, ¡“intro”]}

slide-21
SLIDE 21

Comment

{author: ¡“eliot”, ¡date: ¡new ¡Date(), ¡text: ¡“great ¡post!”}

slide-22
SLIDE 22

New Post

post ¡= ¡{author: ¡“mike”,

¡ ¡date: ¡new ¡Date(), ¡ ¡text: ¡“my ¡blog ¡post...”, ¡ ¡tags: ¡[“mongodb”, ¡“intro”]}

db.posts.save(post)

slide-23
SLIDE 23

Embedding a Comment

c ¡= ¡{author: ¡“eliot”,

¡ ¡date: ¡new ¡Date(), ¡ ¡text: ¡“great ¡post!”}

db.posts.update({_id: ¡post._id}, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡{$push: ¡{comments: ¡c}})

slide-24
SLIDE 24

Posts by Author

db.posts.find({author: ¡“mike”})

slide-25
SLIDE 25

Last 10 Posts

db.posts.find() ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡.sort({date: ¡-­‑1}) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡.limit(10)

slide-26
SLIDE 26

Posts Since April 1

april_1 ¡= ¡new ¡Date(2010, ¡3, ¡1) db.posts.find({date: ¡{$gt: ¡april_1}})

slide-27
SLIDE 27

Posts Ending With ‘Tech’

db.posts.find({text: ¡/Tech$/})

slide-28
SLIDE 28

Posts With a Tag

db.posts.find({tags: ¡“mongodb”})

...and Fast

db.posts.ensureIndex({tags: ¡1})

(multi-­‑key ¡indexes)

slide-29
SLIDE 29

Indexing / Querying

  • n Embedded Docs

db.posts.ensureIndex({“comments.author”: ¡1}) db.posts.find({“comments.author”: ¡“eliot”})

(dot ¡notation)

slide-30
SLIDE 30

Counting Posts

db.posts.count() db.posts.find({author: ¡“mike”}).count()

slide-31
SLIDE 31

Basic Paging

page ¡= ¡2 page_size ¡= ¡15 db.posts.find().limit(page_size) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡.skip(page ¡* ¡page_size)

slide-32
SLIDE 32

Migration: Adding Titles

post ¡= ¡{author: ¡“mike”, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡date: ¡new ¡Date(), ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡text: ¡“another ¡blog ¡post...”, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡tags: ¡[“mongodb”], ¡ ¡ ¡ ¡ ¡ ¡ ¡title: ¡“MongoDB ¡for ¡Fun ¡and ¡Profit”} post_id ¡= ¡db.posts.save(post)

(just ¡start ¡adding ¡them)

slide-33
SLIDE 33

$gt, ¡$lt, ¡$gte, ¡$lte, ¡$ne, ¡$all, ¡$in, ¡$nin

db.posts.find({$where: ¡“this.author ¡== ¡‘mike’ ¡|| ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡this.title ¡== ¡‘foo’”})

Advanced Queries

slide-34
SLIDE 34

Other Cool Stuff

aggregation ¡and ¡map/reduce capped ¡collections unique ¡indexes mongo ¡shell GridFS geo

slide-35
SLIDE 35

Download MongoDB

http://www.mongodb.org

and ¡let ¡us ¡know ¡what ¡you ¡think @mdirolf ¡ ¡ ¡ ¡@mongodb slides ¡will ¡be ¡up ¡on ¡http://dirolf.com