SlideShare a Scribd company logo
2014 © Trivadis
BASEL BERN BRUGG LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA
2014 © Trivadis
SQL versus NoSQL
Guido Schmutz
Philipp Salvisberg
9th December 2014
SQL versus NoSQL
1
2014 © Trivadis
Guido Schmutz
 Working for Trivadis for more than 17 years
 Oracle ACE Director for Fusion Middleware and SOA
 Co-Author of different books
 Consultant, Trainer Software Architect for Java, Oracle, SOA and
Big Data / Fast Data
 Member of Trivadis Architecture Board
 Technology Manager @ Trivadis
 More than 25 years of software development
experience
 Contact: guido.schmutz@trivadis.com
 Blog: http://guidoschmutz.wordpress.com
 Twitter: gschmutz
9th December 2014
SQL versus NoSQL
2
2014 © Trivadis
Philipp Salvisberg
 With Trivadis since April 2000
 Senior Principal Consultant, Partner
 Member of the Board of Directors
 philipp.salvisberg@trivadis.com
 www.salvis.com/blog
 @phsalvisberg
 Main focus on database centric
development with Oracle database
 Application Development
 Business Intelligence
 Application Performance Management
 Over 20 years experience in using Oracle products
9th December 2014
SQL versus NoSQL
3
2014 © Trivadis
Agenda
1. Motivation
2. Overview of SQL and NoSQL Data Stores
3. Use Cases – Let's Get Ready to Rumble
4. Core Messages
9th December 2014
SQL versus NoSQL
4
2014 © Trivadis
Understanding the Merits
9th December 2014
SQL versus NoSQL
5
Why NoSQL?
Can do everything with RDBMSs!
Having performance, scalability,
transactions and SQL.
A key-value store is adequate for key
lookups and easier to understand than
a RDBMS.
RDBMSs do not scale as good as
NoSQL systems like Google’s
BigTable.
RDBMSs provide a common interface
with SQL, transactions, and relational
schema.
Some applications require a flexible
schema.
Adding new attributes at runtime in
RDBMSs is typically not possible.…
…
Source: Scalable SQL and NoSQL Data Stores, Rick Catell, 2010
2014 © Trivadis
Agenda
1. Motivation
2. Overview of SQL and NoSQL Data Stores
3. Use Cases – Let's Get Ready to Rumble
4. Conclusion
9th December 2014
SQL versus NoSQL
6
2014 © Trivadis
SQL Data Stores
 Relational Model
 Standardized, SQL:2011 is the 7th major revision since SQL-86
 9 parts, more than 4000 pages
 But no single database implements all standards/features
 Rich set of features
 Incl. SQL/PSM, SQL/MED, SQL/XML, SQL/RPR, Temporal Features
 Incl. User-defined Types and Collection Types (since SQL:1999)
 ACID Transactions
 Atomicity: all or nothing
 Consistency: from valid state to valid state considering constraints, triggers, …
 Isolation: result is not affected through concurrent execution
 Durability: committed data stays available after crash, power loss or errors
 Good support by different languages, frameworks and tools
 Good understanding of basic concepts by IT professionals
9th December 2014
SQL versus NoSQL
7
2014 © Trivadis
NoSQL Definition
 Next Generation Databases mostly addressing some of the points:
 being non-relational,
 distributed,
 open-source and
 horizontally scalable.
 Often more characteristics apply such as:
 schema-free,
 easy replication support,
 simple API,
 eventually consistent / BASE (not ACID),
 a huge amount of data
 and more.
 The misleading term "nosql" (the community now translates it mostly with
"not only sql") should be seen as an alias to something like the definition
above
9th December 2014
SQL versus NoSQL
8
Source: http://nosql-database.org
BASE
 Basically Available: Availability is
more important than consistency
 Soft State: Higher availability results
in an eventual consistent state
 Eventually Consistent: If no new
updates are made to a given data
item, eventually all accesses to that
item will return the last updated
value
2014 © Trivadis
Brewer's CAP Theorem
Any networked shared-data system can have at most two of the three
desirable properties:
 Consistency
All of the nodes see the same data at
the same time, regardless of
where the data is stored
 Availability
Node failures do not prevent
survivors from continuing to
operate
 Network Partition tolerance
The system continues to operate
despite arbitrary message loss
9th December 2014
SQL versus NoSQL
9
Availability
Consistency
Network
Partition
Tolerance
n/a
CA CP
AP
2014 © Trivadis
Data Store Positioning
9th December 2014
SQL versus NoSQL
10
Scalability
Standardized Model, Tooling, Complexity
Key-value
Wide Column (Column Families / Extensible Records)
Document
Graph
Relational
SQL Comfort Zone
Multi Dimensional
2014 © Trivadis
Agenda
1. Motivation
2. Overview of SQL and NoSQL Data Stores
3. Use Cases – Let's Get Ready to Rumble
4. Core Messages
9th December 2014
SQL versus NoSQL
11
2014 © Trivadis
9th December 2014
SQL versus NoSQL
12
Round 1
Smart Meter
2014 © Trivadis
Smart Meter – Customer Dashboard
9th December 2014
SQL versus NoSQL
13
2014 © Trivadis
Smart Meter – Use Cases
 Store sensor and its
sub-sensor values
 2 Mio sensors, up to 10 sub-sensors
 Energy consumption per second per sensor (kWh)
 Delivery interval between 1 second and 5 minutes
 Query usage per sensor and its
sub-sensors to visualize a
time series on a customer dashboard
 Available in different granularities, values are aggregated in
- Minute
- Quarter of hour (15-minutes)
- Hour
- Day
 Responsive UI
9th December 2014
SQL versus NoSQL
14
Smart Meter
Store data of
millions of
sensors
Household
Dashboard
2014 © Trivadis
Cassandra NoSQL Datastore
• Wide-Column Store
• Developed at Facebook
• Professional grade support from DataStax
• Main Features
 Real-Time
 Highly Distributed
 Support for Multiple Data Center
 Highly Scalable
 No Single Point of Failure
 Fault Tolerant
 Tunable Consistency
 CQL – Cassandra Query
