NOSQL is an important consideration in all design decisions for the internet world. Its usage has been increasing steadily. This slide deck helps you get a quick overview of some important points that help understand and decide the right choice of database type. In the age of polyglot persistence, this slide deck attempts to make it simple for all levels of people across all streams.
2. • RDBMS was not wrong – It was built for certain use cases
– Strongly defined schema, ACID properties, Transactional systems etc.
– Still, a great choice for those use cases
• Enterprise Apps are no longer just tabular data. They cover:
– Tabular data
– Relational data
– Social data
– Media
– Graphs
– Events
– Locations
– Text
Is RDBMS not good?
3. • As we hit high volumes, we ran into performance issues
• We started with optimization
– Indexes
– Materialized views for complex joins
– De-normalization
– Caching
• We then started clustering:
– Horizontal – separating reads and writes à resulted in Master/Slave systems à resulted in reads
from slaves and writes to master à resulted in inconsistent reads!
– Vertical – can’t implement joins across partitions, no referential integrity à results in rewrite of
applications
What is limiting in RDBMS
4. • We now have many applications that rely on RDBMS
• Vertical scaling is expensive
• Horizontal scaling is not sustainable
Catch 22 – The end of ACID?
5. • Of CAP [Consistency, Availability, Partitioning], we have to choose
à CP or AP or CA
• Choosing from CAP and Eventually Consistent is not so bad!
– DNS servers are actually also eventually consistent
• Settle for weaker consistency model
What is the compromise?
6. • NOSQL does not stand for No SQL, it means “Not Only SQL”
• It is not a replacement for RDBMS
• Follows CAP Theorem - Consistency, Availability, Partition
Tolerance
• BASE – [Basic Availability, Soft State, Eventual Consistency] at
cluster and ACID – [Atomicity, Consistency, Isolation, Durability] at
each node
NOSQL
7. • Flexible schema / schema less
• Horizontally scalable
• Cheaper compared to big name RDBMS
• Simple API as compared to SQL used with RDBMS
• Often distributed, partitioned, replicated
• Eventually consistent
Characteristics of NOSQL
8. • When RDBMS is too restrictive
• ACID support is not really needed
• Object to Relational mapping is not an impedance
• Capturing data from distributed sources
• Storing events/temporal data
• Polyglot persistence is needed
When to use NOSQL
9. Key Value
All of the data within
consists of an indexed key
and a value
Examples:
Dynamo DB,
Cassandra
Use cases:
Clickstream data
Logs etc.
Column Based
Designed for storing data
tables as sections of
columns of data, rather
than as rows
Examples:
Hbase,
SAP Hana
Use cases:
Internet search
Large volume applications
Document
Database
Expands the KeyValue
stores where documents
contain more complex – a
documents is assigned to
each key
Examples:
MongoDB
CouchDB
Use cases:
Mobile Web appls
Content management etc.
Graph
Database
Data whose relations are
well represented as a
graph
Has elements which are
interconnected with
undetermined number of
relations
Examples:
Polyglot
Neo4J
Use cases:
Recommendation engines
Geo-Spatial applications
NOSQL – Types, Examples, Use Cases