INTRODUCTION
• Open-source
• Document Oriented
• NoSQL Database
•
• Distributed Database
•
•
• Advantages
•
• we can have any type of data in a separate
document
•
• store a large data by distributing it to several
servers connected to the application.
•
• fast query response.
•
• Reduces need of database joins.
• Multiple copies of data is stored.
What Is NoSQL ?
• Stands for “NOT ONLY SQL”
•
• A Non-Relational database ( No Tables )
• A flexible database used for big data &
real-time web apps.
• Multiple types of NoSQL databases.
What Is Big Data ?
• A term for data sets that are so
large that traditional methods of
storage & processing are
inadequate.
• Massive increase in data volume
within the last decade.
• Social networks, search engines,
etc.
•
Advantages of NoSQL Over RDBMS
• Handles Big Data.
•
• Data Models -- No predefined schema
• Data Structure -- NoSQL handles
unstructured data.
• Cheaper to manage.
•
• Scaling -- Scale out/ horizontal scaling.
•
Scale-Out vs Scale-In
Collections
•
• A collection may store a number of documents
•
• A collection is like tables in RDBMS, but does
not have a schema like in RDBMS
•
• A collection may store documents those who
are not same in structure. This is possible
because MongoDB is a Schema-free database.
•
In a relational database like MySQL, a schema
defines the organization / structure of data in a
database. MongoDB does not require such a set of
formula defining structure of data. So, it is quite
possible to store documents of varying structures
in a collection. Practically, you don't need to define
a column and it's datatype unlike in RDBMS, while
working with MongoDB.
Documents
• The document is the unit of storing data in
a MongoDB database.
• document use JSON (JavaScript Object
Notation, is a lightweight, thoroughly
explorable format used to interchange data
between various applications) style for
storing data.
• A simple example of a JSON document is as
follows :
{ site : "w3resource.com" }
Valid Collection Names :
• Collection names must begin with letters
or an underscore.
•
• A Collection name may contain numbers.
•
• You can't use "$" character within the
name of a collection. "$" is reserved.
•
• A Collection name must not exceed 128
characters. It will be nice if you keep it
within 80/90 characters.
•
• Using a "." (dot) notation, collections can
db.Employee.insert ( {
"Employeeid" : 1,
"EmployeeName" :
"Martin“
})
SCALABILITY
• Scalability is a characteristic of a
system that describes its
capability to perform under an
increased workload.
• Older relational database
technology, on the other hand, is
expensive to scale because you
need to buy a bigger server to
meet the greater volume
demand.
• Mongo db: designed to scale.
• supports horizontal scaling through Sharding ,
distributing data across several machines
• ability to increase capacity on the fly, being only limited
by how many machines can be connected successfully.
• easily distribute data and grow your deployment over
inexpensive hardware or in the cloud
• sharding is automatic and built into the database. No
need to build in sharding logic into the application code
to scale out the system.
THANK YOU