mongodb at lahacks :)
DESCRIPTION
I don't normally use slides... but when I do they're mirror images.TRANSCRIPT
Oh, Hi There LAHacksJ. Randall Hunt Developer Advocate at MongoDB
Who am I?• J. Randall Hunt
• @jrhunt
• github.com/ranman
• I'm a developer. I'm here to help.
Why change something that's been around for 40
years?
10TB
Data Human Kind Has Produced Until 1991
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
2 Kinds Of Data
NOSQL/NOREL
Relational Schema Design Focus on data storage
Document Schema Design Focus on data use
Nitty Gritty
RDBMS MongoDB Database � Database Table � Collection Row � Document Index � Index Join � Embedded Document Foreign Key � Reference
Documents?
{ "hello": "world" }
{ "_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" } !
CRUD
test> db.test.find() Fetched 0 record(s) in 1ms -- Index[none]
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() 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]
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]
Lots of Operators!
Build Something Awesome!
Thanks! @jrhunt