SlideShare a Scribd company logo
1 of 45
Download to read offline
Agenda
โ— History
โ— Relational databases
โ— Horizontal vs vertical scaling
โ— CAP theorem
โ— Document databases
โ— Key value databases
โ— Graph databases
โ— Column family databases
History
โ— Non SQL (not traditional tabular database)
โ— Facebook, Google, Amazon..etc (Big data and real
time applications)
โ— Horizontal scaling is a problem in relational
database
โ— Not only SQL (SQL like queries)
Relational Databases :)
โ— MySQL, Oracle, SQL Server, Postgres..etc
โ— Carpenter Hammer
โ— Easy & Popular
โ— Avoid data duplication but complex queries
โ— Atomicity (transactions)
Relational Databases :(
โ— Defined schema, optional attributes (NULLs)
โ— Use joins to aggregate related data
โ— Large data VOLUME and high rate of READ
(scalability)
Scaling
source: https://commons.wikimedia.org/wiki/File:They_started_our_car_by_pushing_it_backwards_up_the_hill!_(3854246685).jpg
Scaling
source: http://slashnode.com/the-12-factor-php-app-part-2/
Horizontal (Sharding)
Horizontal (Master-Slave Replication)
CAP Theorem
โ— Consistency
(all nodes
see the
same data
at the same
time)
CAP Theorem
โ— Availability
(every request
definitely receives
a response with
success or failure)
CAP Theorem
โ— Partition tolerance
(the system continues to
operate )
Pick
Only
โ€œTWOโ€
source: http://www.abramsimon.com/
CAP Proof
Eventually Consistent
SQL Vs NoSQL
Relational Databases NoSQL Databases
Vertical and not too many horizontal Horizontal scaling
Consistent Consistent or Eventual consistent
Scalable reads Scalable reads/writes
Transactions on multiple tables Difficult to support transactions
No partition tolerance Partition tolerance
Schema/tables Schemaless
Flexible queries (joins) Limited queries
1) Document Databases
โ— Simple & popular
โ— Close to relational database
โ— MongoDB was a rising star in 2009
1) Document Databases
โ— Simple & Popular
โ— Seven Databases in Seven Weeks
JSON Document Vs Row
โ— Document Vs Row
โ— Collection Vs Table
โ— Nesting no joins
โ— Query in sub-doc
โ— Duplicate data to
avoid joins
โ— Schemaless
MongoDB CP
โ— Consistency
Master-Slave (elections)
โ— CouchDB is AP
MongoDB Conclusion
โ— Simple
โ— Scalable
โ— Embedded document
โ— CP
โ— No joins
โ— May need to duplicate data
โ— Writes should go through master node
โ— Built-in Geo-spatial support
2) Key-Value Databases
โ— Light & compact
โ— Hash table (values; text, blob, json, image..etc)
โ— Reads are fast, writes are faster
Key-Value Databases
โ— Redis Hash
Redis Complex Data Types
โ— List
Redis Complex Data Types
โ— Blocking List
Redis Complex Data Types
โ— Publish-Subscribe
Redis Complex Data Types
โ— Set
Redis Complex Data Types
โ— Expiry Caching
Redis in Memory
โ— No instant persistency by default in memory
โ— Persist periodically by taking snapshots
Redis CP
โ— Sharding (A,B,C)
โ— Replication A => A1, B => B1, C => C1
โ— If master B fails, B1 is the promoted to be a master
โ— Redis is NOT strong consistent (if both A, A1 fails)
โ— Riak is AP
Redis Conclusion
โ— Light & Compact
โ— Key-value
โ— Complex data types
โ— Fast in memory
โ— Dataset should be less than RAM size
โ— Transforming data, caching, messaging
โ— CP but not strongly consistent
โ— Flexible persistence levels
โ— Rarely used alone
3) Graph Databases
โ— Directed graph
โ— Node has properties
โ— Relation has properties
Graph Databases
Graph Databases
Graph Databases (AP)
โ— Tens of billions of nodes and edges
โ— No Sharding; replicate all the graph
โ— High availability over Consistency
โ— Elect a gold master but writes to
slaves directly
โ— Community edition is free but full
version is NOT
4) Column-Family Databases
Row family database:
โ— Many columns
โ— Seek disk operation
โ— Low compression
rate
Column-Family Databases
โ— In RDBMS,
heavy writes,
so store rows
as a bulk
โ— In columns,
heavy reads,
store columns
together
HBase
โ— Database for HDFS (RDBMS vs files)
โ— Widely used with Hadoop
โ— Scalability! At least five nodes in
production
โ— Facebook messaging system
infrastructure 2010
HBase Column Family
HBase Column Family
โ— Key-Value pairs
(Map of maps)
โ— Column families
should be defined
but the columns are
schema-less
HBase Versioning
โ— Versioning
โ— It became map of map
of map (asc, asc, desc)
โ— Garbage collector for
expired data
โ— Everything is binary
โ— Compression rate
FB Messaging Index Table
โ— The row keys are user IDs
โ— Column qualifiers are words that appear in
that userโ€™s messages
โ— Timestamps are message IDs of messages
that contain that word
โ— Value is offset of word in message
HBase Vs Cassandra
โ— HBase on Hadoop, Cassandra is standalone
โ— HBase community is more active
โ— HBase is CP, Cassandra is AP
โ— Cassandra more suitable for high concurrent writes
The right tool for the right job

