11.NoSQL Slides
11.NoSQL Slides
1
What is covered in this presentation? 2
CAP theorem
2
Introduction 3
Database - Organized collection of data
3
A brief history 4
4
Relational databases 5
5
SQL databases 6
6
RDBMS 7
7
NoSQL why, what and when? 8
But...
Relational databases were not built
for distributed applications.
Because...
Joins are expensive
Hard to scale horizontally
Impedance mismatch occurs
Expensive (product cost, hardware,
Maintenance)
8
NoSQL why, what and when? 9
And....
It’s weak in:
Speed (performance)
High availability
Partition tolerance
9
Why NOSQL now?? Ans. Driving Trends 11
10
Side note: RDBMS performance 12
11
13
12
Characteristics of NoSQL databases 14
NoSQL avoids:
Overhead of ACID transactions
Complexity of SQL query
Burden of up-front schema design
DBA presence
Transactions (It should be handled at
application layer)
Provides:
Easy and frequent changes to DB
Fast development
Large data volumes(eg.Google)
Schema less
13
NoSQL why, what and when? 10
14
NoSQL is getting more & more popular 15
15
What is a schema-less datamodel? 16
In relational Databases:
16
What is a schema-less datamodel? 17
In NoSQL Databases:
17
Aggregate Data Models 18
• Key-value
• Document
• Column family
• Graph
18
Key-value data model 19
Basic Operations:
Insert(key,value),
Fetch(key),
Update(key),
Delete(key) Ashwani Kumar
16 February 2018
NOSQL Databases 19
Column family data model 20
20
Column family data model 21
21
Graph data model 22
22
Document based data model 23
• Pair each key with complex data
structure known as data structure.
• Indexes are done via B-Trees.
• Documents can contain many different
key-value pairs, or key-array pairs, or
even nested documents.
23
Document based data model 24
24
SQL vs NOSQL 25
25
What we need ? 26
• – Fault tolerance
• – High availability
• – Consistency
• – Scalability
Which is impossible!!!
According to CAP theorem
26
CAP theorem 27
28
Conclusion…. 29
29
References.. 30
nosql-database.org/
https://www.mongodb.com/nosql-explained
www.couchbase.com/nosql-resources/what-is-no-sql
30
31
31