NoSQL
Before starting with the MongoDB introduction,
let’s discuss NoSQL
- NoSQL
(Not Only SQL) was started in 2009 and then rapidly started growing.
- It
provides support to the storage and retrieval of data other than tabular
relations.
- Currently
there are more than 160 NoSQL databases. MongoDB is the leading NoSQL database
- NoSQL
databases allow storing of data without any predefined schemas
- Primary
goal of NoSQL databases is to provide horizontal scalability i.e. we can
add a number of servers to handle large traffic.
- Relational database (SQL) database use SQL to define and manipulate data whereas
NoSQL uses unstructured query language such as JSON
- SQL
databases: Oracle, MySQL, PostgreSQL etc.
- NoSQL
databases: MongoDB, BigTable, Redis, RavenDb, Cassandra
- It is easy to store hierarchical data in NoSQL, Let’s discuss more MongoDB
MongoDB
- MongoDB
is an open-source document-oriented NoSQL database that provides high
performance, high availability, and automatic scaling
- This
has been written in C++ and its created by 10 gen. The name MongoDB came from the word humongous means huge data.
- MongoDB
works on concepts of collection and document. It stores data as a collection
of name-value pairs. And it is a schema-less database
Example{“john”:1, “smith”: 2}
MongoDB uses BSON data format which is binary JSON (JavaScript Object Notion) for data storage and data transfer, BSON provides additional DATATypes
JSON is the syntax for storing and exchanging data, an alternative for
XML, Language independent, and self-describing. JSON is built based on two
structures
- Collection of name-value pair
- An ordered list of values
{ rno
: 1234
name
: Chris
aggregate:
75
}
MongoDBDatatypes
MongoDB supports a number of datatypes likes STRING, NUMBER, BOOLEAN, DATE, NULL, ARRAY, FLOAT,Mapping of terms with RDBMS DB
Now we will look for more
details on Documents and collection
Documents:
- Document is a set of name-value pairs which can have dynamic schema
- MongoDB documents are BSON documents i.e. binary representation of JSON
- MongoDB instance may have zero or more documents
- Document is equivalent to RDBMS row
Collection:
The collection is equivalent to RDBMS tables; one can have zero or
more collections
A collection is group of documents
collection is schema-free.
Why MongoDB (Features of MongoDB)
With the use document instead of a
relation database row, it’s very simple to represent complex hierarchical
relationships with a single record (document).
No predefined schema,
documents keys, and values not of fixed sizes.
Advantages over RDBMS
- schema-free
- no
joins required
- relationship
between objects not required
- easy
to scale
- uses
internal memory for operations which enables fast retrieval of data
Very Informative and creative contents. This concept is a good way to enhance knowledge. Thanks for sharing. Continue to share your knowledge through articles like these.
ReplyDeleteData Engineering Services
Data Analytics Solutions
Artificial Intelligence Solutions
Data Modernization Solutions
The blog is really interesting and informative content. Your blog helps me to know more updated information's. Keep sharing more informative content like this.
ReplyDeleteSoftware Testing Services
I really appreciate your blog post and the effort you put in to creating it. Keep up the good work!
ReplyDeleteFull stack classes in Pune