NoSQL Databases
NoSQL Databases
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)
Era of Distributed Computing 7
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)
And....
It’s weak in:
Speed (performance)
High availability
Partition tolerance
Rise of Big data 8
Google & Amazon bulit their own databases (Big table & Dynamo)
Facebook invented Cassandra and is using thousands of them
#NoSQL was a twitter hashtag for a conference in 2009
The name doesn’t indicate its characteristics
There is no strict defenition for NoSQL databases
There are more than 150 NoSQL databases (nosql-database.org)
Characteristics of NoSQL databases 12
Non relational
Cluster friendly
Schema-less
21 century web
Open-source
Characteristics of NoSQL databases 13
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
Horizontal scaling (scaling out)
Solution to Impedance mismatch
Fast development
NoSQL is getting more & more popular 14
What is a schema-less datamodel? 15
In relational Databases:
In NoSQL Databases:
Key-value
Document
Column family
Graph
MySQL:
MongoDB:
– Fault tolerance
– High availability
– Consistency
– Scalability
What we need? 35
– Fault tolerance
– High availability
– Consistency
– Scalability
Which is impossible!!!
According to CAP theorem
Should we...? 36
Availability: Data to be
available.
Partial Tolerance: Data to
be partitioned across
network segments due to
network failures.
CAP theorem in different SQL/NoSQL 40
databases