SlideShare a Scribd company logo
Speed up your Apache
Cassandra™ Applications
A Practical Guide to Reactive Programming
London
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
About me
Cedrick Lunven
Developer Advocate, DataStax
Creator Contributor
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Agenda
2
3
4 BACK TO SANITY WITH REACTIVE
LET’S GO ASYNCHRONOUS (AND CRAZY)!
SIMPLE & SYNCHRONOUS
5 TAKE AWAYS
1 REMINDERS APACHE CASSANDRA™
APACHE CASSANDRA
..reminders
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
This is a DISTRIBUTED Database
Node
• Up to 1TB
• 3000 Tx/s/core
Datacenter (Ring)
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
…which scale linearly
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
…anywhere
On-Premise
Data Center
Cluster
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Data is distributed
0
13
25
38
50
63
75
88 59 (data)
RF=2
59 (data)
RF=3
replicated
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Tuneable Consistency
RF=3
Client CL=ONECL=QUORUMCL=ALL
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Sweet spots
1. High Throughput (because we can keep up)
2. High Volume (because we scale linearly and still OLTP)
3. Data distribution (read/write around the globe)
4. High Availability (replication, masterless)
SIMPLE AND SYNCHRONOUS
(kiss)
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Sample Application Overview
● Time-based events series
CREATE TABLE stock (
symbol text,
value decimal,
date timestamp,
PRIMARY KEY ((symbol), date)
)
WITH CLUSTERING
ORDER BY (date DESC)
AND default_time_to_live = 86400
AND compaction = {
'class' : 'TimeWindowCompactionStrategy'
'compaction_window_unit’ : MINUTES'
'compaction_window_size’ : 60
};
v
v
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
DRIVERAPI
Synchronous Stack
CLIENT
12+
© DataStax, All Rights Reserved.Confidential
Demo #1: Sync
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
CLIENT API DRIVER
DseSession.builder()
MetaData
DseSession
SimpleStatement
stmt.prepare()
PreparedStatement
PreparedStatement
(preparedId)
Initializing
Statements
Connection
API
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
CLIENT API DRIVER
Parameters
SynchronousQueries
PreparedStatement
& Parameters
Bind
Parameters
BoundStatement
ResultSet
ResultSet
Results
Blocked
😴
API
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Synchronous - SWOT Analysis
Strengths Weaknesses
ThreatsOpportunities
Simple
Easy to Test & Maintain Scalability ⚠️
Blocking 😴
LET’S GO ASYNCHRONOUS
(and crazy !)
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
DRIVERAPI
Asynchronous Stack (Yes,….no changes)
CLIENT
12+
© DataStax, All Rights Reserved.Confidential
Demo #2: Async
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
CLIENT API DRIVER
v
Parameters
AsyncQueries
PreparedStatement
& Parameters Bind
Parameters
BoundStatement
AsyncResultSet
AsyncResultSet
Result
API
CompletionStage
Callback Hell 🔥
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Asynchronous - SWOT Analysis
Strengths Weaknesses
ThreatsOpportunities
Non Blocking
Scalability Maintainability 🤯
Callback Hell 🔥
BACK TO SANITY
(with reactive driver)
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Reactive Manifesto
https://www.reactivemanifesto.org/
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Reactive Streams API
SUBSCRIBER PUBLISHER
subscribe(this)
onSubscribe(subscription)
onNext(...)
onComplete()
subscription.request(...)
http://www.reactive-streams.org/
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
DRIVERAPI
Reactive Stack
CLIENT
12+
© DataStax, All Rights Reserved.Confidential
Demo #3: Reactive
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
CLIENT API DRIVER
v
Parameters
ReactiveQueries
PreparedStatement
& Parameters Bind
Parameters
Row
ReactiveRow
Flux
API
ReactiveResultSet
Subscribe
BoundStatement
Subscriber.onNext
Query execution
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Backpressure
● When Reading:
−Driver will slow down
if client slows down
● When Writing:
−Driver cannot slow down
if server slows down
−Risk of
OverloadedException
CLIENT DRIVER
Backpressure
❌
CLIENTDRIVER
Backpressure
✅
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Reactive - SWOT Analysis
Strengths Weaknesses
ThreatsOpportunities
Simple & Non Blocking
Scalable & Maintainable OverloadedException
Hard to debug?
TAKE AWAYS
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
Take Aways
● Asynchronous
−Less control
−Segregates requests and results processing
−Complex : callback hell
● Reactive
−Async capabilities but no callback hell
−Backpressure (for reads)
−Not a new way of querying DSE
© DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved.
References & Questions
https://github.com/datastax/cassandra-
reactive-demo
https://www.youtube.com/channel/UCAIQ
Y251avaMv7bBv5PCo-A
https://www.twitch.tv/datastaxacademy/vid
eos
THANK YOU

