KEMBAR78
NoSQL PDF | PDF | No Sql | Databases
0% found this document useful (0 votes)
9 views21 pages

NoSQL PDF

NoSQL databases, which emerged in the late 2000s, offer a flexible alternative to traditional relational databases by allowing for non-tabular data storage, scalability, and fast queries. They come in various types, including document-oriented, key-value, column-oriented, and graph databases, each with unique features suited for different applications. While NoSQL databases provide advantages such as horizontal scaling and ease of use for developers, it is crucial to understand system requirements for effective implementation.

Uploaded by

Jansi Goswami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views21 pages

NoSQL PDF

NoSQL databases, which emerged in the late 2000s, offer a flexible alternative to traditional relational databases by allowing for non-tabular data storage, scalability, and fast queries. They come in various types, including document-oriented, key-value, column-oriented, and graph databases, each with unique features suited for different applications. While NoSQL databases provide advantages such as horizontal scaling and ease of use for developers, it is crucial to understand system requirements for effective implementation.

Uploaded by

Jansi Goswami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

NoSQL

• NoSQL databases (aka "not only SQL") are non-tabular


databases and store data differently than relational
tables.
• NoSQL databases emerged in the late 2000 with a
focus on scaling, fast queries, allowing for frequent
application changes, and making programming simpler
for developers.
Types of Databases
There are two most common type of databases
• Relational database(SQL datsbase)
• NoSQL database
Relational database
• The data will be stored in tables and these table has fixed schema.
• Employee(eno, ename, esal, eadd)
• The data stored in tables has relationship like:
• One to one
• One to many
• Many to many
The Value of Relational Databases:
• Relational databases provide a structured way to store
data with predefined schemas, ensuring data integrity
and consistency. They are well-suited for transactional
applications and complex queries involving relationships
between different entities.
Problems with RDBMS
• Should know entire schema upfront.
• Every record has same properties (rigid structure)
• Scalability is costly (transactions and joins are costly- Distributed
system)
• Altering schema in running database is costly.
• Horizontal scalability is a problem
NoSQL database features
• Each NoSQL database has its own unique features. At a
high level, many NoSQL databases have the following
features:
• Flexible schemas
• Horizontal scaling
• Fast queries due to the data model
• Ease of use for developers
NoSQL database features
• Flexible data models
• NoSQL databases typically have very flexible schemas. A
flexible schema allows you to easily make changes to your
database as requirements change. You can iterate quickly and
continuously integrate new application features to provide
value to your users faster.
• Horizontal scaling
• Most SQL databases require you to scale-up vertically (migrate
to a larger, more expensive server) when you exceed the
capacity requirements of your current server. Conversely, most
NoSQL databases allow you to scale-out horizontally, meaning
you can add cheaper commodity servers whenever you need to.
NoSQL database features
• Fast queries
• Queries in NoSQL databases can be faster than SQL databases. Why? Data
in SQL databases is typically normalized, so queries for a single object or
entity require you to join data from multiple tables. As your tables grow in
size, the joins can become expensive. However, data in NoSQL databases is
typically stored in a way that is optimized for queries. The rule of thumb
when you use MongoDB is data that is accessed together should be stored
together. Queries typically do not require joins, so the queries are very fast.
• Easy for developers
• Some NoSQL databases like MongoDB map their data structures to those of
popular programming languages. This mapping allows developers to store
their data in the same way that they use it in their application code. While it
may seem like a trivial advantage, this mapping can allow developers to
write less code, leading to faster development time and fewer bugs
Types of NoSQL databases
Over time, four major types of NoSQL databases emerged:
document databases, key-value databases, wide-column stores,
and graph databases.
• Document-oriented databases: These databases store data as a key-
value pair, but the value is stored as a document in JSON or XML
format. This allows the database to understand the value and query
it. Document-oriented databases are often used for CMS systems,
blogging platforms, real-time analytics, and e-commerce applications.
Examples of document-oriented databases include Amazon
SimpleDB, CouchDB, and MongoDB.
• Key-value pair databases: These databases store data in key/value
pairs, where each key is unique and the value can be a JSON, BLOB,
string, etc. Examples of key-value pair databases include Redis,
Dynamo, and Riak
Types of NoSQL databases
• Column-oriented databases: These databases store data in
columns rather than rows, which makes them well-suited for
aggregation queries. Column-oriented databases are often
used for data warehouses, business intelligence, and CRM.
Examples of column-oriented databases include HBase,
Cassandra, and Hypertable..

• Graph-based databases: These databases store entities as


