With the expansion in the use of Handheld gadgets, the measure of information being created is expanded exponentially. With the expansion in information age, comes the issue of information stockpiling and scaling. Designers of Backend programming improvement organizations everywhere throughout the world are confronting a trouble in putting away this vast measure of information. Since the customary databases can’t adapt up to the expanding information stockpiling prerequisites they are presently left with two principle alternatives, for example Either to Scale-up or Scale-out. Scale-up essentially implies purchasing a Bigger machine which can possibly store vast measure of information and scaling-out is part of information crosswise over different machines. Be that as it may, because of Heavy expenses of these greater machines, Scaling-up should be possible just up as far as possible. Thus, there is presently a dire need to go for scale-out alternative for our databases and this is the place MongoDB comes into Picture.
Before Diving profound into the nuts and bolts of MongoDB, Fair comprehension of NoSQL database is Paramount. NoSQL which essentially means ‘not just SQL’ is a Non-Relational Database. It Encompasses wide assortment of information models. They are commonly utilized for working with huge arrangements of Distributed information. NoSQL are significantly utilized in an application as where the need of versatility and execution exceeds the requirement for information consistency.
Commonly used Terms in MongoDB
_id – Every MongoDB report contains this an exceptional Value and is produced as a matter of course alongside the formation of Document. It resembles an essential key of the Document
Accumulation Collection alludes to the gathering of MongoDB archives. It is equal to the table in social Database.
Report Record in MongoDB Collection is Known as Document. It is Row comparable in RDBMS which contains Field names and Values.
Field-Name-esteem pair in the archive is called as Field. It is like Columns in RDBMS.
Example of Field with Key value pair
|CustomerID : 11|
Cursor- Pointer to the collection of documents returned is called cursor in MongoDB.
Advantages and Features of MongoDB
Document Oriented- Data is stored in a documents instead of relational schema.This makes it more flexible and adaptable to real time business requirements.
Ad hoc queries- Specific fields from the documents can be retrieved using the queries. Searching by field, regular expressions and range queries is possible with MongoDB.
Indexing- Any field in a MongoDB document can be indexed which in turn improves the performance of search in MongoDB.
Replication- MongoDB maintains two sets of replica primary and secondary, which ensures high availability. replica contains one or more instances of mongoDB.
Load balancing- In MongoDB concept of sharding to scale horizontally by splitting data across multiple MongoDB instances. Since MongoDB can run over multiple servers, balancing the load or data duplication can be achieved. This helps to keep the system up and running in case of hardware failure.
Node.js utilizes nonconcurrent programming. For example, while asking for a record, it will send the assignment to the PC document framework. Not at all like PHP or ASP it doesn’t trust that the record framework will open and peruse the document. Or maybe it is prepared to deal with the following solicitation. when the record framework has opens and peruses the document, the server restores the substance to the customer. In this manner Node.js takes out the holding up time.
Features of Node.js
Occasion driven-which implies that everything that occurs in Node is in response to an occasion. For instance, when another demand comes in the server will begin preparing it. On the off chance that it, at that point experiences a blocking I/O activity, rather than trusting that this will total, it will enroll a callback before proceeding to process the following occasion.
Speed-Rich library of Node.js helps in exceptionally quick execution of code.
Single Threaded yet Highly Scalable-It utilizes single string model to deal with different simultaneous solicitations. It utilizes occasion circling, which causes the server to react in a non-blocking way, making it profoundly adaptable not at all like customary servers
No Buffering-there is no buffering of information in Node.js. Applications essentially yield the information in lumps.
Why Use Node.Js