MongoDB vs RDBMS like mysql

Nowadays there is a new kind of databases that is getting very popular, specially for Web development, including the PHP world, which are the NoSQL databases.

MongoDB is not only a key/value store, it’s quite a bit more. It’s definitely not a RDBMS either. I have MongoDB used it a little building some test app and it is a very cool piece of kit. It seems to be very performant with fault tolerance and auto-sharding (aka it will scale). I think Mongo might be the closest thing to a RDBMS replacement that I’ve seen so far since twenty years. It won’t work for all data sets and access patterns, but it’s built for your typical CRUD stuff. Storing what is essentially a huge hash, and being able to select on any of those keys, is what most people use a relational database for. If your DB is 3NF and you don’t do any joins (you’re just selecting a bunch of tables and putting all the objects together, AKA what most people do in a web app), MongoDB would probably be the best choice for you.

MongoDB is best suitable to store unstructured data. And this can organize your data into document format. These RDBMS altenatives called NoSQL data stores (MongoDB, CouchDB, Voldemort) are very useful for applications that scales massively and require faster data access from these big data stores.

And the implementation of these databases are simpler than the regular RDBMS. Since these are simple key-valued or document style binary objects directly serialized into disk. These data stores don’t enforce the ACID properties, and any schemas. This doesn’t provide any transaction abilities. So this can scale big and we can achieve faster access (both read and write).

But in contrast, RDBM enforces ACID and schemas on datas. If you wanted to work with structured data you can go ahead with RDBM.

Like Hierarchical database modelling, In mongoDB the lexical terms are :

Data Model Hierarchy of Mongo Database:

A Mongo system holds a set of databases (for e.g. databases in SQL Server)
A database holds a set of collections
A collection holds a set of documents (tables in SQL Server)
A document is a set of fields (for e.g. attributes in tables)
A field is a key-value pair
A key is a name (string)
A value is a basic type like string, integer, float, timestamp, binary or a document, or an array of values (for e.g. Datatype in SQL Server)

MongoDB treats with Json files which accomodates very well herarchical structure

db.bios.insert(
   {
      _id: 1,
      name: { first: 'John', last: 'Backus' },
      birth: new Date('Dec 03, 1924'),
      death: new Date('Mar 17, 2007'),
      contribs: [ 'Fortran', 'ALGOL', 'Backus-Naur Form', 'FP' ],
      awards: [
                {
                  award: 'W.W. McDowell Award',
                  year: 1967,
                  by: 'IEEE Computer Society'
                },
                {
                  award: 'National Medal of Science',
                  year: 1975,
                  by: 'National Science Foundation'
                },
                {
                  award: 'Turing Award',
                  year: 1977,
                  by: 'ACM'
                },
                {
                  award: 'Draper Prize',
                  year: 1993,
                  by: 'National Academy of Engineering'
                }
      ]
   }
)

 

What if you could store the programmatic models almost exactly like you model them ?

extradrmtech

Since 30 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions and medias protecting solutions. I am experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. Besides my work, I like to work freelance only on some wordpress projects because it is relaxing and delightful CMS for me. When not working, I like to dance salsa and swing and to have fun with my little family.

You may also like...