Interview :: mongoDB
What do you understand by NoSQL databases? Is MongoDB a NoSQL database? explain?
At the present time, the internet is loaded with big data, big users, big complexity etc. and also becoming more complex day by day. NoSQL is answer of all these problems, It is not a traditional database management system, not even a relational database management system (RDBMS). NoSQL stands for "Not Only SQL". NoSQL is a type of database that can handle and sort all type of unstructured, messy and complicated data. It is just a new way to think about the database.
Yes. MongoDB is a NoSQL database.
MonggoDB provides official driver support for C, C++, C#, Java, Node.js, Perl, PHP, Python, Ruby, Scala, Go and Erlang.
You can use MongoDB with any of the above languages. There are some other community supported drivers too but the above mentioned ones are officially provided by MongoDB.
NoSQL database can be classified as 4 basic types:
- Key value store NoSQL database
- Document store NoSQL database
- Column store NoSQL database
- Graph base NoSQL databse
There are many NoSQL databases. MongoDB, Cassandra, CouchBD, Hypertable, Redis, Riak, Neo4j, HBASE, Couchbase, MemcacheDB, Voldemort, RevenDB etc. are the examples of NoSQL databases.
MongoDB is better than other SQL databases because it allows a highly flexible and scalable document structure.
For example:
- One data document in MongoDB can have five columns and the other one in the same collection can have ten columns.
- MongoDB database are faster than SQL databases due to efficient indexing and storage techniques.
MongoDB is a document oriented DBMS
Although MongoDB and MySQL both are free and open source databases, there is a lot of difference between them in the term of data representation, relationship, transaction, querying data, schema design and definition, performance speed, normalization and many more. To compare MySQL with MongoDB is like a comparison between Relational and Non-relational databases.
Why MongoDB is known as best NoSQL database?
MongoDb is the best NoSQL database because, it is:
Document Oriented
Rich Query language
High Performance
Highly Available
Easily Scalable
No. By Default, MongoDB doesn't support primary key-foreign key relationship.
We can achieve primary key-foreign key relationship by embedding one document inside another. For example: An address document can be embedded inside customer document.
No. There is no need a lot of RAM to run MongoDB. It can be run even on a small amount of RAM because it dynamically allocates and de-allocates RAM according to the requirement of the processes.