Upload
francescapasha
View
1.053
Download
0
Embed Size (px)
DESCRIPTION
A look into the distinctions between MongoDB and RDBMS by Nuri Halperin.
Citation preview
RDBMS / MongoDB
Nuri HalperinFeb 2012
[{'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();
> 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
> 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
> 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
> 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
> 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
> 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
> 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
> 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
Aggregation++Full text indexGeo++ I love quartely releases..
Looking forward to