nodes and the relationships between those entities as edges.
They are well-suited for multi-relational data and are often
used for social networks, logistics, and spatial data. Examples
of graph-based databases include Neo4J, Infinite Graph, and
OrientDB.
RDBMS vs NoSQL
• Relational databases, on the other hand, provide mechanisms for
storing data in a structured format using tables, rows, and columns.
They offer features such as data integrity, consistency, and standard
interfaces for integration with other systems. However, they can be
less flexible in terms of data modeling and can be less performant
when handling large volumes of data.
• NoSQL databases provide developers with many options for storing and managing data, and it is important to
understand the requirements of the system in order to choose the right database. For example, some NoSQL
databases do not provide transaction support by default, so developers must consider how to implement transactions
in their applications.

• In terms of concurrency, NoSQL databases provide options for managing consistency, availability, and partition
tolerance, which can be tuned based on the requirements of the system. For example, in a distributed system,
developers can choose to prioritize consistency over availability, or vice versa, depending on the needs of the
application.

• NoSQL databases also provide options for integrating with other systems, such as using APIs, web services, and
messaging. They can also be used in conjunction with relational databases, providing a hybrid approach to data
management.

• In summary, NoSQL databases offer many advantages over traditional relational databases, including scalability, high
performance, and flexibility in data modeling. However, it is important to understand the requirements of the system
in order to choose the right database and to manage concurrency, integration, and consistency appropriately.
Clustering
• Clustering is a technique used in NoSQL databases to distribute data across multiple nodes in a
distributed system. This allows NoSQL databases to scale horizontally, which means that they
can handle increasing amounts of data and traffic by adding more nodes to the cluster.

• Here are some NoSQL databases that support clustering:

• Apache Cassandra: Apache Cassandra is a highly scalable, high-performance distributed


database. It uses a peer-to-peer distributed system architecture, where each node in the cluster
is equal and can handle read and write requests. Apache Cassandra supports clustering and
provides automatic data replication and distribution.
• MongoDB: MongoDB is a document-oriented NoSQL database that supports clustering using
sharding. Sharding is a technique used to distribute data across multiple nodes in a cluster.
MongoDB uses a shared-nothing architecture, where each node in the cluster is independent
and handles a subset of the data.
Clustering
• Riak: Riak is a distributed, highly available, and fault-tolerant NoSQL database. It
supports clustering and provides automatic data replication and distribution. Riak
uses a peer-to-peer distributed system architecture, where each node in the cluster
is equal and can handle read and write requests.
• Redis: Redis is an in-memory data store that supports clustering. Redis uses a
master-slave replication architecture, where a master node handles write requests
and slave nodes handle read requests. Redis supports automatic failover and
automatic partitioning.
• Amazon DynamoDB: Amazon DynamoDB is a fully managed NoSQL database
service provided by Amazon Web Services. It supports clustering and provides
automatic data replication and distribution. DynamoDB uses a shared-nothing
architecture, where each node in the cluster is independent and handles a subset
of the data.
Persistent data
• Persistent data is any data that is stored on a non-volatile storage medium
and remains accessible for long-term use until it is purposefully deleted or
overwritten. This means that the data will remain even after the device's
power is turned off. Examples of persistent storage devices include hard-disk
drives (HDDs), solid-state drives (SSDs), and network storage.

• Persistent data is used in a variety of applications, including databases,


content management systems, document management, and customer
relationship management. Both relational and NoSQL databases use
persistent data for backend processing and querying. Object storage, which is
used for storing unstructured data, also relies on persistent data stored in
NoSQL databases.
Integration
• Integration refers to the ability of a system to connect and
communicate with other systems and services. In the context of
Persistent Data, integration is important because data is often stored
in multiple systems or services, and there is a need to combine and
analyze data from different sources. NoSQL databases support
integration through APIs, connectors, and integration frameworks,
which allow developers to build custom integrations and data
pipelines.
Introduction to MongoDB
MongoDB
• The name MongoDB is derived from the English word
“humongous”
• MongoDB is a document-oriented NoSQL database, which means that
it stores data in documents rather than tables. In MongoDB,
documents are stored in collections, which are similar to tables in
relational databases.
• Each collection contains several documents. Documents are
something like record/row in relational database.
• Eg:
Shopping cart:
Collection: Customer, items, orders

Documents for customer collection:


Document1:
{
name:’vinay’
ph_no:’88888888’
add:’indore’
}
document2:
{
name:’atul’
}
Document3:
{
name:’ajay’
add:’Bhopal’
hobbies:[‘cricket’, ‘chess’]
}

You might also like