SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Downloaden Sie, um offline zu lesen
CASSANDRA 
FOR ALL 
THE THINGS 
@iconara
CASSANDRA 
FOR ALL 
THE THINGS 
@iconara
THEO 
Chief Architect at Burt 
@iconara
THEO 
Cassandra MVP and original author of the DataStax Ruby driver 
@iconara
CASSANDRA 
FOR ALL 
THE THINGS* 
@iconara
CASSANDRA 
FOR ALL 
THE THINGS* 
* where it makes sense 
@iconara
CASSANDRA 
FTW 
@iconara
BIG TABLE 
partitions as sorted maps 
@iconara
DYNAMO 
availability and simple ops 
@iconara
LOGS AS STORAGE 
optimized for writes 
@iconara
CASSANDRA 
FTW 
@iconara
CONVERSION 
TRACKING 
$ $ $ $ $ 
@iconara
ATTRIBUTION 
@iconara 
$
ATTRIBUTION 
90s 5s 
@iconara 
30s 
$
visitor ID 
timestamp timestamp timestamp 
event event event
visitor ID 
visitor ID 
timestamp timestamp timestamp 
event event event 
timestamp timestamp timestamp 
event event event 
visitor ID 
visitor ID 
timestamp timestamp timestamp 
event event event 
timestamp timestamp timestamp 
event event event 
visitor ID 
timestamp timestamp timestamp 
event event event 
➔
1/10,000 
@iconara
TTL 
automatic windowing 
@iconara
ANALYTICS 
precomputed cubes 
@iconara
SELECT 
category, 
author, 
device_type, 
COUNT(*) AS pageviews, 
AVG(duration) AS duration 
FROM pageviews 
GROUP BY 1, 2, 3 
@iconara
SELECT 
category, 
author, 
device_type, 
COUNT(*) AS pageviews, 
AVG(duration) AS duration 
FROM pageviews 
GROUP BY 1, 2, 3 
@iconara
SELECT 
category, 
author, 
device_type, 
COUNT(*) AS pageviews, 
AVG(duration) AS duration 
FROM pageviews 
GROUP BY 1, 2, 3 
@iconara
date + cube 
slice + time slice + time slice + time 
metrics metrics metrics
“sports”, “Sue”, “tablet” 
date + cube 
slice + time slice + time slice + time 
metrics metrics metrics 
category, author, device type
date + cube 
slice + time slice + time slice + time 
metrics metrics metrics 
{pageviews: 234, duration: 2451.45}
COUNTERS 
at 2M increments per second they’re not cost-effective × 
@iconara
WIDE ROWS FAIL 
cardinality kills 
@iconara
“sports”, “Sue”, “tablet” 
date + cube 
slice + time slice + time slice + time 
metrics metrics metrics
remember when we 
thought this was a problem?
date + 
cube + 
shard 
slice + time slice + time slice + time 
metrics metrics metrics 
H(slice) mod 12
TIME SERIES 
@iconara
cube + 
slice + metric 
time time time 
value value value 
cube 
slice slice slice
NARROW ROWS 
@iconara
cube + slice + 
epoch + metric 
time + version time + version time + version 
value value value 
cube + epoch 
slice slice slice 
time/1000
NARROW ROWS 
enables parallel reads 
@iconara
SELECT 
category, 
device_type, 
COUNT(*) AS pageviews, 
AVG(duration) AS duration 
FROM pageviews 
WHERE category = “sports” 
GROUP BY 1, 2, 3
category + 
device type 
culture + 
computer 
culture + 
tablet 
news + 
computer 
news + 
tablet 
news + 
mobile 
sports + 
computer 
sports + 
tablet 
sports + 
mobile
supports wildcard on device type 
category + 
device type 
culture + 
computer 
culture + 
tablet 
news + 
computer 
news + 
tablet 
news + 
mobile 
sports + 
computer 
sports + 
tablet 
sports + 
mobile 
device type + 
category 
computer + 
culture 
computer + 
news 
computer + 
sports 
mobile + 
news 
mobile + 
sports 
tablet + 
culture 
tablet + 
news 
tablet + 
sports 
supports wildcard on category
TRANSIENT STATE 
➔ ➔ 
@iconara
session ID 
timestamp timestamp timestamp 
data data data 
shard 
session ID session ID session ID 
H(session ID) mod 360
WIDE ROWS FAIL 
(again) 
@iconara
shard 9 
NFNJ0U NFNJ13 NFNJ0Y NFNJ1L NFNJ16 NFNJ0U NFNJ1C NFNJ20 NFNJ0U NFNJ2L NFNJ2S NFNJ2D NFNJ2U NFNJ1X NFNJ4C NFNJ1O NFNJ1A NFNJ29 × × × × × × × × × × × × × × × ×
session ID 
timestamp timestamp timestamp 
data data data 
shard 
session ID session ID session ID
session ID 
timestamp timestamp timestamp 
data data data 
shard + slot 
session ID session ID session ID
session ID 
timestamp timestamp timestamp 
data data data 
shard + slot 
session ID session ID session ID 
day-of-year mod 30
shard 9 
slot 1 × × × 
shard 9 
slot 3 
NFNJ6Z NFNJ73 NFNJ7B NFNJ72 NFNJ7N NFNJ74 NFNJ6Z NFNJ8C NFNJ7N NFNJ88 NFNJ83 NFNJ94 NFNJ8Z NFNJ7P NFNJA3 × × × × × × 
shard 9 
slot 2 
NFNJ58 NFNJ5H NFNJ5C NFNJ5E NFNJ68 NFNJ6H NFNJ68 NFNJ5M NFNJ64 NFNJ6H NFNJ6C NFNJ5U NFNJ5K NFNJ84 NFNJ7Y NFNJ62 NFNJ70 NFNJ74 NFNJ6Q × × × × × × × × × × × × × × × ×
AND MORE 
@iconara
GRAPHS 
@iconara
TRACES 
@iconara
KEY/VALUE 
@iconara
CASSANDRA 
FOR ALL 
THE THINGS 
@iconara
@iconara 
burtcorp.com 
architecturalatrocities.com

