mongodb at lahacks :)

37
Oh, Hi There LAHacks J. Randall Hunt Developer Advocate at MongoDB

Upload: randall-hunt

Post on 25-May-2015

226 views

Category:

Technology


1 download

DESCRIPTION

I don't normally use slides... but when I do they're mirror images.

TRANSCRIPT

Page 1: MongoDB at LAHacks :)

Oh, Hi There LAHacksJ. Randall Hunt Developer Advocate at MongoDB

Page 2: MongoDB at LAHacks :)
Page 3: MongoDB at LAHacks :)

Who am I?• J. Randall Hunt

• @jrhunt

• github.com/ranman

[email protected]

• I'm a developer. I'm here to help.

Page 4: MongoDB at LAHacks :)
Page 5: MongoDB at LAHacks :)
Page 6: MongoDB at LAHacks :)
Page 7: MongoDB at LAHacks :)
Page 8: MongoDB at LAHacks :)

Why change something that's been around for 40

years?

Page 9: MongoDB at LAHacks :)

10TB

Data Human Kind Has Produced Until 1991

Page 10: MongoDB at LAHacks :)

Data Mankind Produces Every Day Since 2001

10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB

10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB

10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB

10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB

10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB 10TB

Page 11: MongoDB at LAHacks :)

2 Kinds Of Data

Page 12: MongoDB at LAHacks :)

NOSQL/NOREL

Page 13: MongoDB at LAHacks :)

Relational Schema Design Focus on data storage

Page 14: MongoDB at LAHacks :)

Document Schema Design Focus on data use

Page 15: MongoDB at LAHacks :)
Page 16: MongoDB at LAHacks :)
Page 17: MongoDB at LAHacks :)
Page 18: MongoDB at LAHacks :)

Nitty Gritty

Page 19: MongoDB at LAHacks :)

RDBMS MongoDB Database � Database Table � Collection Row � Document Index � Index Join � Embedded Document Foreign Key � Reference

Page 20: MongoDB at LAHacks :)
Page 21: MongoDB at LAHacks :)

Documents?

Page 22: MongoDB at LAHacks :)

{ "hello": "world" }

Page 23: MongoDB at LAHacks :)

{ "_id": ObjectId("51638f8332e9bc556fe86de7"), "dstats": [ { "+": "5", "-": "0", "f": "gitstreamer.py" }, { "+": "3", "-": "3", "f": "post-commit.py" } ], "author": "ranman", "ts": ISODate("2013-04-08T19:48:11-0400"), "project": "gitstreamer", "msg": "turning this into a webapp" } !

Page 24: MongoDB at LAHacks :)
Page 25: MongoDB at LAHacks :)

CRUD

Page 26: MongoDB at LAHacks :)
Page 27: MongoDB at LAHacks :)

test> db.test.find() Fetched 0 record(s) in 1ms -- Index[none]

Page 28: MongoDB at LAHacks :)

test> db.test.find() Fetched 0 record(s) in 1ms -- Index[none]test> db.test.insert({'hello': 'world'}) Inserted 1 record(s) in 1ms Insert WriteResult({ "ok": 1, "n": 1 })

Page 29: MongoDB at LAHacks :)

test> db.test.find() Fetched 0 record(s) in 1ms -- Index[none]test> db.test.insert({'hello': 'world'}) Inserted 1 record(s) in 1ms Insert WriteResult({ "ok": 1, "n": 1 }) test> db.test.find({'hello': 'world'}) { "_id": ObjectId("52d61af21486ef9e06d6d41a"), "hello": "world" } Fetched 1 record(s) in 0ms -- Index[none]

Page 30: MongoDB at LAHacks :)

test> db.test.update({'hello': 'world'}, {$set: {'hello': 'welt'}}) Updated 1 existing record(s) in 0ms Update WriteResult({ "ok": 1, "n": 1 })

test> db.test.find() Fetched 0 record(s) in 1ms -- Index[none]test> db.test.insert({'hello': 'world'}) Inserted 1 record(s) in 1ms Insert WriteResult({ "ok": 1, "n": 1 }) test> db.test.find({'hello': 'world'}) { "_id": ObjectId("52d61af21486ef9e06d6d41a"), "hello": "world" } Fetched 1 record(s) in 0ms -- Index[none]

Page 31: MongoDB at LAHacks :)
Page 32: MongoDB at LAHacks :)

Lots of Operators!

Page 33: MongoDB at LAHacks :)
Page 34: MongoDB at LAHacks :)
Page 35: MongoDB at LAHacks :)
Page 36: MongoDB at LAHacks :)

Build Something Awesome!

Page 37: MongoDB at LAHacks :)

Thanks! @jrhunt