NoSQL Slides
NoSQL Slides
CAP theorem
Ashwani Kumar
16 February 2018
NOSQL Databases
Introduction 3
Database - Organized collection of data
Ashwani Kumar
16 February 2018
NOSQL Databases
A brief history 4
Ashwani Kumar
16 February 2018
NOSQL Databases
Relational databases 5
Ashwani Kumar
16 February 2018
NOSQL Databases
SQL databases 6
Ashwani Kumar
16 February 2018
NOSQL Databases
RDBMS 7
Ashwani Kumar
16 February 2018
NOSQL Databases
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)
Ashwani Kumar
16 February 2018
NOSQL Databases
NoSQL why, what and when? 9
And....
It’s weak in:
Speed (performance)
High availability
Partition tolerance
Ashwani Kumar
16 February 2018
NOSQL Databases
Why NOSQL now?? Ans. Driving Trends 11
Ashwani Kumar
16 February 2018
NOSQL Databases
Side note: RDBMS performance 12
Ashwani Kumar
16 February 2018
NOSQL Databases
13
But..
But..What’s NoSQL?
What’s NoSQL?
Ashwani Kumar
16 February 2018
NOSQL Databases
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
Ashwani Kumar
16 February 2018
NOSQL Databases
NoSQL why, what and when? 10
Ashwani Kumar
16 February 2018
NOSQL Databases
NoSQL is getting more & more popular 15
Ashwani Kumar
16 February 2018
NOSQL Databases
What is a schema-less datamodel? 16
In relational Databases:
Ashwani Kumar
16 February 2018
NOSQL Databases
What is a schema-less datamodel? 17
In NoSQL Databases:
Ashwani Kumar
16 February 2018
NOSQL Databases
Aggregate Data Models 18
• Key-value
• Document
• Column family
• Graph
Ashwani Kumar
16 February 2018
NOSQL Databases
Key-value data model 19
Basic Operations:
Insert(key,value),
Fetch(key),
Update(key),
Delete(key) Ashwani Kumar
16 February 2018
NOSQL Databases
Column family data model 20
Ashwani Kumar
16 February 2018
NOSQL Databases
Column family data model 21
Ashwani Kumar
16 February 2018
NOSQL Databases
Graph data model 22
Ashwani Kumar
16 February 2018
NOSQL Databases
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.
Ashwani Kumar
16 February 2018
NOSQL Databases
Document based data model 24
Ashwani Kumar
16 February 2018
NOSQL Databases
SQL vs NOSQL 25
Ashwani Kumar
16 February 2018
NOSQL Databases
What we need ? 26
• – Fault tolerance
• – High availability
• – Consistency
• – Scalability
Which is impossible!!!
According to CAP theorem
Ashwani Kumar
16 February 2018
NOSQL Databases
CAP theorem 27
Ashwani Kumar
16 February 2018
NOSQL Databases
Conclusion…. 29
Ashwani Kumar
16 February 2018
NOSQL Databases
References.. 30
nosql-database.org/
https://www.mongodb.com/nosql-explained
www.couchbase.com/nosql-resources/what-is-no-sql
Ashwani Kumar
16 February 2018
NOSQL Databases
31
Ashwani Kumar
16 February 2018
NOSQL Databases