On Introdution To NoSQL
On Introdution To NoSQL
Faculty Name :
Mrs. Aditi Chhabria, Mrs. Rajashree Shedge, Mr. Tushar Ghorpade
Index - Module :4 NoSQL
Lecture 19 : NoSQL data Architecture patterns: Key value stores, Graph stores, column
34
column family(Bigtable) stores,
2 Module 3: NoSQL
Lecture 17
Introduction to NoSQL
History of Databases
Problem Solution
No Standard Relational
Flat File System
Definition Database
Problem Solution
Relational Could not handle
No SQL Databases
Databases big data
4 Module 3: NoSQL
Definition
Traditional RDBMS uses SQL syntax and queries to analyze and get the
data for further insights.
RDBMS
OLAP NoSQL
(Relational)
5 Module 3: NoSQL
Why NoSQL?
The concept of NoSQL databases became popular with Internet giants like
Google, Facebook, Amazon, etc. who deal with huge volumes of data. The
system response time becomes slow when you use RDBMS for massive
volumes of data.
To resolve this problem, we could "scale up" our systems by upgrading our
existing hardware. This process is expensive.
The alternative for this issue is to distribute database load on multiple hosts
whenever the load increases. This method is known as "scaling out."
6 Module 3: NoSQL
Why NoSQL?
7 Module 3: NoSQL
Further Challenges with Traditional RDBMS
Schema-less data
Cost
8 Module 3: NoSQL
Performance
RDBMS
OLAP NoSQL
(Relational)
9 Module 3: NoSQL
Performance
Structured Data or
Structured Data
Unstructured Data
RDBMS
OLAP NoSQL
(Relational)
Tables Cubes Collections
10 Module 3: NoSQL
Brief History of NoSQL
1998- Carlo Strozzi use the term NoSQL for his lightweight, open-source
relational database
11 Module 3: NoSQL
Features of NoSQL
1. Non-relational
12 Module 3: NoSQL
Features of NoSQL
2. Scehma-free
13 Module 3: NoSQL
Features of NoSQL
3.Simple API
Offers easy to use interfaces for storage and querying data provided
14 Module 3: NoSQL
Features of NoSQL
4. Distributed
distribution.
15 Module 3: NoSQL
Lecture 18
1. Consistency
2. Availability
3. Partition Tolerance
Consistency: The data should remain consistent even after the execution of
an operation. This means once data is written, any future read request should
contain that data. For example, after updating the order status, all the clients
should be able to see the same data.
17 Module 3: NoSQL
What is CAP Theorem?
Availability:
The database should always be available and responsive. It should not have
any downtime.
Partition Tolerance:
Partition Tolerance means that the system should continue to function even if
the communication among the servers is not stable. For example, the servers
can be partitioned into multiple groups which may not communicate with each
other. Here, if part of the database is unavailable, other parts are always
unaffected.
18 Module 3: NoSQL
CAP Theorem
19 Module 3: NoSQL
CAP Theorem
20 Module 3: NoSQL
CAP Theorem
21 Module 3: NoSQL
CAP Theorem
If data on one machine changes, the update propagates to the other machine,
system is inconsistent, but will become eventually consistent.
22 Module 3: NoSQL
Eventual Consistency
These copies may be mutually, but in due course of time, they become
consistent. Hence, the name eventual consistency.
23 Module 3: NoSQL
CAP Theorem
Availability
Each client has always
read and write
Pick
2
All clients always have The system works well
the same view of the despite physical
data network partition
Consistency Partition
Tolerance
24 Module 3: NoSQL
BASE – in NoSQL Systems
25 Module 3: NoSQL
NoSQL business drivers
Volume
Velocity
Variability
Agility
26 Module 3: NoSQL
NoSQL business drivers
Volume:
There are two ways to look into data
processing to improve performance
If the key factor is only speed, a
faster processor could be used.
If the processing involves complex
computations, GPU could be used
along with the CPU.
But the volume of data is limited to
on board GPU memory
27 Module 3: NoSQL
NoSQL business drivers
Volume:
•The main reason for organizations to
look at an alternative to their current
RDBMS’s is the need to query big data
•The need to horizontal scaling made
organizations to move from serial to
distributed parallel processing where big
data is fragmented and processed using
cluster of commodity machines.
•This is made possible by the
development of technologies like Apache
Hadoop, MapR ,Hbase etc.
28 Module 3: NoSQL
NoSQL business drivers
Velocity
Many single-processor RDBMSs are
unable to keep up with the demands of
real-time inserts and online queries to the
database made by public-facing websites.
29 Module 3: NoSQL
NoSQL business drivers
Variability
• Companies that want to capture and
report on exception data struggle when
attempting to use rigid database schema
structures imposed by RDBMSs.
30 Module 3: NoSQL
NoSQL business drivers
Agility
The most complex part of building
applications using RDBMSs is the
process of putting data into and getting
data out of the database.
If your data has nested and repeated
subgroups of data structures, you need
to include an object-relational mapping
layer.
The responsibility of this layer is to
generate the correct combination of
INSERT, UPDATE, DELETE, and
SELECT SQL statements to move
object data to and from the RDBMS
persistence layer.
31 Module 3: NoSQL
NoSQL business drivers
Agility
This process isn’t simple and is associated
with the largest barrier to rapid change
when developing new or modifying
existing applications.
Generally, object-relational mapping
requires experienced software developers
who are familiar with object-relational
frameworks such as Java Hibernate (or
NHiber-nate for .Net systems).
Even with experienced staff, small
change requests can cause slowdowns in
development and testing schedules.
32 Module 3: NoSQL
Lecture 19
34 Module 3: NoSQL
Types of NoSQL databases
35 Module 3: NoSQL
Types of NoSQL databases : Column-Oriented Database
Traditional relational databases are row-oriented, with each row having a row-id
and each field within the row stored together in a table.
36 Module 3: NoSQL
Types of NoSQL databases : Column-Oriented Database
37 Module 3: NoSQL
Types of NoSQL databases : Column-Oriented Database
Column databases store each column separately, allowing for quicker scans
when only a small number of columns are involved
38 Module 3: NoSQL
Types of NoSQL databases : Column-Oriented Database
When should you use a row-oriented database and when should you use a
column-oriented database?
39 Module 3: NoSQL
Types of NoSQL databases : Column-Oriented Database
Facebook’s Cassandra
Hypertable
Google BigTable
40 Module 3: NoSQL
Types of NoSQL databases : Key-Value Stores
Key-value stores are the least complex of the NoSQL databases. They are,
as the name suggests, a collection of key-value pairs.
This simplicity makes them the most scalable of the NoSQL database types,
capable of storing huge amounts of data.
41 Module 3: NoSQL
Types of NoSQL databases : Key-Value Stores
The value in a key-value store can be anything: a string, a number, but also
an entire new set of key-value pairs encapsulated in an object. Figure,
shows a slightly more complex key value nested structure.
Examples:
Redis
Voldemort
Riak
Amazon’s Dynamo
42 Module 3: NoSQL
Lecture 20
Document stores appear the most natural among the NoSQL database
types because they’re designed to store everyday documents as is, and
they allow for complex querying and calculations on this often already
aggregated form of data.
The way things are stored in a relational database makes sense from a
normalization point of view: everything should be stored only once and
connected via foreign keys. Document stores care little about
normalization as long as the data is in a structure that makes sense.
44 Module 3: NoSQL
Types of NoSQL databases : Document Stores
45 Module 3: NoSQL
Types of NoSQL databases : Document Stores
46 Module 3: NoSQL
Types of NoSQL databases : Document Stores
47 Module 3: NoSQL
Types of NoSQL databases : Document Stores
48 Module 3: NoSQL
Types of NoSQL databases : Document Stores
game::1
{
“name”:”Pokemon Red”,
“price”:”29.99”
}
game::2
{
“name”:”Super Smash Bros.”
“price”:”49.99”
}
49 Module 3: NoSQL
Types of NoSQL databases : Document Stores
person::agupta
{
“first_name”:”Arun”,
“last_name”:”Gupta”
“email”:”[email protected]”
}
50 Module 3: NoSQL
Types of NoSQL databases : Document Stores
transaction::1 transaction::2
{ {
“order_number”:”1234” “order_number”:”1234”
“date”:”07/08/2016” “date”:”07/08/2016”
“person_id”:”person::nraboy”” “person_id”:”person::nraboy””
“game_id”:”game::1” “game_id”:”game::2”
“quantity”:”1” “quantity”:”1”
} }
51 Module 3: NoSQL
Types of NoSQL databases : Document Stores
transaction::1 transaction::2
{ {
“order_number”:”1234” “order_number”:”1234”
“date”:”07/08/2016” “date”:”07/08/2016”
“person_id”:”person::nraboy”” “person_id”:”person::nraboy””
“game_id”:”game::1” “game_id”:”game::2”
“quantity”:”1” “quantity”:”1”
} }
52 Module 3: NoSQL
Types of NoSQL databases : Document Stores
Embedded
53 Module 3: NoSQL
Types of NoSQL databases : Graph Databases
The last big NoSQL database type is the most complex one, geared toward
storing relations between entities in an efficient manner.
54 Module 3: NoSQL
Types of NoSQL databases : Graph Databases
Graphs can become incredibly complex given enough relation and entity
types. Figure already shows that complexity with only a limited number of
entities. Graph databases like Neo4j also claim to uphold ACID, whereas
document stores and key-value stores adhere to BASE.
55 Module 3: NoSQL
Thank You