Language
9th December 2014
SQL versus NoSQL
15
2014 © Trivadis
The Wide Column Store Way (Cassandra)
9th December 2014
SQL versus NoSQL
16
Household Bucket
AFG10 MINUTE-2014/03/5 sensor 1 1 1 … 2 2 …
at 11:59 11:58 11:57 … 11:59 11:58 …
kwh 7.05 7.10 8.11 … 6.95 7.04 …
AFG10 QHOUR-2014/03 sensor 1 1 1 … 2 2 …
at 5T11:4
5
5T11:3
0
5T11:1
5
… 5T11:4
5
5T11:3
0
…
kwh 105.78 104.73 102.29 … 102.78 101.61 …
AFG10 HOUR-2014/03 sensor 1 1 1 … 2 2 …
at 5T11 5T10 5T09 … 5T11 5T10 …
kwh 423.00 410.33 395.99 … 598.32 522.12 …
AFG10 DAY-2014 sensor 1 1 1 … 2 2 …
at 5T 3T 2T … 5T 4T …
kwh 10100.2 9892.2 8987.4 … 879.8 912,3 …
GXK11 MINUTE-2014/03/5 sensor 1 1 1 … 2 2 …
at 11:59 11:03 11:04 … 11:01 11:02 …
kwh 100.10 90.88 95.00 … 92.50 88.50 …
Growth
24h * 60m * 11 sensor = 15’840 cols
30d * 24h * 4q * 11 sensor = 31’680 cols
30d * 24h * 11 sensor = 7’920 cols
365d * 11 sensor = 4’011 cols
2014 © Trivadis
The Cassandra Way
9th December 2014
SQL versus NoSQL
17
 288 nodes on EC2
 Over 1 Mio writes/sec => 60Mio writes/min
 Rolling counters, always up to date
2014 © Trivadis
Relational Architecture
 Active Data Guard Configuration
 Global Data Services redirects
requests based on
 Server loads
 Request type (read/write)
 Reader farm is geographically
spread
 Failover/switchover to any node in
the reader farm is possible
 Read services are not affected
 Write services are unavailable for a
short period of time
 Scalability of the write services is
the bottleneck of the system
9th December 2014
SQL versus NoSQL
18
Global Data Services
Client
Read/Write Read-only Read-only Read-only
Sensor Sensor
2014 © Trivadis
Relational Data Model
 SENSOR_READINGS_...
 Index-organized tables
 Daily partitions
 JDBC Batch Merges
 A transaction per sensor delivery
 A single network roundtrip to merge 55
readings of a sensor delivery
 Average between
- 0.4 Mio tpm (delivery per 5 minutes)
- 120 Mio tpm (delivery per second)
 Top TPC-C Benchmark: 8.5 Mio tpm
 Batch job to aggregate readings every
15 minutes, avoiding intermediate
results (updates)
 Quarter of hour (5760 times a day)
 Hour (24 times a day)
 Day (once a day)
9th December 2014
SQL versus NoSQL
19
2014 © Trivadis
Query Sensor Data – The SQL Way
MERGE INTO sensor_readings_minute t
USING (SELECT sensor_id, TRUNC(start_time, 'MI') AS start_time,
usage_kwh FROM TABLE(:p_sensor_data_list)) s
ON (t.sensor_id = s.sensor_id AND t.start_time = s.start_time)
WHEN NOT MATCHED THEN
INSERT (t.sensor_id, t.start_time, t.usage_kwh)
VALUES (s.sensor_id, s.start_time, s.usage_kwh)
WHEN MATCHED THEN
UPDATE SET t.usage_kwh = t.usage_kwh + s.usage_kwh;
9th December 2014
SQL versus NoSQL
20
SELECT sensor_id, start_time, usage_kwh
FROM sensor_readings_minute
WHERE sensor_id = :p_sensor_id
AND start_time BETWEEN :p_from AND :p_to
ORDER BY sensor_id, start_time;
Use aggregate tables to change granularity (quarter of hours, hours, days)
2014 © Trivadis
9th December 2014
SQL versus NoSQL
21
Smart Meter
0 – 1
2014 © Trivadis
9th December 2014
SQL versus NoSQL
22
Round 2
Order Entry
2014 © Trivadis
Order Entry – Example
9th December 2014
SQL versus NoSQL
23
2014 © Trivadis
Order Entry – Use Cases
 Update the quantity in stock of
all ordered products
 When order status changes
from "incomplete" to "complete"
 When order status changes
from "complete" to "cancelled"
 Ensure that the quantity in stock is always correct (no lost updates or similar)
 Create a report for the 5 top-selling products for a year