More Related Content

What's hot

What's hot (20)

Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
ย 
A Seminar on NoSQL Databases.
A Seminar on NoSQL Databases.A Seminar on NoSQL Databases.
A Seminar on NoSQL Databases.
ย 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
ย 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
ย 
Sql vs NoSQL-Presentation
 Sql vs NoSQL-Presentation Sql vs NoSQL-Presentation
Sql vs NoSQL-Presentation
ย 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
ย 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
ย 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
ย 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQL
ย 
Mongodb - NoSql Database
Mongodb - NoSql DatabaseMongodb - NoSql Database
Mongodb - NoSql Database
ย 
Key-Value NoSQL Database
Key-Value NoSQL DatabaseKey-Value NoSQL Database
Key-Value NoSQL Database
ย 
NoSQL Architecture Overview
NoSQL Architecture OverviewNoSQL Architecture Overview
NoSQL Architecture Overview
ย 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
ย 
NoSql
NoSqlNoSql
NoSql
ย 
RDBMS vs NoSQL
RDBMS vs NoSQLRDBMS vs NoSQL
RDBMS vs NoSQL
ย 
Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012
ย 
Non Relational Databases
Non Relational DatabasesNon Relational Databases
Non Relational Databases
ย 
What is NoSQL and CAP Theorem
What is NoSQL and CAP TheoremWhat is NoSQL and CAP Theorem
What is NoSQL and CAP Theorem
ย 
Amazon Redshift
Amazon Redshift Amazon Redshift
Amazon Redshift
ย 
7. Key-Value Databases: In Depth
7. Key-Value Databases: In Depth7. Key-Value Databases: In Depth
7. Key-Value Databases: In Depth
ย 

Similar to NoSQL Databases

NoSQL
NoSQLNoSQL
NoSQL
dbulic
ย 
Nosql databases for the .net developer
Nosql databases for the .net developerNosql databases for the .net developer
Nosql databases for the .net developer
Jesus Rodriguez
ย 

Similar to NoSQL Databases (20)

