SlideShare una empresa de Scribd logo
1 de 39
Descargar para leer sin conexión
#CASSANDRA13
Ma#hew	
  Stump	
  |	
  Architect	
  @	
  KISSmetrics
Real-time Large Queries
#CASSANDRA13
#CASSANDRA13
KISSmetrics Customers Want
*Churn Prediction
*AB Tests
*Which Blog Posts and Ad Campaigns Attract High Value
Customers?
*User Conversion Funnel
*Revenue Prediction
*Customer Acquisition Costs
*Customer Lifetime Value
#CASSANDRA13
Understanding Queries
#CASSANDRA13
RowKey username first_name last_name postal_code
cstar cstar Cassandra Database 94110
user2 user2 Some Guy 94112
#CASSANDRA13
RowKey username first_name last_name postal_code
cstar cstar Cassandra Database 94110
user2 user2 Some Guy 94112
#CASSANDRA13
RowKey username first_name last_name postal_code
cstar cstar Cassandra Database 94110
user2 user2 Some Guy 94112
#CASSANDRA13
RowKey
94110 cstar
94112 user2 user4 user7 ...
#CASSANDRA13
Where Secondary Indexes Break
Source: Place source content or footnote here. Delete if not needed.
*High Cardinality Data
*Only one index per query
*Indexes are distributed
*Only some datatypes; no counters
*Range queries are expensive
#CASSANDRA13
What Do I Want?
Source: Place source content or footnote here. Delete if not needed.
*Index high cardinality data; e.g. counters
*Complex queries, with multiple clauses
*Results in < 500ms for billions of rows
*Sub-field searching with regular expressions
*Range queries
#CASSANDRA13
Bitmap and Bit-Slice Indexes
#CASSANDRA13
#CASSANDRA13
RowKey
94110 cstar
94112 user2 user4 user7 ...
#CASSANDRA13
RowKey
94110 00001000 01000000 00000000 000000000
94112 10000110 01000000 00000000 000000000
#CASSANDRA13
RowKey
94110 00001000 01000000 00000000 000000000
94112 10000110 01000000 00000000 000000000
hash(“cstar”) = 4
#CASSANDRA13
SELECT * FROM users WHERE zipcode = 94110 OR zipcode = 94112
94112 or
94110
10001110 01000000 00000000 000000000
Field Index
94110 10001010 01000000 00000000 000000000
94112 10000110 01000000 00000000 000000000
#CASSANDRA13
SELECT * FROM users WHERE Event1 = true AND Event2 = true
Event1 and
Event2
10000010 01000000 00000000 000000000
Field Index
Event1 10001010 01000000 00000000 000000000
Event2 10000110 01000000 00000000 000000000
#CASSANDRA13
Field Value Slice
event_counter 1 10001010 01000000 00000000 000000000
event_counter 2 10000110 01000000 00000000 000000000
SELECT * FROM users WHERE event_counter < 5
Value1 or
Value2
10000010 01000000 00000000 000000000
#CASSANDRA13
"this is a test string"
#CASSANDRA13
['thi', 's i', 's a', ' te', 'st ', 'str', 'ing']
#CASSANDRA13
['0x746869', '0x732069', '0x732061', '0x207465',
'0x737420', '0x737472', '0x696e67']
#CASSANDRA13
Field Value Slice
text_field 0x207465 ' te' 10001010 01000000 00000000 000000000
text_field 0x696e67 'ing' 10111110 10001000 00000000 000001000
text_field 0x732061 's a' 10001010 01000001 00001000 110101110
text_field 0x732069 's i' 10001010 01000000 10110011 000000000
text_field 0x737420 'st ' 10001010 01001100 10110111 000000000
text_field 0x737472 'str' 10001010 01000000 00011010 011000000
text_field 0x746869 'thi' 10001010 01000000 10110111 000000010
#CASSANDRA13
"thi.*ing"
#CASSANDRA13
"thi" AND "ing"
#CASSANDRA13
0x746869 AND 0x696e67
#CASSANDRA13
Field Value Slice
text_field 0x207465 ' te' 10001010 01000000 00000000 000000000
text_field 0x696e67 'ing' 10111110 10001000 00000000 000001000
text_field 0x732061 's a' 10001010 01000001 00001000 110101110
text_field 0x732069 's i' 10001010 01000000 10110011 000000000
text_field 0x737420 'st ' 10001010 01001100 10110111 000000000
text_field 0x737472 'str' 10001010 01000000 00011010 011000000
text_field 0x746869 'thi' 10001010 01000000 10110111 000000010
#CASSANDRA13
"th.*ing"
#CASSANDRA13
"th" AND "ing"
#CASSANDRA13
range(0x746800, 0x7468FF) AND 0x696e67
range("th" + 0x00, "th" + 0xFF) AND "ing"
#CASSANDRA13
Field Value Slice
text_field 0x207465 ' te' 10001010 01000000 00000000 000000000
text_field 0x696e67 'ing' 10111110 10001000 00000000 000001000
text_field 0x732061 's a' 10001010 01000001 00001000 110101110
text_field 0x732069 's i' 10001010 01000000 10110011 000000000
text_field 0x737420 'st ' 10001010 01001100 10110111 000000000
text_field 0x737472 'str' 10001010 01000000 00011010 011000000
text_field 0x746869 'thi' 10001010 01000000 10110111 000000010
text_field 0x74687A 'thz' 10000000 00000001 00011100 000110010
range(0x746800, 0x7468FF) AND 0x696e67
#CASSANDRA13
#CASSANDRA13
Implementation
#CASSANDRA13
Query &
Indexing Engine
Queries and
Events
#CASSANDRA13
RowKey Offset 0x00 Offset 0x01 Offset 0x02 Offset 0x03
event1_0x00 10011000 10011000
event1_0x01 10011000 10011000 10011000
#CASSANDRA13
Results So Far
*Results returned for an 8 clause query for 4 billion rows < 2
second
*Full regular expression support
*Full support for range queries
*Ability to index any numeric value, or value which can be
hashed.
#CASSANDRA13
What isn't finished
*Support for atomic counters
*"Group By" query aggregation
*Still working on event processing and distribution
#CASSANDRA13
https://github.com/project-z/
#CASSANDRA13
mstump@kissmetrics.com
@mattstump
#CASSANDRA13
THANK YOU