More Related Content

What's hot (20)

PDF
Pass data community summit - 2021 - Real-Time Streaming in Azure with Apache ...
Timothy Spann
 
PDF
FLiP Into Trino
Timothy Spann
 
PDF
Music city data Hail Hydrate! from stream to lake
Timothy Spann
 
PDF
Automation + dev ops summit hail hydrate! from stream to lake
Timothy Spann
 
PDF
ApacheCon 2021 - Apache NiFi Deep Dive 300
Timothy Spann
 
PDF
ApacheCon 2021 Apache Deep Learning 302
Timothy Spann
 
PDF
Using FLiP with influxdb for edgeai iot at scale 2022
Timothy Spann
 
PDF
Hail hydrate! from stream to lake using open source
Timothy Spann
 
PDF
Codeless pipelines with pulsar and flink
Timothy Spann
 
PDF
Big data conference europe real-time streaming in any and all clouds, hybri...
Timothy Spann
 
PDF
Cracking the nut, solving edge ai with apache tools and frameworks
Timothy Spann
 
PDF
Using the FLiPN stack for edge ai (flink, nifi, pulsar)
Timothy Spann
 
PDF
Api world apache nifi 101
Timothy Spann
 
PDF
Using the flipn stack for edge ai (flink, nifi, pulsar)
Timothy Spann
 