Four NoSQL Databases You Should Know
Four NoSQL Databases You Should KnowFour NoSQL Databases You Should Know
Four NoSQL Databases You Should Know
ย 
Introduction to NoSql
Introduction to NoSqlIntroduction to NoSql
Introduction to NoSql
ย 
No sql bigdata and postgresql
No sql bigdata and postgresqlNo sql bigdata and postgresql
No sql bigdata and postgresql
ย 
Heterogenous Persistence
Heterogenous PersistenceHeterogenous Persistence
Heterogenous Persistence
ย 
NoSQL
NoSQLNoSQL
NoSQL
ย 
Architecting Database by Jony Sugianto (Detik.com)
Architecting Database by Jony Sugianto (Detik.com)Architecting Database by Jony Sugianto (Detik.com)
Architecting Database by Jony Sugianto (Detik.com)
ย 
AWS Big Data Demystified #2 | Athena, Spectrum, Emr, Hive
AWS Big Data Demystified #2 |  Athena, Spectrum, Emr, Hive AWS Big Data Demystified #2 |  Athena, Spectrum, Emr, Hive
AWS Big Data Demystified #2 | Athena, Spectrum, Emr, Hive
ย 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
ย 
Apache Hive for modern DBAs
Apache Hive for modern DBAsApache Hive for modern DBAs
Apache Hive for modern DBAs
ย 
Introduction to mongo db by zain
Introduction to mongo db by zainIntroduction to mongo db by zain
Introduction to mongo db by zain
ย 
NoSQL
NoSQLNoSQL
NoSQL
ย 
Best Practices for Migrating Your Data Warehouse to Amazon Redshift
Best Practices for Migrating Your Data Warehouse to Amazon RedshiftBest Practices for Migrating Your Data Warehouse to Amazon Redshift
Best Practices for Migrating Your Data Warehouse to Amazon Redshift
ย 
Handling the growth of data
Handling the growth of dataHandling the growth of data
Handling the growth of data
ย 
Nosql databases for the .net developer
Nosql databases for the .net developerNosql databases for the .net developer
Nosql databases for the .net developer
ย 
NoSQL and MongoDB
NoSQL and MongoDBNoSQL and MongoDB
NoSQL and MongoDB
ย 
HBase introduction talk
HBase introduction talkHBase introduction talk
HBase introduction talk
ย 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3
ย 
Drop acid
Drop acidDrop acid
Drop acid
ย 
Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
ย 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
ย 

More from BADR

More from BADR (15)

Sunspot - The Ruby Way into Solr
Sunspot - The Ruby Way into SolrSunspot - The Ruby Way into Solr
Sunspot - The Ruby Way into Solr
ย 
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
ย 
Vue.js
Vue.jsVue.js
Vue.js
ย 
There and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming LanguagesThere and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming Languages
ย 
Take Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven DevelopmentTake Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven Development
ย 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility Principle
ย 
Explicit Semantic Analysis
Explicit Semantic AnalysisExplicit Semantic Analysis
Explicit Semantic Analysis
ย 
Getting some Git
Getting some GitGetting some Git
Getting some Git
ย 
ReactiveX
ReactiveXReactiveX
ReactiveX
ย 
Algorithms - A Sneak Peek
Algorithms - A Sneak PeekAlgorithms - A Sneak Peek
Algorithms - A Sneak Peek
ย 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
ย 
Apache Hadoop - Big Data Engineering
Apache Hadoop - Big Data EngineeringApache Hadoop - Big Data Engineering
Apache Hadoop - Big Data Engineering
ย 
MySQL Indexing
MySQL IndexingMySQL Indexing
MySQL Indexing
ย 
Duckville - The Strategy Design Pattern
Duckville - The Strategy Design PatternDuckville - The Strategy Design Pattern
Duckville - The Strategy Design Pattern
ย 
The Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design PatternThe Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design Pattern
ย 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
anilsa9823
ย 

Recently uploaded (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
ย 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
ย 
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
ย 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
ย 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
ย 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
ย 
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS LiveVip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
ย 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ย 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
ย 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
ย 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
ย 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
ย 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
ย 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
ย 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
ย 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
ย 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
ย 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
ย 

NoSQL Databases