Más contenido relacionado La actualidad más candente (18) Similar a MongoDB and RDBMS (20) Más de francescapasha (7) MongoDB and RDBMS1. RDBMS /
MongoDB
Nuri Halperin
Feb 2012
2. >outline();
[
{'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'}
]
3. >layerisms
> 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.
6. >schema
> 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.
7. >index
> 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
8. >update
> 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
9. >transaction
> 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.
10. >security
> 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