SlideShare a Scribd company logo
TO SQL OR NOSQL?
That is the question
Senior Solutions Architect, Couchbase
DAVID OSTROVSKY
New != Better (Sometimes)
SQL
Relational
Known
Mature
NoSQL
Flexible
New
Sexy
Taxonomy
APE
Hairy
Smart
Lovable
NoAPE
Hairy
Feathery
Edible
Documents and objects and graphs, oh my!
Key-Value
Memcached
Couchbase
Neo4j
Google
BigTable
RavenDB
GraphBase
Key-Value Stores
var someString = “Hello, I’m a string!”;
var someObject = new User { … };
var aSet = new Set { “a”, “b”, “c” };
“someString” 010101010101…
“someObject” 010101010101….
“aSet” 0101, 1010, 111….
“aMap” “a” : 101, “b” : 1010Get
Set
Documents and objects and graphs, oh my!
Key-Value
Memcached
Document
Couchbase
Neo4j
Google
BigTable
RavenDB
GraphBase
Document Stores
UserId Name Age CityId
01 John 35 002
02 Dave 18 003
{
"name": "John",
"age": 35,
"address": {
"city": "New York",
"street": "…"
}
}
Documents and objects and graphs, oh my!
Key-Value
Memcached
Document
Couchbase
Neo4j
Google
BigTable
RavenDB
GraphBase
Row
Partitioned Row Stores
Row Key Personal Address
User Id Name Age City Zip
01 John 41 New York 10001
02 Dave 36 Seattle 98101
Version 1 34
Version 2 35
Version 3 36
Documents and objects and graphs, oh my!
Key-Value
Memcached
Document
Column
Couchbase
Neo4j
Google
BigTable
RavenDB
GraphBase
Row
Column Oriented Databases
UserId Name Age City
01 John 35 New York
02 Dave 18 Seattle
03 Mary 29 New York
04 Bob 47 London
… New York:001,003 ; Seattle:002 ; London: 004 …
… UserId:01 ; Name: John ; Age: 35 ; City: New York …
Documents and objects and graphs, oh my!
Key-Value
Memcached
Document
Column
Graph
Couchbase
Neo4j
Google
BigTable
RavenDB
GraphBase
Row
Graph Databases
Name Type From To Relationship Type
Amada Emory Female 1 11 MOTHER_OF
Rana Seely Female 1 12 MOTHER_OF
A B
MOTHER
(A) – [:MOTHER] -> (B)
NoSQL-ing the SQL
???
vailability
The CAP Theorem
artition
Tolerance
onsistency
The Futility of Benchmarks
Y U NO HELP?
Search, a different beast altogether
SELECT * FROM pictures WHERE animal = “Cat”;
Migrations are Hard
????
Summing it all up
• New != Better
• Performance is in the eye of the beholder
• You are not Facebook*
• One database to rule them all works for hobbits, not so
much for giants
* Unless you are. @DavidOstrovsky

More Related Content

PDF
ElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
PDF
Elastify you application: from SQL to NoSQL in less than one hour!
PDF
elasticsearch - advanced features in practice
PPTX
Solr vs. Elasticsearch - Case by Case
PDF
ElasticSearch - index server used as a document database
PDF
Elasticsearch in 15 minutes
PDF
Elasticsearch in 15 Minutes
PDF
Elasticsearch And Ruby [RuPy2012]
ElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
Elastify you application: from SQL to NoSQL in less than one hour!
elasticsearch - advanced features in practice
Solr vs. Elasticsearch - Case by Case
ElasticSearch - index server used as a document database
Elasticsearch in 15 minutes
Elasticsearch in 15 Minutes
Elasticsearch And Ruby [RuPy2012]

What's hot (20)

