Mongo DB - Document Database

Rédigé par Sozezzo - - Aucun commentaire

The big thing is … Mongo BD is NOT RDBMS!

In OOP are not tables and rows, objects use polymorphism, inheritance, and it is not uniform. Use objects with RDBMS can be hard.

Mongo DB has no schema to define, no tables and no relationships between collections of objects. Each document can be flat, simple, or complex as we wish. There are no locks of tables, or columns.

Durability vs Consistency

Durability is about whether your data was persisted to durable media before control was returned to you. Eventual consistency in a replica set has to do with whether a document was written to all of the servers, to the primaries and secondaries before control was returned to your application.

· You can ready for inconsistency. Can your application run with? Can it be an issue?

· The application takes control of schema enforcement.

We can backup and restore of Mongo, to import and export information, to monitor the Mongo server, and to share it. You can scale MongoDB horizontally with a replication.

 

What is BSON ? Store byte arrays on disk..

The BSON specifications can be found on bsonspec.org. Basically, BSON is elementary data types into memory into C data types then to read and to write is fast. BSON specification is data storage serialization format with memory mapped files.
BSON documents has length prefixing. It is fast to find particular a field into store arbitrary object structures and not require to adhere to a particular schema, and this is the key of MongoDB.

Index is important in MongoDb, you must be sure the index is useful and with the correct name of column.

Where and When do you use MobgoDB?

  • No transaction at all.
  • Not a lot of updates, less 1% of database.
  • Geo-distributed database;
  • Use for CMS, Logs, Dataware, etc.

Les commentaires sont fermés.