PDF
Python web conference 2022 apache pulsar development 101 with python (f li-...
Timothy Spann
 
PDF
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
Timothy Spann
 
PDF
Using FLiP with influxdb for EdgeAI IoT at Scale
Timothy Spann
 
PDF
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
Timothy Spann
 
PDF
Using the FLaNK Stack for edge ai (flink, nifi, kafka, kudu)
Timothy Spann
 
PDF
Select Star: Flink SQL for Pulsar Folks - Pulsar Summit NA 2021
StreamNative
 
Pass data community summit - 2021 - Real-Time Streaming in Azure with Apache ...
Timothy Spann
 
FLiP Into Trino
Timothy Spann
 
Music city data Hail Hydrate! from stream to lake
Timothy Spann
 
Automation + dev ops summit hail hydrate! from stream to lake
Timothy Spann
 
ApacheCon 2021 - Apache NiFi Deep Dive 300
Timothy Spann
 
ApacheCon 2021 Apache Deep Learning 302
Timothy Spann
 
Using FLiP with influxdb for edgeai iot at scale 2022
Timothy Spann
 
Hail hydrate! from stream to lake using open source
Timothy Spann
 
Codeless pipelines with pulsar and flink
Timothy Spann
 
Big data conference europe real-time streaming in any and all clouds, hybri...
Timothy Spann
 
Cracking the nut, solving edge ai with apache tools and frameworks
Timothy Spann
 
Using the FLiPN stack for edge ai (flink, nifi, pulsar)
Timothy Spann
 
Api world apache nifi 101
Timothy Spann
 
Using the flipn stack for edge ai (flink, nifi, pulsar)
Timothy Spann
 
Python web conference 2022 apache pulsar development 101 with python (f li-...
Timothy Spann
 
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
Timothy Spann
 
Using FLiP with influxdb for EdgeAI IoT at Scale
Timothy Spann
 
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
Timothy Spann
 
Using the FLaNK Stack for edge ai (flink, nifi, kafka, kudu)
Timothy Spann
 
Select Star: Flink SQL for Pulsar Folks - Pulsar Summit NA 2021
StreamNative
 

Similar to Speed Up Your Apache Cassandra™ Applications: A Practical Guide to Reactive Programming (20)

PPTX
Reactive Programming with Cassandra
Cédrick Lunven
 
PDF
Live traffic capture and replay in cassandra 4.0
Vinay Kumar Chella
 
PDF
Safer restarts, faster streaming, and better repair, just a glimpse of cassan...
Vinay Kumar Chella
 
PPT
Reporting from the Trenches: Intuit & Cassandra
DataStax
 
PPTX
DataStax 6 and Beyond
David Jones-Gilardi
 
PPTX
Webinar: DataStax Enterprise 6: 10 Ways to Multiply the Power of Apache Cassa...
DataStax
 
PPSX
implementation of a big data architecture for real-time analytics with data s...
Joseph Arriola
 
PDF
Develop Scalable Applications with DataStax Drivers (Alex Popescu, Bulat Shak...
DataStax
 
PPTX
Big Data Analytics with Spark
DataStax Academy
 
PPTX
Webinar: DataStax Managed Cloud: focus on innovation, not administration
DataStax
 
PDF
Oracle RAC 12c Rel. 2 for Continuous Availability
Markus Michalewicz
 
PPTX
Webinar: Comparing DataStax Enterprise with Open Source Apache Cassandra
DataStax
 
PDF
Spark Summit EU talk by Debasish Das and Pramod Narasimha
Spark Summit
 
PPTX
Designing Fault-Tolerant Applications with DataStax Enterprise and Apache Cas...
DataStax
 
PPTX
Maximum Overdrive: Tuning the Spark Cassandra Connector
Russell Spitzer
 
PDF
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
DataStax Academy
 
PDF
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
Daniel Cohen
 
PDF
Cassandra Exports as a Trivially Parallelizable Problem (Emilio Del Tessandor...
DataStax
 
PDF
Oracle Database Cloud Service - Provisioning Your First DBaaS Instance
Revelation Technologies
 
PPTX
Project Casquatch: An Open Source Java Abstraction Framework for Cassandra Da...
Josh Turner
 
Reactive Programming with Cassandra
Cédrick Lunven
 
Live traffic capture and replay in cassandra 4.0
Vinay Kumar Chella
 
Safer restarts, faster streaming, and better repair, just a glimpse of cassan...
Vinay Kumar Chella
 
Reporting from the Trenches: Intuit & Cassandra
DataStax
 
DataStax 6 and Beyond
David Jones-Gilardi
 
Webinar: DataStax Enterprise 6: 10 Ways to Multiply the Power of Apache Cassa...
DataStax
 
implementation of a big data architecture for real-time analytics with data s...
Joseph Arriola
 
Develop Scalable Applications with DataStax Drivers (Alex Popescu, Bulat Shak...
DataStax
 
Big Data Analytics with Spark
DataStax Academy
 
Webinar: DataStax Managed Cloud: focus on innovation, not administration
DataStax
 
Oracle RAC 12c Rel. 2 for Continuous Availability
Markus Michalewicz
 
Webinar: Comparing DataStax Enterprise with Open Source Apache Cassandra
DataStax
 
Spark Summit EU talk by Debasish Das and Pramod Narasimha
Spark Summit
 
Designing Fault-Tolerant Applications with DataStax Enterprise and Apache Cas...
DataStax
 
Maximum Overdrive: Tuning the Spark Cassandra Connector
Russell Spitzer
 
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
DataStax Academy
 
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
Daniel Cohen
 
Cassandra Exports as a Trivially Parallelizable Problem (Emilio Del Tessandor...
DataStax
 
Oracle Database Cloud Service - Provisioning Your First DBaaS Instance
Revelation Technologies
 
Project Casquatch: An Open Source Java Abstraction Framework for Cassandra Da...
Josh Turner
 
Ad

More from Matt Stubbs (20)

PDF
Blueprint Series: Banking In The Cloud – Ultra-high Reliability Architectures
Matt Stubbs
 
PDF
Blueprint Series: Expedia Partner Solutions, Data Platform
Matt Stubbs
 
PDF
Blueprint Series: Architecture Patterns for Implementing Serverless Microserv...
Matt Stubbs
 
PDF
Big Data LDN 2018: DATA, WHAT PEOPLE THINK AND WHAT YOU CAN DO TO BUILD TRUST.
Matt Stubbs
 
PDF
Big Data LDN 2018: DATABASE FOR THE INSTANT EXPERIENCE
Matt Stubbs
 
PDF
Big Data LDN 2018: BIG DATA TOO SLOW? SPRINKLE IN SOME NOSQL
Matt Stubbs
 
PDF
Big Data LDN 2018: ENABLING DATA-DRIVEN DECISIONS WITH AUTOMATED INSIGHTS
Matt Stubbs
 
PDF
Big Data LDN 2018: DATA MANAGEMENT AUTOMATION AND THE INFORMATION SUPPLY CHAI...
Matt Stubbs
 
PDF
Big Data LDN 2018: AI VS. GDPR
Matt Stubbs
 
PDF
Big Data LDN 2018: REALISING THE PROMISE OF SELF-SERVICE ANALYTICS WITH DATA ...
Matt Stubbs
 
PDF
Big Data LDN 2018: TURNING MULTIPLE DATA LAKES INTO A UNIFIED ANALYTIC DATA L...
Matt Stubbs
 
PDF
Big Data LDN 2018: MICROSOFT AZURE AND CLOUDERA – FLEXIBLE CLOUD, WHATEVER TH...
Matt Stubbs
 
PDF
Big Data LDN 2018: CONSISTENT SECURITY, GOVERNANCE AND FLEXIBILITY FOR ALL WO...
Matt Stubbs
 
PDF
Big Data LDN 2018: MICROLISE: USING BIG DATA AND AI IN TRANSPORT AND LOGISTICS
Matt Stubbs
 
PDF
Big Data LDN 2018: EXPERIAN: MAXIMISE EVERY OPPORTUNITY IN THE BIG DATA UNIVERSE
Matt Stubbs
 
PDF
Big Data LDN 2018: A LOOK INSIDE APPLIED MACHINE LEARNING
Matt Stubbs
 
PDF
Big Data LDN 2018: DEUTSCHE BANK: THE PATH TO AUTOMATION IN A HIGHLY REGULATE...
Matt Stubbs
 
PDF
Big Data LDN 2018: FROM PROLIFERATION TO PRODUCTIVITY: MACHINE LEARNING DATA ...
Matt Stubbs
 
PDF
Big Data LDN 2018: DATA APIS DON’T DISCRIMINATE
Matt Stubbs
 
PDF
Big Data LDN 2018: A TALE OF TWO BI STANDARDS: DATA WAREHOUSES AND DATA LAKES
Matt Stubbs
 
Blueprint Series: Banking In The Cloud – Ultra-high Reliability Architectures
Matt Stubbs
 
Blueprint Series: Expedia Partner Solutions, Data Platform
Matt Stubbs
 
Blueprint Series: Architecture Patterns for Implementing Serverless Microserv...
Matt Stubbs
 
Big Data LDN 2018: DATA, WHAT PEOPLE THINK AND WHAT YOU CAN DO TO BUILD TRUST.
Matt Stubbs
 
Big Data LDN 2018: DATABASE FOR THE INSTANT EXPERIENCE
Matt Stubbs
 
Big Data LDN 2018: BIG DATA TOO SLOW? SPRINKLE IN SOME NOSQL
Matt Stubbs
 
Big Data LDN 2018: ENABLING DATA-DRIVEN DECISIONS WITH AUTOMATED INSIGHTS
Matt Stubbs
 
Big Data LDN 2018: DATA MANAGEMENT AUTOMATION AND THE INFORMATION SUPPLY CHAI...
Matt Stubbs
 
Big Data LDN 2018: AI VS. GDPR
Matt Stubbs
 
Big Data LDN 2018: REALISING THE PROMISE OF SELF-SERVICE ANALYTICS WITH DATA ...
Matt Stubbs
 
Big Data LDN 2018: TURNING MULTIPLE DATA LAKES INTO A UNIFIED ANALYTIC DATA L...
Matt Stubbs
 
Big Data LDN 2018: MICROSOFT AZURE AND CLOUDERA – FLEXIBLE CLOUD, WHATEVER TH...
Matt Stubbs
 
Big Data LDN 2018: CONSISTENT SECURITY, GOVERNANCE AND FLEXIBILITY FOR ALL WO...
Matt Stubbs
 
Big Data LDN 2018: MICROLISE: USING BIG DATA AND AI IN TRANSPORT AND LOGISTICS
Matt Stubbs
 
Big Data LDN 2018: EXPERIAN: MAXIMISE EVERY OPPORTUNITY IN THE BIG DATA UNIVERSE
Matt Stubbs
 
Big Data LDN 2018: A LOOK INSIDE APPLIED MACHINE LEARNING
Matt Stubbs
 
Big Data LDN 2018: DEUTSCHE BANK: THE PATH TO AUTOMATION IN A HIGHLY REGULATE...
Matt Stubbs
 
Big Data LDN 2018: FROM PROLIFERATION TO PRODUCTIVITY: MACHINE LEARNING DATA ...
Matt Stubbs
 
Big Data LDN 2018: DATA APIS DON’T DISCRIMINATE
Matt Stubbs
 
Big Data LDN 2018: A TALE OF TWO BI STANDARDS: DATA WAREHOUSES AND DATA LAKES
Matt Stubbs
 
Ad

Recently uploaded (20)

PDF
Using AI/ML for Space Biology Research
VICTOR MAESTRE RAMIREZ
 
PDF
A GraphRAG approach for Energy Efficiency Q&A
Marco Brambilla
 
PDF
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
PPTX
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
PDF
Technical-Report-GPS_GIS_RS-for-MSF-finalv2.pdf
KPycho
 
PPTX
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
PPTX
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
PPTX
apidays Singapore 2025 - From Data to Insights: Building AI-Powered Data APIs...
apidays
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
PPTX
apidays Helsinki & North 2025 - From Chaos to Clarity: Designing (AI-Ready) A...
apidays
 
PPT
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
PPTX
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
PDF
apidays Singapore 2025 - How APIs can make - or break - trust in your AI by S...
apidays
 
PDF
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PDF
The Best NVIDIA GPUs for LLM Inference in 2025.pdf
Tamanna36
 
PPT
Growth of Public Expendituuure_55423.ppt
NavyaDeora
 
PPTX
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
PDF
Development and validation of the Japanese version of the Organizational Matt...
Yoga Tokuyoshi
 
PPTX
01_Nico Vincent_Sailpeak.pptx_AI_Barometer_2025
FinTech Belgium
 
Using AI/ML for Space Biology Research
VICTOR MAESTRE RAMIREZ
 
A GraphRAG approach for Energy Efficiency Q&A
Marco Brambilla
 
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
Technical-Report-GPS_GIS_RS-for-MSF-finalv2.pdf
KPycho
 
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
apidays Singapore 2025 - From Data to Insights: Building AI-Powered Data APIs...
apidays
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
apidays Helsinki & North 2025 - From Chaos to Clarity: Designing (AI-Ready) A...
apidays
 
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
apidays Singapore 2025 - How APIs can make - or break - trust in your AI by S...
apidays
 
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
The Best NVIDIA GPUs for LLM Inference in 2025.pdf
Tamanna36
 
Growth of Public Expendituuure_55423.ppt
NavyaDeora
 
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
Development and validation of the Japanese version of the Organizational Matt...
Yoga Tokuyoshi
 
01_Nico Vincent_Sailpeak.pptx_AI_Barometer_2025
FinTech Belgium
 

Speed Up Your Apache Cassandra™ Applications: A Practical Guide to Reactive Programming

  • 1. Speed up your Apache Cassandra™ Applications A Practical Guide to Reactive Programming London
  • 2. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. About me Cedrick Lunven Developer Advocate, DataStax Creator Contributor
  • 3. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Agenda 2 3 4 BACK TO SANITY WITH REACTIVE LET’S GO ASYNCHRONOUS (AND CRAZY)! SIMPLE & SYNCHRONOUS 5 TAKE AWAYS 1 REMINDERS APACHE CASSANDRA™
  • 5. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. This is a DISTRIBUTED Database Node • Up to 1TB • 3000 Tx/s/core Datacenter (Ring)
  • 6. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. …which scale linearly
  • 7. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. …anywhere On-Premise Data Center Cluster
  • 8. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Data is distributed 0 13 25 38 50 63 75 88 59 (data) RF=2 59 (data) RF=3 replicated
  • 9. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Tuneable Consistency RF=3 Client CL=ONECL=QUORUMCL=ALL
  • 10. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Sweet spots 1. High Throughput (because we can keep up) 2. High Volume (because we scale linearly and still OLTP) 3. Data distribution (read/write around the globe) 4. High Availability (replication, masterless)
  • 12. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Sample Application Overview ● Time-based events series CREATE TABLE stock ( symbol text, value decimal, date timestamp, PRIMARY KEY ((symbol), date) ) WITH CLUSTERING ORDER BY (date DESC) AND default_time_to_live = 86400 AND compaction = { 'class' : 'TimeWindowCompactionStrategy' 'compaction_window_unit’ : MINUTES' 'compaction_window_size’ : 60 }; v v
  • 13. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. DRIVERAPI Synchronous Stack CLIENT 12+
  • 14. © DataStax, All Rights Reserved.Confidential Demo #1: Sync
  • 15. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. CLIENT API DRIVER DseSession.builder() MetaData DseSession SimpleStatement stmt.prepare() PreparedStatement PreparedStatement (preparedId) Initializing Statements Connection API
  • 16. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. CLIENT API DRIVER Parameters SynchronousQueries PreparedStatement & Parameters Bind Parameters BoundStatement ResultSet ResultSet Results Blocked 😴 API
  • 17. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Synchronous - SWOT Analysis Strengths Weaknesses ThreatsOpportunities Simple Easy to Test & Maintain Scalability ⚠️ Blocking 😴
  • 19. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. DRIVERAPI Asynchronous Stack (Yes,….no changes) CLIENT 12+
  • 20. © DataStax, All Rights Reserved.Confidential Demo #2: Async
  • 21. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. CLIENT API DRIVER v Parameters AsyncQueries PreparedStatement & Parameters Bind Parameters BoundStatement AsyncResultSet AsyncResultSet Result API CompletionStage Callback Hell 🔥
  • 22. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Asynchronous - SWOT Analysis Strengths Weaknesses ThreatsOpportunities Non Blocking Scalability Maintainability 🤯 Callback Hell 🔥
  • 23. BACK TO SANITY (with reactive driver)
  • 24. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Reactive Manifesto https://www.reactivemanifesto.org/
  • 25. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Reactive Streams API SUBSCRIBER PUBLISHER subscribe(this) onSubscribe(subscription) onNext(...) onComplete() subscription.request(...) http://www.reactive-streams.org/
  • 26. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. DRIVERAPI Reactive Stack CLIENT 12+
  • 27. © DataStax, All Rights Reserved.Confidential Demo #3: Reactive
  • 28. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. CLIENT API DRIVER v Parameters ReactiveQueries PreparedStatement & Parameters Bind Parameters Row ReactiveRow Flux API ReactiveResultSet Subscribe BoundStatement Subscriber.onNext Query execution
  • 29. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Backpressure ● When Reading: −Driver will slow down if client slows down ● When Writing: −Driver cannot slow down if server slows down −Risk of OverloadedException CLIENT DRIVER Backpressure ❌ CLIENTDRIVER Backpressure ✅
  • 30. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Reactive - SWOT Analysis Strengths Weaknesses ThreatsOpportunities Simple & Non Blocking Scalable & Maintainable OverloadedException Hard to debug?
  • 32. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. Take Aways ● Asynchronous −Less control −Segregates requests and results processing −Complex : callback hell ● Reactive −Async capabilities but no callback hell −Backpressure (for reads) −Not a new way of querying DSE
  • 33. © DataStax, All Rights Reserved.ConfidentialConfidential © DataStax, All Rights Reserved. References & Questions https://github.com/datastax/cassandra- reactive-demo https://www.youtube.com/channel/UCAIQ Y251avaMv7bBv5PCo-A https://www.twitch.tv/datastaxacademy/vid eos