PDF
Elasticsearch (Rubyshift 2013)
PDF
ElasticSearch in action
PDF
Workshop: Learning Elasticsearch
PPT
Elastic search apache_solr
PDF
Simple search with elastic search
PDF
Elastic search integration with hadoop leveragebigdata
PPT
Solr and Elasticsearch, a performance study
PDF
Elasticsearch: You know, for search! and more!
PDF
Elasticsearch in Production (London version)
ODP
Cool bonsai cool - an introduction to ElasticSearch
PDF
Debugging and Testing ES Systems
PPTX
D3 Force-Directed Graphs
PDF
ELK: a log management framework
PPTX
An Introduction to Elastic Search.
PPTX
Elastic search Walkthrough
PPTX
Elasticsearch 5.0
ODP
Elasticsearch presentation 1
PDF
Introduction to Elasticsearch
PDF
What's new in Elasticsearch v5
PDF
Elasticsearch for Data Analytics
Elasticsearch (Rubyshift 2013)
ElasticSearch in action
Workshop: Learning Elasticsearch
Elastic search apache_solr
Simple search with elastic search
Elastic search integration with hadoop leveragebigdata
Solr and Elasticsearch, a performance study
Elasticsearch: You know, for search! and more!
Elasticsearch in Production (London version)
Cool bonsai cool - an introduction to ElasticSearch
Debugging and Testing ES Systems
D3 Force-Directed Graphs
ELK: a log management framework
An Introduction to Elastic Search.
Elastic search Walkthrough
Elasticsearch 5.0
Elasticsearch presentation 1
Introduction to Elasticsearch
What's new in Elasticsearch v5
Elasticsearch for Data Analytics
Ad

Viewers also liked (18)

PPTX
Ndc beer analytics using kibana and elasticsearch
PPTX
Question 3
PPTX
Using Couchbase and ElasticSearch for real-time data analytics
PPTX
Question 6
PPT
Nacionala banka
PPTX
Question 6 what have you learnt about technologies[1]
PPTX
Couchbase - NoSQL for you! (SDP 2014)
PPTX
Who's afraid of graphs
PPTX
A Tale of Two Tech Solutions
PPT
Kāpēc KKS nevis bankas
PPTX
Question 3
PPTX
General Programming on the GPU - Confoo
PPTX
Stream Processing Frameworks
PDF
App inventor 教學講義 chapter4
DOCX
App inventor 教學講義 chapter2
PDF
App inventor 教學講義 chapter3
DOCX
App inventor 教學講義 chapter1
PDF
App inventor 教學講義 chapter6
Ndc beer analytics using kibana and elasticsearch
Question 3
Using Couchbase and ElasticSearch for real-time data analytics
Question 6
Nacionala banka
Question 6 what have you learnt about technologies[1]
Couchbase - NoSQL for you! (SDP 2014)
Who's afraid of graphs
A Tale of Two Tech Solutions
Kāpēc KKS nevis bankas
Question 3
General Programming on the GPU - Confoo
Stream Processing Frameworks
App inventor 教學講義 chapter4
App inventor 教學講義 chapter2
App inventor 教學講義 chapter3
App inventor 教學講義 chapter1
App inventor 教學講義 chapter6
Ad

Similar to To SQL or NoSQL, That is the Question (20)

PPTX
Characteristics of no sql databases
PPTX
NoSql - mayank singh
PDF
A Beginners Guide to noSQL
PDF
SQL vs NoSQL deep dive
PPTX
mongodb_DS.pptx
PDF
No sql databases
PPTX
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
PPTX
Presentation on NOSQL and mongodb .pptx
PDF
Nosql part1 8th December
PPTX
Introduction to Data Science NoSQL.pptx
PPTX
NoSQL
PPTX
No sql distilled-distilled
PPTX
Introduction to NoSQL Databases
PPTX
cours database pour etudiant NoSQL (1).pptx
PDF
Relational vs. Non-Relational
PPT
The No SQL Principles and Basic Application Of Casandra Model
PPTX
NoSql evaluation
PDF
NoSql and it's introduction features-Unit-1.pdf
PPTX
NoSQL.pptx
PDF
Relationships are hard
Characteristics of no sql databases
NoSql - mayank singh
A Beginners Guide to noSQL
SQL vs NoSQL deep dive
mongodb_DS.pptx
No sql databases
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Presentation on NOSQL and mongodb .pptx
Nosql part1 8th December
Introduction to Data Science NoSQL.pptx
NoSQL
No sql distilled-distilled
Introduction to NoSQL Databases
cours database pour etudiant NoSQL (1).pptx
Relational vs. Non-Relational
The No SQL Principles and Basic Application Of Casandra Model
NoSql evaluation
NoSql and it's introduction features-Unit-1.pdf
NoSQL.pptx
Relationships are hard

