11
RDBMS / MongoDB Nuri Halperin Feb 2012

MongoDB and RDBMS

Embed Size (px)

DESCRIPTION

A look into the distinctions between MongoDB and RDBMS by Nuri Halperin.

Citation preview

Page 1: MongoDB and RDBMS

RDBMS / MongoDB

Nuri HalperinFeb 2012

Page 2: MongoDB and RDBMS

[{'layerisms': 'where is your app?'},{'engine': 'notes about engine'},{'dataStructure': 'internals data structures'},{'schema': 'less and more'},{'index': 'type and applicability'},{'update': 'semantics and mechanics'},{'transaction': 'dread no more'},{'security': 'just a touch'}

]

>outline();

Page 3: MongoDB and RDBMS

> db.rdbms.find({_id:'layerisms'});{ "_id" : "layerisms", "tiers" : [ "App", "Service", "DB" ], "dblogic" : { "exists" : true } } > db.mongo.find({_id:'layerisms'});{ "_id" : "layerisms", "tiers" : [ "App", "Service", "DB" ], "dblogic" : { "exists" : false } } // practice: let your service layer do the logic.

>layerisms

Page 4: MongoDB and RDBMS

> db.rdbms.find({_id:'engine'});{ "_id" : "engine", "language" : [ "C++", "C", "Other?" ] } > db.mongo.find({_id:'engine'});{ "_id" : "engine", "language" : "C++" } // hardly the issue. // performance due to other factors

>engine

Page 5: MongoDB and RDBMS

> db.rdbms.find({_id:'dataStructure'});{ "_id" : "dataStructure", "type" : [ "BTree", "Hashset", "bitmap" ] } > db.mongo.find({_id:'dataStructure'});{ "_id" : "dataStructure", "type" : "BTree" } // MongoDB has very low memory mgmt overhead. Most RDBMS do more memory mgmg

>dataStructure

Page 6: MongoDB and RDBMS

> db.rdbms.find({_id:'schema'});{ "_id" : "schema", "_" : { "schama" : true, "tables" : true, "udt" : true, "types" : [ "sql types", "native" ], "namespace" : true } } > db.mongo.find({_id:'schema'});{ "_id" : "schema", "_" : { "schema" : false, "tables" : false, "udt" : false, "types" : [ "BSON" ], "namespace" : true } } // Most significant. This is why dev loves NoSql.// Good drivers alleviate need for ORM.

>schema

Page 7: MongoDB and RDBMS

> db.rdbms.find({_id:'index'});{ "_id" : "index", "pk" : "auto", "ak" : true, "subObject" : false, "fulltext" : "*", "array" : false } > db.mongo.find({_id:'index'});{ "_id" : "index", "pk" : "auto", "ak" : true, "subObject" : true, "fulltext" : false* , "array" : true } // fulltext = think lucene, not regex.// may be coming to MongoDB

>index

Page 8: MongoDB and RDBMS

> db.rdbms.find({_id:'update'});{ "_id" : "update", "multirecord" : true, "singlerecord" : true, "atomic" : "*", "fluent" : true, "crosstable" : true } > db.mongo.find({_id:'update'});{ "_id" : "update", "multirecord" : true, "singlerecord" : true, "atomic" : "*", "fluent" : true, "crosstable" : false } // the existance of cross-table cross-record locks is a major source of RDBMS slowness

>update

Page 9: MongoDB and RDBMS

> db.rdbms.find({_id:'transaction'});{ "_id" : "transaction", "crossRecord" : true, "optimistic" : true, "pessimistic" : true } > db.mongo.find({_id:'transaction'});{ "_id" : "transaction", "crossRecord" : false, "optimistic" : "dev", "pessimistic" : false } // RDBMS let you choose consistency model.// MongoDB supports optimistic model with update syntax.

>transaction

Page 10: MongoDB and RDBMS

> db.rdbms.find({_id:'security'});{ "_id" : "security", "transport" : true, "identity" : true, "objectLevel" : true } > db.mongo.find({_id:'security'});{ "_id" : "security", "transport" : false, "identity" : true, "objectLevel" : false } // RDBMS offer schema level security.// MongoDB has no schema: r, rw

>security

Page 11: MongoDB and RDBMS

Aggregation++Full text indexGeo++ I love quartely releases..

Looking forward to