9th December 2014
SQL versus NoSQL
24
Order Entry
Update
quantity in
stock
Top 5
selling
products
2014 © Trivadis
Relational Model
9th December 2014
SQL versus NoSQL
25
2014 © Trivadis
Change Quantity in Stock – The SQL Way
Single Transaction
UPDATE ORDERS
SET order_status = :p_value_for_complete
WHERE order_id = :p_order_id;
MERGE INTO PRODUCTS t
USING (SELECT product_id,
SUM(quantity) AS quantity
FROM order_items
WHERE order_id = :p_order_id
GROUP BY product_id) s
ON (t.product_id = s.product_id)
WHEN MATCHED THEN
UPDATE SET t.quantity_on_stock =
t.quantity_on_stock - s.quantity;
COMMIT;
9th December 2014
SQL versus NoSQL
26
2014 © Trivadis
5 Top-Selling Products – The SQL Way
SELECT p.name AS product_name,
SUM(i.quantity * i.unit_price) AS sales_volume
FROM order_items i
INNER JOIN orders o
ON o.order_id = i.order_id
INNER JOIN products p
ON p.product_id = i.product_id
WHERE o.order_date > DATE '2013-01-01'
AND o.order_date <= DATE '2014-01-01'
AND o.order_status = :p_value_for_complete
GROUP BY p. name
ORDER BY 2 DESC
FETCH FIRST 5 ROWS WITH TIES;
9th December 2014
SQL versus NoSQL
27
2014 © Trivadis
Customer
MongoDB Document Data Model (Aggregate Pattern)
9th December 2014
SQL versus NoSQL
28
Order
Order Items
Order Item 1
Order Item 2
Order Item n
Shipping Address
Billing Address
Product
Category
Suppliers
Supplier 1
Address
Supplier n
Address
Supplier 1
Address
Address
2014 © Trivadis
Update Quantity in Stock – The MongoDB Way
ForEach orderItems.item {
db.products.update( { productId : 101 },
{ $inc : { quantity: -10 } },
{ multi: false }
);
}
9th December 2014
SQL versus NoSQL
29
db.orders.find ( { orderId: 1} );
db.orders.update( { orderId: 1},
{ $set : { orderStatus: "COMPLETE" } },
{ multi: false } );
Transaction 1
Read Operation
Transaction 2 .. n
2014 © Trivadis
5 Top-Selling Products – The MongoDB Way
db.orders.aggregate([
{ $match : {
orderStatus: "COMPLETE",
orderDate: { $gt: ISODate("2014-01-01"),
$lt: ISODate("2014-04-01") }
} },
{ $unwind : "$orderItems" },
{ $project : { _id: 0,
productId: "$orderItems.productId",
total : { $multiply : ["$orderItems.quantity",
"$orderItems.unitPrice”] }
} },
{ $group : { _id: "$productId",
total : { $sum : "$total"} } },
{ $sort : { total: -1 }},
{ $limit : 5 }
])
9th December 2014
SQL versus NoSQL
30
2014 © Trivadis
9th December 2014
SQL versus NoSQL
31
Order Entry
1 – 1
2014 © Trivadis
9th December 2014
SQL versus NoSQL
32
Round 3
Spotify
2014 © Trivadis
Spotify – Example
9th December 2014
SQL versus NoSQL
33
2014 © Trivadis
Spotify – Use Cases
 Playlist, Showing Ads, Following Artists …
are all uses cases which have to be
highly available, and accessible worldwide
 Needs to be distributed to be fast
 Service should be available even if a partition happen (due to network
failure/machine failure)
 First time subscription and subscription renewal must be absolutely
consistent
 Customer should only pay once!
9th December 2014
SQL versus NoSQL
34
Spotify
Renewals
(payments)
Globally
available
playlists
2014 © Trivadis
Polyglot Persistence – SQL And NoSQL
9th December 2014
SQL versus NoSQL
35
Spotify Platform
Playlists, Ads,
Followings
Subscriptions
and Payments
Wide-column
store RDBMS
2014 © Trivadis
9th December 2014
SQL versus NoSQL
36
Spotify
2 – 2
Draw!
2014 © Trivadis
Agenda
1. Motivation
2. Overview of SQL and NoSQL Data Stores
3. Use Cases – Let's Get Ready to Rumble
4. Core Messages
9th December 2014
SQL versus NoSQL
37
2014 © Trivadis
Core Messages
 We will see a major consolation
in the NoSQL area
 SQL is and stays important
 Polyglot persistence will be part
of every solution design in the
near future
 Enterprise capabilities are
required
 Tooling (monitoring, backup &
recovery, data security, …)
 Organization, skills
 Opportunity for cloud based
solutions
9th December 2014
SQL versus NoSQL
38
2014 © Trivadis
Questions and answers ...
2014 © Trivadis
BASEL BERN BRUGES LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA
Guido Schmutz
Technology Manager
Philipp Salvisberg
Senior Principal Consultant
9th December 2014
SQL versus NoSQL
39
2014 © Trivadis
Further information ...
9th December 2014
SQL versus NoSQL
40
 http://martinfowler.com/books/nosql.html
 http://www.manning.com/mccreary/
 http://highlyscalable.wordpress.com
 http://nosql-database.org
 http://db-engines.com/

More Related Content

PDF
Oracle Panel: Expert Insights into Faster Oracle SOA Suite Project Delivery
Guido Schmutz
 
PDF
Introduction to Streaming Analytics
Guido Schmutz
 
PDF
Processing Twitter Events in Real-Time with Oracle Event Processing (OEP) 12c
Guido Schmutz
 
PDF
Big Data Architectures @ JAX / BigDataCon 2016
Guido Schmutz
 
PDF
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
DataStax Academy
 
PDF
Introduction to Streaming Analytics
Guido Schmutz
 
PDF
Unified Log Processing Architecture
Guido Schmutz
 
PPTX
Fast Data: A Customer’s Journey to Delivering a Compelling Real-Time Solution
Guido Schmutz
 
Oracle Panel: Expert Insights into Faster Oracle SOA Suite Project Delivery
Guido Schmutz
 
Introduction to Streaming Analytics
Guido Schmutz
 
Processing Twitter Events in Real-Time with Oracle Event Processing (OEP) 12c
Guido Schmutz
 
Big Data Architectures @ JAX / BigDataCon 2016
Guido Schmutz
 
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
DataStax Academy
 
Introduction to Streaming Analytics
Guido Schmutz
 
Unified Log Processing Architecture
Guido Schmutz
 
Fast Data: A Customer’s Journey to Delivering a Compelling Real-Time Solution
Guido Schmutz
 

What's hot (20)

PDF
Real Time Analytics with Apache Cassandra - Cassandra Day Berlin
Guido Schmutz
 
PDF
Real Time Analytics with Apache Cassandra - Cassandra Day Munich
Guido Schmutz
 
PDF
Reliable Data Intestion in BigData / IoT
Guido Schmutz
 
PDF
Big Data and Fast Data - Lambda Architecture in Action
Guido Schmutz
 
PDF
Internet of Things - Are traditional architectures good enough?
Guido Schmutz
 
PDF
Azure + DataStax Enterprise Powers Office 365 Per User Store
DataStax Academy
 
PDF
Blueprints for the analysis of social media
Guido Schmutz
 
PDF
Oracle Stream Explorer - Simplifying Event/Stream Processing
Guido Schmutz
 
PDF
Lambda at Weather Scale - Cassandra Summit 2015
Robbie Strickland
 
PDF
British Gas Connected Homes: Data Engineering
DataStax Academy
 
PDF
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
aaronmorton
 
PDF
Proofpoint: Fraud Detection and Security on Social Media
DataStax Academy
 
PDF
Capital One: Using Cassandra In Building A Reporting Platform
DataStax Academy
 
PPTX
DataStax C*ollege Credit: What and Why NoSQL?
DataStax
 
PPTX
ProtectWise Revolutionizes Enterprise Network Security in the Cloud with Data...
DataStax Academy
 
PDF
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
DataWorks Summit
 
PDF
A Microservice Architecture for Big Data Pipelines
Daniel Mescheder
 
PPTX
Real time big data stream processing
Luay AL-Assadi
 
PDF
Streaming Analytics
Neera Agarwal
 
PDF
Architektur von Big Data Lösungen
Guido Schmutz
 
Real Time Analytics with Apache Cassandra - Cassandra Day Berlin
Guido Schmutz
 
Real Time Analytics with Apache Cassandra - Cassandra Day Munich
Guido Schmutz
 
Reliable Data Intestion in BigData / IoT
Guido Schmutz
 
Big Data and Fast Data - Lambda Architecture in Action
Guido Schmutz
 
Internet of Things - Are traditional architectures good enough?
Guido Schmutz
 
Azure + DataStax Enterprise Powers Office 365 Per User Store
DataStax Academy
 
Blueprints for the analysis of social media
Guido Schmutz
 
Oracle Stream Explorer - Simplifying Event/Stream Processing
Guido Schmutz
 
Lambda at Weather Scale - Cassandra Summit 2015
Robbie Strickland
 
British Gas Connected Homes: Data Engineering
DataStax Academy
 
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
aaronmorton
 
Proofpoint: Fraud Detection and Security on Social Media
DataStax Academy
 
Capital One: Using Cassandra In Building A Reporting Platform
DataStax Academy
 
DataStax C*ollege Credit: What and Why NoSQL?
DataStax
 
ProtectWise Revolutionizes Enterprise Network Security in the Cloud with Data...
DataStax Academy
 
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
DataWorks Summit
 
A Microservice Architecture for Big Data Pipelines
Daniel Mescheder
 
Real time big data stream processing
Luay AL-Assadi
 
Streaming Analytics
Neera Agarwal
 
Architektur von Big Data Lösungen
Guido Schmutz
 
Ad

Viewers also liked (20)

PPTX
Sql vs NoSQL
RTigger
 
PDF
SQL vs. NoSQL Databases
Osama Jomaa
 
PPT
No sql or Not only SQL
Ajay Jha
 
PPTX
NoSQL Databases for Implementing Data Services – Should I Care?
Guido Schmutz
 
PDF
SQL vs. NoSQL
Guido Schmutz
 
PDF
CouchDB
Rashmi Agale
 
PPTX
Sql vs. NoSql
Chuong Mai
 
PPSX
Presentacion BD NoSQL
Andrea Antunes
 
PDF
Query Languages for Document Stores
InteractiveCologne
 
PPTX
Sgbd comerciales vs libres
Madai Angeles
 
PPTX
MySQL vs. NoSQL and NewSQL - survey results
Matthew Aslett
 
PDF
REST APIs for the Internet of Things
Michael Koster
 
PDF
Intro to column stores
Justin Swanhart
 
PPTX
NoSQL databases, the CAP theorem, and the theory of relativity
Lars Marius Garshol
 
ZIP
NoSQL databases
Harri Kauhanen
 
PDF
Query mechanisms for NoSQL databases
ArangoDB Database
 
PDF
Bases de Datos No Relacionales (NoSQL): Cassandra, CouchDB, MongoDB y Neo4j
Diego López-de-Ipiña González-de-Artaza
 
PDF
Cassandra NoSQL Tutorial
Michelle Darling
 
PPTX
Introduction to NoSQL Databases
Derek Stainer
 
PPTX
10 sistemas gestores de base de datos
Gusttavo Nipas
 
Sql vs NoSQL
RTigger
 
SQL vs. NoSQL Databases
Osama Jomaa
 
No sql or Not only SQL
Ajay Jha
 
NoSQL Databases for Implementing Data Services – Should I Care?
Guido Schmutz
 
SQL vs. NoSQL
Guido Schmutz
 
CouchDB
Rashmi Agale
 
Sql vs. NoSql
Chuong Mai
 
Presentacion BD NoSQL
Andrea Antunes
 
Query Languages for Document Stores
InteractiveCologne
 
Sgbd comerciales vs libres
Madai Angeles
 
MySQL vs. NoSQL and NewSQL - survey results
Matthew Aslett
 
REST APIs for the Internet of Things
Michael Koster
 
Intro to column stores
Justin Swanhart
 
NoSQL databases, the CAP theorem, and the theory of relativity
Lars Marius Garshol
 
NoSQL databases
Harri Kauhanen
 
Query mechanisms for NoSQL databases
ArangoDB Database
 
Bases de Datos No Relacionales (NoSQL): Cassandra, CouchDB, MongoDB y Neo4j
Diego López-de-Ipiña González-de-Artaza
 
Cassandra NoSQL Tutorial
Michelle Darling
 
Introduction to NoSQL Databases
Derek Stainer
 
10 sistemas gestores de base de datos
Gusttavo Nipas
 
Ad

Similar to SQL vs. NoSQL (20)

PPTX
No SQL
The lazy hoplite
 
PDF
SQL vs NoSQL deep dive
Ahmed Shaaban
 
PPT
NoSQL Seminer
Partha Das
 
PPT
No SQL Databases as modern database concepts
debasisdas225831
 
PPTX
Sql vs nosql
Nick Verschueren
 
PPTX
No sql database
vishal gupta
 
PPT
No SQL Databases.ppt
ssuser8c8fc1
 
PPT
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
sankarapu posibabu
 
PPT
05 No SQL Sudarshan.ppt
AnandKonj1
 
PPTX
NoSQLDatabases
Adi Challa
 
PPTX
NoSQL with Microsoft Azure
Khalid Salama
 
PDF
B.Vinithamani,II-M.sc.,Computer science,Bon Secours college for women,thanjavur.
vinithamaniB
 
PPTX
The Rise of NoSQL and Polyglot Persistence
Abdelmonaim Remani
 
PPTX
NoSQL in Big Data Analytics Tools .pptx
Shadia Afrin
 
PPT
NoSQL - 05March2014 Seminar
Jainul Musani
 
PDF
Vargas polyglot-persistence-cloud-edbt
Genoveva Vargas-Solar
 
PDF
Data analytics with NOSQL
Mukundan Agaram
 
PPT
No sql
Murat Çakal
 
PPTX
NoSQL(NOT ONLY SQL)
Rahul P
 
PPTX
Relational databases vs Non-relational databases
James Serra
 
SQL vs NoSQL deep dive
Ahmed Shaaban
 
NoSQL Seminer
Partha Das
 
No SQL Databases as modern database concepts
debasisdas225831
 
Sql vs nosql
Nick Verschueren
 
No sql database
vishal gupta
 
No SQL Databases.ppt
ssuser8c8fc1
 
No SQL Databases sdfghjkl;sdfghjkl;sdfghjkl;'
sankarapu posibabu
 
05 No SQL Sudarshan.ppt
AnandKonj1
 
NoSQLDatabases
Adi Challa
 
NoSQL with Microsoft Azure
Khalid Salama
 
B.Vinithamani,II-M.sc.,Computer science,Bon Secours college for women,thanjavur.
vinithamaniB
 
The Rise of NoSQL and Polyglot Persistence
Abdelmonaim Remani
 
NoSQL in Big Data Analytics Tools .pptx
Shadia Afrin
 
NoSQL - 05March2014 Seminar
Jainul Musani
 
Vargas polyglot-persistence-cloud-edbt
Genoveva Vargas-Solar
 
Data analytics with NOSQL
Mukundan Agaram
 
No sql
Murat Çakal
 
NoSQL(NOT ONLY SQL)
Rahul P
 
Relational databases vs Non-relational databases
James Serra
 

More from Guido Schmutz (20)

PDF
30 Minutes to the Analytics Platform with Infrastructure as Code
Guido Schmutz
 
PDF
Event Broker (Kafka) in a Modern Data Architecture
Guido Schmutz
 
PDF
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Guido Schmutz
 
PDF
ksqlDB - Stream Processing simplified!
Guido Schmutz
 
PDF
Kafka as your Data Lake - is it Feasible?
Guido Schmutz
 
PDF
Event Hub (i.e. Kafka) in Modern Data Architecture
Guido Schmutz
 
PDF
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Guido Schmutz
 
PDF
Event Hub (i.e. Kafka) in Modern Data (Analytics) Architecture
Guido Schmutz
 
PDF
Building Event Driven (Micro)services with Apache Kafka
Guido Schmutz
 
PDF
Location Analytics - Real-Time Geofencing using Apache Kafka
Guido Schmutz
 
PDF
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafka
Guido Schmutz
 
PDF
What is Apache Kafka? Why is it so popular? Should I use it?
Guido Schmutz
 
PDF
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Guido Schmutz
 
PDF
Location Analytics Real-Time Geofencing using Kafka
Guido Schmutz
 
PDF
Streaming Visualisation
Guido Schmutz
 
PDF
Kafka as an event store - is it good enough?
Guido Schmutz
 
PDF
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Guido Schmutz
 
PDF
Fundamentals Big Data and AI Architecture
Guido Schmutz
 
PDF
Location Analytics - Real-Time Geofencing using Kafka
Guido Schmutz
 
PDF
Streaming Visualization
Guido Schmutz
 
30 Minutes to the Analytics Platform with Infrastructure as Code
Guido Schmutz
 
Event Broker (Kafka) in a Modern Data Architecture
Guido Schmutz
 
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Guido Schmutz
 
ksqlDB - Stream Processing simplified!
Guido Schmutz
 
Kafka as your Data Lake - is it Feasible?
Guido Schmutz
 
Event Hub (i.e. Kafka) in Modern Data Architecture
Guido Schmutz
 
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Guido Schmutz
 
Event Hub (i.e. Kafka) in Modern Data (Analytics) Architecture
Guido Schmutz
 
Building Event Driven (Micro)services with Apache Kafka
Guido Schmutz
 
Location Analytics - Real-Time Geofencing using Apache Kafka
Guido Schmutz
 
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafka
Guido Schmutz
 
What is Apache Kafka? Why is it so popular? Should I use it?
Guido Schmutz
 
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Guido Schmutz
 
Location Analytics Real-Time Geofencing using Kafka
Guido Schmutz
 
Streaming Visualisation
Guido Schmutz
 
Kafka as an event store - is it good enough?
Guido Schmutz
 
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Guido Schmutz
 
Fundamentals Big Data and AI Architecture
Guido Schmutz
 
Location Analytics - Real-Time Geofencing using Kafka
Guido Schmutz
 
Streaming Visualization
Guido Schmutz
 

Recently uploaded (20)

PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Software Development Methodologies in 2025
KodekX
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
The Future of Artificial Intelligence (AI)
Mukul
 

SQL vs. NoSQL

  • 1. 2014 © Trivadis BASEL BERN BRUGG LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA 2014 © Trivadis SQL versus NoSQL Guido Schmutz Philipp Salvisberg 9th December 2014 SQL versus NoSQL 1
  • 2. 2014 © Trivadis Guido Schmutz  Working for Trivadis for more than 17 years  Oracle ACE Director for Fusion Middleware and SOA  Co-Author of different books  Consultant, Trainer Software Architect for Java, Oracle, SOA and Big Data / Fast Data  Member of Trivadis Architecture Board  Technology Manager @ Trivadis  More than 25 years of software development experience  Contact: [email protected]  Blog: http://guidoschmutz.wordpress.com  Twitter: gschmutz 9th December 2014 SQL versus NoSQL 2
  • 3. 2014 © Trivadis Philipp Salvisberg  With Trivadis since April 2000  Senior Principal Consultant, Partner  Member of the Board of Directors  [email protected]  www.salvis.com/blog  @phsalvisberg  Main focus on database centric development with Oracle database  Application Development  Business Intelligence  Application Performance Management  Over 20 years experience in using Oracle products 9th December 2014 SQL versus NoSQL 3
  • 4. 2014 © Trivadis Agenda 1. Motivation 2. Overview of SQL and NoSQL Data Stores 3. Use Cases – Let's Get Ready to Rumble 4. Core Messages 9th December 2014 SQL versus NoSQL 4
  • 5. 2014 © Trivadis Understanding the Merits 9th December 2014 SQL versus NoSQL 5 Why NoSQL? Can do everything with RDBMSs! Having performance, scalability, transactions and SQL. A key-value store is adequate for key lookups and easier to understand than a RDBMS. RDBMSs do not scale as good as NoSQL systems like Google’s BigTable. RDBMSs provide a common interface with SQL, transactions, and relational schema. Some applications require a flexible schema. Adding new attributes at runtime in RDBMSs is typically not possible.… … Source: Scalable SQL and NoSQL Data Stores, Rick Catell, 2010
  • 6. 2014 © Trivadis Agenda 1. Motivation 2. Overview of SQL and NoSQL Data Stores 3. Use Cases – Let's Get Ready to Rumble 4. Conclusion 9th December 2014 SQL versus NoSQL 6
  • 7. 2014 © Trivadis SQL Data Stores  Relational Model  Standardized, SQL:2011 is the 7th major revision since SQL-86  9 parts, more than 4000 pages  But no single database implements all standards/features  Rich set of features  Incl. SQL/PSM, SQL/MED, SQL/XML, SQL/RPR, Temporal Features  Incl. User-defined Types and Collection Types (since SQL:1999)  ACID Transactions  Atomicity: all or nothing  Consistency: from valid state to valid state considering constraints, triggers, …  Isolation: result is not affected through concurrent execution  Durability: committed data stays available after crash, power loss or errors  Good support by different languages, frameworks and tools  Good understanding of basic concepts by IT professionals 9th December 2014 SQL versus NoSQL 7
  • 8. 2014 © Trivadis NoSQL Definition  Next Generation Databases mostly addressing some of the points:  being non-relational,  distributed,  open-source and  horizontally scalable.  Often more characteristics apply such as:  schema-free,  easy replication support,  simple API,  eventually consistent / BASE (not ACID),  a huge amount of data  and more.  The misleading term "nosql" (the community now translates it mostly with "not only sql") should be seen as an alias to something like the definition above 9th December 2014 SQL versus NoSQL 8 Source: http://nosql-database.org BASE  Basically Available: Availability is more important than consistency  Soft State: Higher availability results in an eventual consistent state  Eventually Consistent: If no new updates are made to a given data item, eventually all accesses to that item will return the last updated value
  • 9. 2014 © Trivadis Brewer's CAP Theorem Any networked shared-data system can have at most two of the three desirable properties:  Consistency All of the nodes see the same data at the same time, regardless of where the data is stored  Availability Node failures do not prevent survivors from continuing to operate  Network Partition tolerance The system continues to operate despite arbitrary message loss 9th December 2014 SQL versus NoSQL 9 Availability Consistency Network Partition Tolerance n/a CA CP AP
  • 10. 2014 © Trivadis Data Store Positioning 9th December 2014 SQL versus NoSQL 10 Scalability Standardized Model, Tooling, Complexity Key-value Wide Column (Column Families / Extensible Records) Document Graph Relational SQL Comfort Zone Multi Dimensional
  • 11. 2014 © Trivadis Agenda 1. Motivation 2. Overview of SQL and NoSQL Data Stores 3. Use Cases – Let's Get Ready to Rumble 4. Core Messages 9th December 2014 SQL versus NoSQL 11
  • 12. 2014 © Trivadis 9th December 2014 SQL versus NoSQL 12 Round 1 Smart Meter
  • 13. 2014 © Trivadis Smart Meter – Customer Dashboard 9th December 2014 SQL versus NoSQL 13
  • 14. 2014 © Trivadis Smart Meter – Use Cases  Store sensor and its sub-sensor values  2 Mio sensors, up to 10 sub-sensors  Energy consumption per second per sensor (kWh)  Delivery interval between 1 second and 5 minutes  Query usage per sensor and its sub-sensors to visualize a time series on a customer dashboard  Available in different granularities, values are aggregated in - Minute - Quarter of hour (15-minutes) - Hour - Day  Responsive UI 9th December 2014 SQL versus NoSQL 14 Smart Meter Store data of millions of sensors Household Dashboard
  • 15. 2014 © Trivadis Cassandra NoSQL Datastore • Wide-Column Store • Developed at Facebook • Professional grade support from DataStax • Main Features  Real-Time  Highly Distributed  Support for Multiple Data Center  Highly Scalable  No Single Point of Failure  Fault Tolerant  Tunable Consistency  CQL – Cassandra Query Language 9th December 2014 SQL versus NoSQL 15
  • 16. 2014 © Trivadis The Wide Column Store Way (Cassandra) 9th December 2014 SQL versus NoSQL 16 Household Bucket AFG10 MINUTE-2014/03/5 sensor 1 1 1 … 2 2 … at 11:59 11:58 11:57 … 11:59 11:58 … kwh 7.05 7.10 8.11 … 6.95 7.04 … AFG10 QHOUR-2014/03 sensor 1 1 1 … 2 2 … at 5T11:4 5 5T11:3 0 5T11:1 5 … 5T11:4 5 5T11:3 0 … kwh 105.78 104.73 102.29 … 102.78 101.61 … AFG10 HOUR-2014/03 sensor 1 1 1 … 2 2 … at 5T11 5T10 5T09 … 5T11 5T10 … kwh 423.00 410.33 395.99 … 598.32 522.12 … AFG10 DAY-2014 sensor 1 1 1 … 2 2 … at 5T 3T 2T … 5T 4T … kwh 10100.2 9892.2 8987.4 … 879.8 912,3 … GXK11 MINUTE-2014/03/5 sensor 1 1 1 … 2 2 … at 11:59 11:03 11:04 … 11:01 11:02 … kwh 100.10 90.88 95.00 … 92.50 88.50 … Growth 24h * 60m * 11 sensor = 15’840 cols 30d * 24h * 4q * 11 sensor = 31’680 cols 30d * 24h * 11 sensor = 7’920 cols 365d * 11 sensor = 4’011 cols
  • 17. 2014 © Trivadis The Cassandra Way 9th December 2014 SQL versus NoSQL 17  288 nodes on EC2  Over 1 Mio writes/sec => 60Mio writes/min  Rolling counters, always up to date
  • 18. 2014 © Trivadis Relational Architecture  Active Data Guard Configuration  Global Data Services redirects requests based on  Server loads  Request type (read/write)  Reader farm is geographically spread  Failover/switchover to any node in the reader farm is possible  Read services are not affected  Write services are unavailable for a short period of time  Scalability of the write services is the bottleneck of the system 9th December 2014 SQL versus NoSQL 18 Global Data Services Client Read/Write Read-only Read-only Read-only Sensor Sensor
  • 19. 2014 © Trivadis Relational Data Model  SENSOR_READINGS_...  Index-organized tables  Daily partitions  JDBC Batch Merges  A transaction per sensor delivery  A single network roundtrip to merge 55 readings of a sensor delivery  Average between - 0.4 Mio tpm (delivery per 5 minutes) - 120 Mio tpm (delivery per second)  Top TPC-C Benchmark: 8.5 Mio tpm  Batch job to aggregate readings every 15 minutes, avoiding intermediate results (updates)  Quarter of hour (5760 times a day)  Hour (24 times a day)  Day (once a day) 9th December 2014 SQL versus NoSQL 19
  • 20. 2014 © Trivadis Query Sensor Data – The SQL Way MERGE INTO sensor_readings_minute t USING (SELECT sensor_id, TRUNC(start_time, 'MI') AS start_time, usage_kwh FROM TABLE(:p_sensor_data_list)) s ON (t.sensor_id = s.sensor_id AND t.start_time = s.start_time) WHEN NOT MATCHED THEN INSERT (t.sensor_id, t.start_time, t.usage_kwh) VALUES (s.sensor_id, s.start_time, s.usage_kwh) WHEN MATCHED THEN UPDATE SET t.usage_kwh = t.usage_kwh + s.usage_kwh; 9th December 2014 SQL versus NoSQL 20 SELECT sensor_id, start_time, usage_kwh FROM sensor_readings_minute WHERE sensor_id = :p_sensor_id AND start_time BETWEEN :p_from AND :p_to ORDER BY sensor_id, start_time; Use aggregate tables to change granularity (quarter of hours, hours, days)
  • 21. 2014 © Trivadis 9th December 2014 SQL versus NoSQL 21 Smart Meter 0 – 1
  • 22. 2014 © Trivadis 9th December 2014 SQL versus NoSQL 22 Round 2 Order Entry
  • 23. 2014 © Trivadis Order Entry – Example 9th December 2014 SQL versus NoSQL 23
  • 24. 2014 © Trivadis Order Entry – Use Cases  Update the quantity in stock of all ordered products  When order status changes from "incomplete" to "complete"  When order status changes from "complete" to "cancelled"  Ensure that the quantity in stock is always correct (no lost updates or similar)  Create a report for the 5 top-selling products for a year 9th December 2014 SQL versus NoSQL 24 Order Entry Update quantity in stock Top 5 selling products
  • 25. 2014 © Trivadis Relational Model 9th December 2014 SQL versus NoSQL 25
  • 26. 2014 © Trivadis Change Quantity in Stock – The SQL Way Single Transaction UPDATE ORDERS SET order_status = :p_value_for_complete WHERE order_id = :p_order_id; MERGE INTO PRODUCTS t USING (SELECT product_id, SUM(quantity) AS quantity FROM order_items WHERE order_id = :p_order_id GROUP BY product_id) s ON (t.product_id = s.product_id) WHEN MATCHED THEN UPDATE SET t.quantity_on_stock = t.quantity_on_stock - s.quantity; COMMIT; 9th December 2014 SQL versus NoSQL 26
  • 27. 2014 © Trivadis 5 Top-Selling Products – The SQL Way SELECT p.name AS product_name, SUM(i.quantity * i.unit_price) AS sales_volume FROM order_items i INNER JOIN orders o ON o.order_id = i.order_id INNER JOIN products p ON p.product_id = i.product_id WHERE o.order_date > DATE '2013-01-01' AND o.order_date <= DATE '2014-01-01' AND o.order_status = :p_value_for_complete GROUP BY p. name ORDER BY 2 DESC FETCH FIRST 5 ROWS WITH TIES; 9th December 2014 SQL versus NoSQL 27
  • 28. 2014 © Trivadis Customer MongoDB Document Data Model (Aggregate Pattern) 9th December 2014 SQL versus NoSQL 28 Order Order Items Order Item 1 Order Item 2 Order Item n Shipping Address Billing Address Product Category Suppliers Supplier 1 Address Supplier n Address Supplier 1 Address Address
  • 29. 2014 © Trivadis Update Quantity in Stock – The MongoDB Way ForEach orderItems.item { db.products.update( { productId : 101 }, { $inc : { quantity: -10 } }, { multi: false } ); } 9th December 2014 SQL versus NoSQL 29 db.orders.find ( { orderId: 1} ); db.orders.update( { orderId: 1}, { $set : { orderStatus: "COMPLETE" } }, { multi: false } ); Transaction 1 Read Operation Transaction 2 .. n
  • 30. 2014 © Trivadis 5 Top-Selling Products – The MongoDB Way db.orders.aggregate([ { $match : { orderStatus: "COMPLETE", orderDate: { $gt: ISODate("2014-01-01"), $lt: ISODate("2014-04-01") } } }, { $unwind : "$orderItems" }, { $project : { _id: 0, productId: "$orderItems.productId", total : { $multiply : ["$orderItems.quantity", "$orderItems.unitPrice”] } } }, { $group : { _id: "$productId", total : { $sum : "$total"} } }, { $sort : { total: -1 }}, { $limit : 5 } ]) 9th December 2014 SQL versus NoSQL 30
  • 31. 2014 © Trivadis 9th December 2014 SQL versus NoSQL 31 Order Entry 1 – 1
  • 32. 2014 © Trivadis 9th December 2014 SQL versus NoSQL 32 Round 3 Spotify
  • 33. 2014 © Trivadis Spotify – Example 9th December 2014 SQL versus NoSQL 33
  • 34. 2014 © Trivadis Spotify – Use Cases  Playlist, Showing Ads, Following Artists … are all uses cases which have to be highly available, and accessible worldwide  Needs to be distributed to be fast  Service should be available even if a partition happen (due to network failure/machine failure)  First time subscription and subscription renewal must be absolutely consistent  Customer should only pay once! 9th December 2014 SQL versus NoSQL 34 Spotify Renewals (payments) Globally available playlists
  • 35. 2014 © Trivadis Polyglot Persistence – SQL And NoSQL 9th December 2014 SQL versus NoSQL 35 Spotify Platform Playlists, Ads, Followings Subscriptions and Payments Wide-column store RDBMS
  • 36. 2014 © Trivadis 9th December 2014 SQL versus NoSQL 36 Spotify 2 – 2 Draw!
  • 37. 2014 © Trivadis Agenda 1. Motivation 2. Overview of SQL and NoSQL Data Stores 3. Use Cases – Let's Get Ready to Rumble 4. Core Messages 9th December 2014 SQL versus NoSQL 37
  • 38. 2014 © Trivadis Core Messages  We will see a major consolation in the NoSQL area  SQL is and stays important  Polyglot persistence will be part of every solution design in the near future  Enterprise capabilities are required  Tooling (monitoring, backup & recovery, data security, …)  Organization, skills  Opportunity for cloud based solutions 9th December 2014 SQL versus NoSQL 38
  • 39. 2014 © Trivadis Questions and answers ... 2014 © Trivadis BASEL BERN BRUGES LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA Guido Schmutz Technology Manager Philipp Salvisberg Senior Principal Consultant 9th December 2014 SQL versus NoSQL 39
  • 40. 2014 © Trivadis Further information ... 9th December 2014 SQL versus NoSQL 40  http://martinfowler.com/books/nosql.html  http://www.manning.com/mccreary/  http://highlyscalable.wordpress.com  http://nosql-database.org  http://db-engines.com/

Editor's Notes

  • #2: Target Group: Architects, Developers, DBAs and IT enthusiasts
  • #5: Amazon Cart (NoSQL) plus defintive Bestellung (SQL)
  • #6: NoSQL: Learning curve for the level of complexity you need. SQL: common interface  Advantages in training, continuity, and data interchange.
  • #8: Based on the Edgar F. Codd Work from 1969ff (15 pages!) DERIVABILITY, REDUNDANCY AND CONSISTENCY OF RELATIONS STORED IN LARGE DATA BANKS (ANSI/ISO/IEC 9075:2011) Outdated SQL-86, SQL-89, SQL-92, SQL:1999, SQL:2003, SQL:2006, SQL:2008
  • #9: ACID vs. BASE (Säure vs. Lauge), The most important part of BASE is "eventually consistent", the other parts are not well defined and Eric Brewer himself stated that the Acronym was a bit "forced" to get the opposite of ACID.
  • #10: Important. Applies to networked shared-data systems and not only to distributed systems! It's misinterpreted in books and articles. See also https://twitter.com/eric_brewer/status/26819094612 CA = Non-distributed system: RDBMS default AP = Distributed system: Internet DNS (high availability, but it might take some time until all DNS server deliver the same result) CP = Distributed system: RDBMS default for distributed transactions (transaction rolls back if you it does not succeed in time, means it is basically unavailable)
  • #11: SQL Data Stores RDBMS These systems store data in multiple tables (columns, rows) connected via primary and foreign key relationships, and support a defined subset of the SQL Standard (ISO/ANSI). Products: Oracle Database, Microsoft SQL Server, IBM DB2, MySQL, PostgreSQL NoSQL Data Stores for Scalability Key-value Stores These systems store values and an index to find them, based on a programmer defined key Products: Voldemort, Redis, Riak, Amazon DynamoDB, Oracle NoSQL, Oracle Berkeley DB, Memcached Document Stores These systems store documents. A document allows values to be nested documents or lists as well as scalar values, and the attribute names are dynamically defined for each document at runtime. The documents are indexed and a simple query mechanism is provided Products: MongoDB, CouchDB, RavenDB, OrientDB, Couchbase Wide Column Stores (Column Families / Extensible Record Store) These systems store extensible records that can be partitioned vertically and horizontally across nodes Products: Hbase, Cassandra, Accumulo, Amazon SimpleDB, HyperTable More NoSQL Data Stores Graph Databases These systems use graph structures with nodes, edges, and properties to represent and store data. Specialized graph databases such as triplestores and network databases exists beside general graph databases. SPARQL is used to query graphs in RDF format. Products: Neo4J, Titan, Jena, Sesame, Allegrograph, Virtuoso, BigData, Oracle Spatial and Graph, Oracle NoSQL with Graph Options Multidimensional Databases These systems support multi-dimensional online analytical processing (MOLAP) by storing data in an optimized multi-dimensional array storage (data cubes), rather than in a relational database. MDX is typically used to query data in multidimensional databases. Products: Microsoft Analysis Services, Oracle Essbase, Palo (Jedox), Mondrian (Pentaho), SAS OLAP Server, IBM Cognos TM1 XML Databases These systems store XML documents and are supporting mostly XQuery for data retrieval Products: EMC Documentum xDB, BaseX, eXist, Sedna, QizX, Oracle Berkeley DB XML and many more SAP Netweaver BW is not a MOLAP store for itself, it uses Microsoft Analysis Services (see http://help.sap.com/saphelp_nw04/helpdata/en/82/ea683c7fe94154e10000000a114084/content.htm) Especially in the area of OLAP are various tools available which require just a star schema mapping to query data through MDX
  • #14: Data is captured from 2 million smart meters (1 main sensor, 10 optional sub-sensors, e.g. fridge, stove, dish-washer, wash-machine, TV, computer, …) One smart meter per household Measures the energy consumption Delivery interval between 1 second and 5 minutes Every sensor measures and delivers the energy consumption per second (kWh) AP Characteristics (Consistency is not so important)
  • #15: Just show (explained before)
  • #16: Granularity Minute: 2014-03-20 00:00:00, 2014-03-20 00:01:00, 2014-03-20 00:02:00
  • #19: RAC just provides shorter downtimes, but does not eliminate them Active-Active replication using GoldenGate is an additional option. Could increase the insert volume, but is limited to a maximum of two nodes. Configugration combined with reader farms might become quite complex to understand and maintain This configuration is quite simple and scales very good for read services. However, write services are limited due to the single node restriction
  • #20: Aggregation of sensor delivery in the middle tier, part of batching Hourly aggregate might be an overkill TPC-C Benchmark http://c970058.r58.cf2.rackcdn.com/fdr/tpcc/Oracle_SPARC_T5-8_TPC-C_FDR_032613.pdf – 4.66 Mio USD$ (HW, SW, Maintenance) CREATE OR REPLACE PACKAGE BODY aggr_pkg IS -- -- aggr_qofh (quarter of hour) -- PROCEDURE aggr_qofh(p_start_time_in TIMESTAMP) IS l_start_time DATE := trunc(p_start_time_in, 'hh24') + 1 / 24 / 60 * floor(extract(minute FROM p_start_time_in) / 15) * 15; BEGIN INSERT INTO sensor_readings_qofh (sensor_id, start_time, usage_kwh) SELECT sensor_id, trunc(start_time, 'hh24') + 1 / 24 / 60 * floor(extract(minute FROM start_time) / 15) * 15 AS start_time, SUM(usage_kwh) AS usage_kwh FROM sensor_readings_minute WHERE start_time >= l_start_time AND start_time < l_start_time + 1 / 24 / 60 * 15 GROUP BY sensor_id, trunc(start_time, 'hh24') + 1 / 24 / 60 * floor(extract(minute FROM start_time) / 15) * 15; COMMIT; END; -- -- aggr_hour -- PROCEDURE aggr_hour(p_start_time_in TIMESTAMP) IS l_start_time DATE := trunc(p_start_time_in, 'hh24'); BEGIN INSERT INTO sensor_readings_hour (sensor_id, start_time, usage_kwh) SELECT sensor_id, trunc(start_time, 'hh24') AS start_time, SUM(usage_kwh) AS usage_kwh FROM sensor_readings_qofh WHERE start_time >= l_start_time AND start_time < l_start_time + 1 / 24 GROUP BY sensor_id, trunc(start_time, 'hh24'); COMMIT; END aggr_hour; -- -- aggr_day -- PROCEDURE aggr_day(p_start_time_in TIMESTAMP) IS l_start_time DATE := trunc(p_start_time_in); BEGIN INSERT INTO sensor_readings_day (sensor_id, start_time, usage_kwh) SELECT sensor_id, trunc(start_time) AS start_time, SUM(usage_kwh) AS usage_kwh FROM sensor_readings_hour WHERE start_time >= l_start_time AND start_time < l_start_time + 1 GROUP BY sensor_id, trunc(start_time); COMMIT; END aggr_day; END aggr_pkg; /
  • #24: Orders are entered via GUI Orders may be modified as long as the order status is "incomplete" Order status is set to "complete" after a final approval A lot of data is available in the system Some sales volume analysis are wanted CA Characteristics (network partition tolerance is not so important)
  • #27: Statment looks similar to status change to "cancelled". Only the read parts changes. Status -> :p_value_for_cancelled, "-" -> "+" in the UPDATE clause
  • #29: Document Store Developed by 10gen, now MongoDB Inc. Professional grade support by MongoDB Inc. Main Features JSON Data Model with Dynamic Schemas Auto-Sharding for Horizontal Scalability Built-In Replication for High Availability Rich Secondary Indexes, including geospatial and TTL indexes Text Search Aggregation Framework & Native MapReduce
  • #34: Music service which is available worldwide Over 20’000’000 music tracks available Millions of users Each user has dozens of playlists Many AP but also some CA use cases