Weitere ähnliche Inhalte

Ähnlich wie Cassandra for all the Things

Ähnlich wie Cassandra for all the Things (20)

Overview of the DDS-XRCE specification
Overview of the DDS-XRCE specificationOverview of the DDS-XRCE specification
Overview of the DDS-XRCE specification
 
CCM AlchemyAPI and Real-time Aggregation
CCM AlchemyAPI and Real-time AggregationCCM AlchemyAPI and Real-time Aggregation
CCM AlchemyAPI and Real-time Aggregation
 
Querying Data Pipeline with AWS Athena
Querying Data Pipeline with AWS AthenaQuerying Data Pipeline with AWS Athena
Querying Data Pipeline with AWS Athena
 
Managing your Black Friday Logs NDC Oslo
Managing your  Black Friday Logs NDC OsloManaging your  Black Friday Logs NDC Oslo
Managing your Black Friday Logs NDC Oslo
 
Managing your black friday logs - Code Europe
Managing your black friday logs - Code EuropeManaging your black friday logs - Code Europe
Managing your black friday logs - Code Europe
 
Learning to Build Distributed Systems the Hard Way
Learning to Build Distributed Systems the Hard WayLearning to Build Distributed Systems the Hard Way
Learning to Build Distributed Systems the Hard Way
 
MongoDB for Analytics
MongoDB for AnalyticsMongoDB for Analytics
MongoDB for Analytics
 
Spark Streaming with Cassandra
Spark Streaming with CassandraSpark Streaming with Cassandra
Spark Streaming with Cassandra
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Azure Stream Analytics : Analyse Data in Motion
Azure Stream Analytics  : Analyse Data in MotionAzure Stream Analytics  : Analyse Data in Motion
Azure Stream Analytics : Analyse Data in Motion
 
Text Analysis with Machine Learning
Text Analysis with Machine LearningText Analysis with Machine Learning
Text Analysis with Machine Learning
 
Podlove Podcast Validator
Podlove Podcast ValidatorPodlove Podcast Validator
Podlove Podcast Validator
 
Strata London 16: sightseeing, venues, and friends
Strata  London 16: sightseeing, venues, and friendsStrata  London 16: sightseeing, venues, and friends
Strata London 16: sightseeing, venues, and friends
 
GAB 2019 - Graph as a data store
GAB 2019 - Graph as a data storeGAB 2019 - Graph as a data store
GAB 2019 - Graph as a data store
 
Apache cassandra en production - devoxx 2017
Apache cassandra en production  - devoxx 2017Apache cassandra en production  - devoxx 2017
Apache cassandra en production - devoxx 2017
 
Norikra: SQL Stream Processing In Ruby
Norikra: SQL Stream Processing In RubyNorikra: SQL Stream Processing In Ruby
Norikra: SQL Stream Processing In Ruby
 
Numberly on Joining Billions of Rows in Seconds: Replacing MongoDB and Hive w...
Numberly on Joining Billions of Rows in Seconds: Replacing MongoDB and Hive w...Numberly on Joining Billions of Rows in Seconds: Replacing MongoDB and Hive w...
Numberly on Joining Billions of Rows in Seconds: Replacing MongoDB and Hive w...
 
Facebook Sentiment Analysis - What is Facebook Saying about Nintendo?
Facebook Sentiment Analysis - What is Facebook Saying about Nintendo?Facebook Sentiment Analysis - What is Facebook Saying about Nintendo?
Facebook Sentiment Analysis - What is Facebook Saying about Nintendo?
 
Cassandra + Spark (You’ve got the lighter, let’s start a fire)
Cassandra + Spark (You’ve got the lighter, let’s start a fire)Cassandra + Spark (You’ve got the lighter, let’s start a fire)
Cassandra + Spark (You’ve got the lighter, let’s start a fire)
 

Mehr von Theo Hultberg (9)

AWS Cost Optimization
AWS Cost OptimizationAWS Cost Optimization
AWS Cost Optimization
 
Building a CQL driver
Building a CQL driverBuilding a CQL driver
Building a CQL driver
 
Chasing the elephant
Chasing the elephantChasing the elephant
Chasing the elephant
 
Learning to build distributed systems the hard way
Learning to build distributed systems the hard wayLearning to build distributed systems the hard way
Learning to build distributed systems the hard way
 
Learning to build distributed systems the hard way
Learning to build distributed systems the hard wayLearning to build distributed systems the hard way
Learning to build distributed systems the hard way
 
A Guide to the Post Relational Revolution
A Guide to the Post Relational RevolutionA Guide to the Post Relational Revolution
A Guide to the Post Relational Revolution
 
Concurrency and Distributed Systems Using JRuby
Concurrency and Distributed Systems Using JRubyConcurrency and Distributed Systems Using JRuby
Concurrency and Distributed Systems Using JRuby
 
Shortcuts around the mistakes I've made scaling MongoDB
Shortcuts around the mistakes I've made scaling MongoDB Shortcuts around the mistakes I've made scaling MongoDB
Shortcuts around the mistakes I've made scaling MongoDB
 
Standing on the shoulders of giants with JRuby
Standing on the shoulders of giants with JRubyStanding on the shoulders of giants with JRuby
Standing on the shoulders of giants with JRuby
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Cassandra for all the Things