Más contenido relacionado

Más de DataStax Academy

Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
DataStax Academy
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First Cluster
DataStax Academy
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with Dse
DataStax Academy
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache Cassandra
DataStax Academy
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
DataStax Academy
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
DataStax Academy
 

Más de DataStax Academy (20)

Coursera Cassandra Driver
Coursera Cassandra DriverCoursera Cassandra Driver
Coursera Cassandra Driver
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready Cassandra
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First Cluster
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with Dse
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache Cassandra
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
 
Bad Habits Die Hard
Bad Habits Die Hard Bad Habits Die Hard
Bad Habits Die Hard
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
 
Advanced Cassandra
Advanced CassandraAdvanced Cassandra
Advanced Cassandra
 
Apache Cassandra and Drivers
Apache Cassandra and DriversApache Cassandra and Drivers
Apache Cassandra and Drivers
 
Getting Started with Graph Databases
Getting Started with Graph DatabasesGetting Started with Graph Databases
Getting Started with Graph Databases
 
Cassandra Data Maintenance with Spark
Cassandra Data Maintenance with SparkCassandra Data Maintenance with Spark
Cassandra Data Maintenance with Spark
 
Analytics with Spark and Cassandra
Analytics with Spark and CassandraAnalytics with Spark and Cassandra
Analytics with Spark and Cassandra
 
Make 2016 your year of SMACK talk
Make 2016 your year of SMACK talkMake 2016 your year of SMACK talk
Make 2016 your year of SMACK talk
 
Client Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right WayClient Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right Way
 
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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
 
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
 
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
 
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...
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

C* Summit 2013: Cassandra on Flash: Performance & Efficiency Lessons Learned by Matt Stump