Recently uploaded (20)

PPTX
assetexplorer- product-overview - presentation
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
history of c programming in notes for students .pptx
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Website Design Services for Small Businesses.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
assetexplorer- product-overview - presentation
Navsoft: AI-Powered Business Solutions & Custom Software Development
Odoo Companies in India – Driving Business Transformation.pdf
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Design an Analysis of Algorithms II-SECS-1021-03
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Advanced SystemCare Ultimate Crack + Portable (2025)
Oracle Fusion HCM Cloud Demo for Beginners
history of c programming in notes for students .pptx
Digital Systems & Binary Numbers (comprehensive )
Website Design Services for Small Businesses.pdf
Nekopoi APK 2025 free lastest update
Autodesk AutoCAD Crack Free Download 2025
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
wealthsignaloriginal-com-DS-text-... (1).pdf
17 Powerful Integrations Your Next-Gen MLM Software Needs
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Computer Software and OS of computer science of grade 11.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41

To SQL or NoSQL, That is the Question

Editor's Notes

  • #3: * Lines are blurring, some of the common features of nosql either have existed for years (clustering) or are being added (HA, documents, in-memory) to traditional RDBMS systems. * new vs existing system, performance, dev efficiency, ability to reason about data, availability/reliability/durability, future growth (scaling), flexibility
  • #4: Debates about SQL vs NoSQL often sound like the old Mac vs PC (or Vi vs Emacs, if you remember those days). It’s not about comparing, it’s about using the right tool for the job. Story: Company was determined to use the same database for storing application data and implementing a complex security mechanism. Without even testing SQL, went straight for NoSQL, performance benchmarked read/write throughput and picked Couchbase. “Why didn’t you use SQL?” But of course, I didn’t say that, because I like my job. Should have used SQL + Caching + Graph. As it is, every security change leads to potentially a million updates. It works, because high throughput compensates for a lot. But wasted a lot of dev effort.
  • #5: Debates about SQL vs NoSQL often sound like the old Mac vs PC (or Vi vs Emacs, if you remember those days). It’s not about comparing, it’s about using the right tool for the job. Story: Company was determined to use the same database for storing application data and implementing a complex security mechanism. Without even testing SQL, went straight for NoSQL, performance benchmarked read/write throughput and picked Couchbase. “Why didn’t you use SQL?” But of course, I didn’t say that, because I like my job. Should have used SQL + Caching + Graph. As it is, every security change leads to potentially a million updates. It works, because high throughput compensates for a lot. But wasted a lot of dev effort.
  • #6: Poll – how many people recognize 3, 5, 10 of these? How many people have actually used 3, 5, 10? Column = multiple proprietary databases: Sybase IQ, C-Store, etc. ColumnStore tables/indexes in MS SQL Server Row == partitioned row store. Some, like Hbase can also be used as a column store at the column family level, but that’s not the common use-case.
  • #7: Poll – how many people recognize 3, 5, 10 of these? How many people have actually used 3, 5, 10? Column = multiple proprietary databases: Sybase IQ, C-Store, etc. ColumnStore tables/indexes in MS SQL Server Row == partitioned row store. Some, like Hbase can also be used as a column store at the column family level, but that’s not the common use-case.
  • #9: Poll – how many people recognize 3, 5, 10 of these? How many people have actually used 3, 5, 10? Column = multiple proprietary databases: Sybase IQ, C-Store, etc. ColumnStore tables/indexes in MS SQL Server Row == partitioned row store. Some, like Hbase can also be used as a column store at the column family level, but that’s not the common use-case.
  • #10: Data encapsulated in documents A document is Encoded in some common format, often JSON Can often contain other documents No limit in depth Flexible schema Can index and retrieve documents by content Works well with OOP (no O-R impedance mismatch) Use when Complex application object model You don’t know the schema in advance The schema likely to change Challenges Complex join-like queries Self-referencing documents and circular dependencies
  • #11: Poll – how many people recognize 3, 5, 10 of these? How many people have actually used 3, 5, 10? Column = multiple proprietary databases: Sybase IQ, C-Store, etc. ColumnStore tables/indexes in MS SQL Server Row == partitioned row store. Some, like Hbase can also be used as a column store at the column family level, but that’s not the common use-case.
  • #13: Poll – how many people recognize 3, 5, 10 of these? How many people have actually used 3, 5, 10? Column = multiple proprietary databases: Sybase IQ, C-Store, etc. ColumnStore tables/indexes in MS SQL Server Row == partitioned row store. Some, like Hbase can also be used as a column store at the column family level, but that’s not the common use-case.
  • #14: In a table, data of the same column is stored together Storage is not wasted on null value as in row-based stores (RDBMS) Great for sparse tables Very fast column operation including aggregation Extreme compression for low-cardinality columns Use When Big Data (Excellent leverage of Map Reduce) Need compression or versioning Challenges You better know your access patterns before hand Keys design is not trivial
  • #15: Poll – how many people recognize 3, 5, 10 of these? How many people have actually used 3, 5, 10? Column = multiple proprietary databases: Sybase IQ, C-Store, etc. ColumnStore tables/indexes in MS SQL Server Row == partitioned row store. Some, like Hbase can also be used as a column store at the column family level, but that’s not the common use-case.
  • #16: Scaling – small example with 3 nodes, medium (10GB) example with a role based security graph, huge (1 trillion edges) example with facebook. Facebook blog about Apache Giraph - https://www.facebook.com/notes/facebook-engineering/scaling-apache-giraph-to-a-trillion-edges/10151617006153920 Sharding graphs is hard, so a compromise approach is to use cache sharding, i.e. consistent routing to make sure requests hit a warm cache. Neo4j query language (Cypher) emulates white-board graph sketches as ASCII art. Titan uses other databases for data storage and indexing (cassandra, hbase, berkleyDB) + (ES, Solr, Lucene). Query language (Gremlin) uses a chain of operations/functions (g.V().has('name', 'hercules').out('father').out('father').values('name’) ==> saturn Data is stored as a graph – nodes, edges, properties Perfect for highly interconnected data Allows for explicit relationships Fined grained graph traversal Flexible Often works well with OOP (object relationships) Use when You need to represent and query object relationships (e.g. Netflix movie suggestions) Challenges Harder to scale horizontally Harder to conceptualize
  • #17: Properties often associated with NoSQL databases are also being developed for relational databases. Clustering, HA, Non-relational data model. MySQL Cluster (Fabric - HA, Sharding) PostgreSQL JSON (Documents) Oracle RAC (Clustering) However, any criticism that can be leveled at new NoSQL databases, like being half-baked, simple, have high admin overhead can be equally applied to all the new NoSQL-like features of relational databases. They’re relatively complicated solutions, so beyond a certain level of pain it’s time to consider moving to a dedicated NoSQL database.
  • #18: What does CAP mean when the network is unreliable? Pick between CP and AP because CA assumes perfect network. In fact, several NoSQL databases claim to provide CA in their documentation – with an asterisk that assumes a “very stable” network. For a distributed computer system, it is impossible to provide all three of the following guarantees: Consistency (all components see the same data) Availability (every request receives a response) Partition tolerance (the system operates despite message loss or failure of some components) Relational databases generally provide C and sometimes A. For single-machine, P is irrelevant. For distributed SQL, same problems as with NoSQL apply. Aka. Brewster’s theorem, suggested by Eric Brewster from UC Berkley. The proof of the CAP theorem by Gilbert and Lynch is a bit narrower than that which Brewer had in mind. The theorem sets up a scenario in which a replicated service is presented with two conflicting requests arriving at distinct locations at a time when a link between them is failed. The obligation to provide availability despite partitioning failures leads the services to respond; at least one of these responses shall necessarily be inconsistent with what a service implementing a true one-copy replication semantic would have done. The researchers then go on to show that other forms of consistency are achievable, including a property they calleventual consistency. Thus the theorem doesn't rule out achieving consistency in a distributed system, and says nothing about cloud computing per se or about scalability.