SlideShare a Scribd company logo
Running Cassandra in AWS
Patrick Eaton, PhD
patrick@stackdriver.com
@PatrickREaton

Joey Imbasciano
joey@stackdriver.com
@_joeyi
Stackdriver at a Glance

Stackdriver's hosted intelligent monitoring service helps
SaaS companies innovate more by reducing the burden of
day-to-day operations
● Cloud-native and cloud-aware
● Designed for complex distributed applications
● Founded by cloud/infrastructure industry veterans
(Microsoft, VMware, EMC, Endeca, Red Hat) with deep
systems and DevOps expertise
● Team of ~25, based in Downtown Boston
Intelligent Monitoring
Discover customer’s cloud-hosted
applications
●
●
●
●

Infrastructure inventory
Logical units, like groups/clusters
Services, hosted and self-managed
Elastic resources

Monitor
●

●

Various data sources
● Provider metrics
● Host metrics
● Custom metrics
● Endpoints
● Events
● Health
Rich visualizations

Analyze
●
●
●
●
●

Integrate data sources
Aggregate metrics
Report utilization, cost, etc.
Detect policy violations
Recommend actions
Lambda Architecture
●
●
●
●

●

●

Typical of modern architectures for on-line
applications.
Formalized by Nathan Marz
Composed of "batch", "speed", and "serving" layers
Batch layer
○ Store of record
○ Compute arbitrary views
Speed layer
○ Low latency updates
○ Streaming algorithms
Serving layer
○ Combine data from batch and speed layers to
answer queries

Serving

Speed

Batch

Data
Stackdriver Architecture
●
●
●

●

●

Shares characteristics of lambda architecture
Indexing (speed) path
○ Make "live" data available "pre-analysis"
Analysis (batch) path
○ Compute aggregations
○ Create recommendations
Query (serving) layer
○ Combine "live" and analyzed
data to answer queries
○ May require on-the-fly analysis
Alerting (speed) path (not discussed here)
○ Stream processing to detect

Query
(Serving)
Notification
(Serving)

Database

Indexing
(Speed)

Analysis
(Batch)

policy-based anomalies
Data

Alerting
(Speed)
Database Options
● We chose Cassandra!
○ True P2P architecture
○ Good support for write-heavy workloads
○ Compatible data model for time series data
■ Column per metric type, timestamps as columns
● Why not MySQL?
○ Experience with operating large, sharded deployments
○ Relational data model not a good match
● Why not HBase?
○ Operational complexity - zk, hadoop, hdfs, ...
○ Special "Master" role
● Why not Dynamo?
○ Avoid vendor lock-in and high cost
Stackdriver Architecture ++
●

Archival pipeline stores all data
● Very small surface area, battle-tested
● Critical for disaster recovery
● S3 considered durable enough
● Replicated for availability

Query

Cassandra

Roll-ups
Analysis
Recs

Inventory
Data Series
Analyze

●
●
●

Archive means Cassandra is "soft state"
C* consolidates analysis and indexing results
Properties of data in C*
● Immutable data
● Append-only
● Read-1, write-1 consistency

S3

Archive

Index

●

Scales out easily
● Indexers, archivers, analyzers, query servers
Data
Cassandra at Stackdriver Cluster Configuration

●
●
●
●
●

●

Version: Datastax Community Edition 1.2.10
Replication Factor: 3
Vnodes
Murmur3Partitioner
Ec2Snitch
○ Aids in request efficiency
○ Enables Cassandra to ensure replicas are in
different Availability Zones
phi_convict_threshold: 8 -> 12
○ Used to determine when nodes are down
○ AWS network can be spotty
Cassandra Topology in AWS
Where we started...

Where we are...

1
us-east-1a
us-east-1a

3

2

us-east-1c

us-east-1b
us-east-1c

Keep it balanced!

us-east-1b
Cassandra EC2 Node Configuration
● m1.xlarge
○ 4 cores
○ 15 GB RAM
○ 4 ephemeral disks available

● 4 disks RAID-0 for Data Volume and CommitLog
○
○
○
○

ext4 - defaults,noatime
mdadm RAID-0
Compactions
Heavy Read/Write IO
Cassandra Automation and Operations
● Combination of Boto, Fabric, &

Puppet
○ Boto for AWS API
○ Fabric + Puppet for Bootstrapping
○ Fabric for Operations

● One command to:
○
○
○
○
○

Launch a new cluster
Upsize a cluster
Replace a dead node
Remove existing nodes
List nodes in a cluster
Our (Internal) Slogan
Cassandra Backups using S3
● No Cassandra Powered Backups
● Restore from S3
● Useful for major version upgrades
Data

S3

Bulk
Loader

Map
Reduce

1. Data is archived when it is received
2. Bulk loader reads from S3
3. M/R re-analyzes data
4. Cassandra is repopulated

Cassandra
Disaster Recover in the Wild
●
●
●
●
●
●
●
●

October 23, Stackdriver suffered a total loss of our C* cluster
● Exhausted memory due to number of open file descriptors (see graph)
We did not notice the problem until it was too late
● Nodes began crashing, resulted in inconsistent view of the ring
Attempted to restart the cluster unsuccessfully for ~2 hours
Provisioned new 36 node cluster in ~2 hours
Directed “live” data to new cluster
Started bulk restore operation from archive
● Full-fidelity data and aggregations
No data loss due to archival pipeline
See http://www.stackdriver.com/post-mortem-october-23-stackdriver-outage/
Cluster Restoration Process
S3

Map
Reduce

Bulk
Loader

Historical Data
New Cluster
UI
UI
UI

UI
UI
API

UI
UI
Gateway
New Data

Old Cluster
Thank you!
Yes, we are hiring!
Patrick Eaton - patrick@stackdriver.com - @PatrickREaton
Joey Imbasciano - joey@stackdriver.com - @_joeyi

More Related Content

What's hot (20)

PPTX
How to size up an Apache Cassandra cluster (Training)
DataStax Academy
 
PDF
How we got to 1 millisecond latency in 99% under repair, compaction, and flus...
ScyllaDB
 
PDF
Apache Cassandra in the Real World
Jeremy Hanna
 
PPTX
Load testing Cassandra applications
Ben Slater
 
PDF
Micro-batching: High-performance writes
Instaclustr
 
PPTX
Scylla Summit 2018: Consensus in Eventually Consistent Databases
ScyllaDB
 
PDF
ScyllaDB @ Apache BigData, may 2016
Tzach Livyatan
 
PPTX
C* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag Jambhekar
DataStax Academy
 
PDF
Cassandra Introduction & Features
Phil Peace
 
PPTX
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
DataStax
 
PDF
Boyan Krosnov - Building a software-defined cloud - our experience
ShapeBlue
 
PDF
Back to the future with C++ and Seastar
Tzach Livyatan
 
PPTX
mParticle's Journey to Scylla from Cassandra
ScyllaDB
 
PDF
Cassandra Summit 2014: Active-Active Cassandra Behind the Scenes
DataStax Academy
 
PPTX
Everyday I’m scaling... Cassandra
Instaclustr
 
PPTX
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
DataStax
 
PPTX
Scylla Summit 2018: Keeping Your Latency SLAs No Matter What!
ScyllaDB
 
ODP
Intro to cassandra
Aaron Ploetz
 
PDF
Dynomite: A Highly Available, Distributed and Scalable Dynamo Layer--Ioannis ...
Redis Labs
 
PDF
How to Monitor and Size Workloads on AWS i3 instances
ScyllaDB
 
How to size up an Apache Cassandra cluster (Training)
DataStax Academy
 
How we got to 1 millisecond latency in 99% under repair, compaction, and flus...
ScyllaDB
 
Apache Cassandra in the Real World
Jeremy Hanna
 
Load testing Cassandra applications
Ben Slater
 
Micro-batching: High-performance writes
Instaclustr
 
Scylla Summit 2018: Consensus in Eventually Consistent Databases
ScyllaDB
 
ScyllaDB @ Apache BigData, may 2016
Tzach Livyatan
 
C* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag Jambhekar
DataStax Academy
 
Cassandra Introduction & Features
Phil Peace
 
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
DataStax
 
Boyan Krosnov - Building a software-defined cloud - our experience
ShapeBlue
 
Back to the future with C++ and Seastar
Tzach Livyatan
 
mParticle's Journey to Scylla from Cassandra
ScyllaDB
 
Cassandra Summit 2014: Active-Active Cassandra Behind the Scenes
DataStax Academy
 
Everyday I’m scaling... Cassandra
Instaclustr
 
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
DataStax
 
Scylla Summit 2018: Keeping Your Latency SLAs No Matter What!
ScyllaDB
 
Intro to cassandra
Aaron Ploetz
 
Dynomite: A Highly Available, Distributed and Scalable Dynamo Layer--Ioannis ...
Redis Labs
 
How to Monitor and Size Workloads on AWS i3 instances
ScyllaDB
 

Viewers also liked (17)

PDF
Cassandra Summit 2013 Keynote
jbellis
 
PDF
Monitoring with Stackdriver
denise stockman
 
PPTX
Google Cloud Platform monitoring with Zabbix
Max Kuzkin
 
PPTX
Bootify your spring application
Jimmy Lu
 
PDF
GumGum: Multi-Region Cassandra in AWS
DataStax Academy
 
PPT
сувид практическое пособие по применению
FoodRussiaSchool
 
PDF
Cloud Connect 2013- Lock Stock and x Smoking EC2's
Harish Ganesan
 
PDF
Lightning Hedis
Mu Chun Wang
 
PDF
Introduction to cassandra 2014
Patrick McFadin
 
PDF
Cassandra 3.0
Robert Stupp
 
PPTX
Disaster Recovery Planning using Azure Site Recovery
Nitin Agarwal
 
PPTX
Introduction to DataStax Enterprise Graph Database
DataStax Academy
 
PDF
Cassandra 2.1 簡介
Cloud Tu
 
PPTX
阿里自研数据库 Ocean base实践
wuqiuping
 
PDF
Microsoft: Building a Massively Scalable System with DataStax and Microsoft's...
DataStax Academy
 
PPTX
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Acunu
 
PPTX
Amazon AWS basics needed to run a Cassandra Cluster in AWS
Jean-Paul Azar
 
Cassandra Summit 2013 Keynote
jbellis
 
Monitoring with Stackdriver
denise stockman
 
Google Cloud Platform monitoring with Zabbix
Max Kuzkin
 
Bootify your spring application
Jimmy Lu
 
GumGum: Multi-Region Cassandra in AWS
DataStax Academy
 
сувид практическое пособие по применению
FoodRussiaSchool
 
Cloud Connect 2013- Lock Stock and x Smoking EC2's
Harish Ganesan
 
Lightning Hedis
Mu Chun Wang
 
Introduction to cassandra 2014
Patrick McFadin
 
Cassandra 3.0
Robert Stupp
 
Disaster Recovery Planning using Azure Site Recovery
Nitin Agarwal
 
Introduction to DataStax Enterprise Graph Database
DataStax Academy
 
Cassandra 2.1 簡介
Cloud Tu
 
阿里自研数据库 Ocean base实践
wuqiuping
 
Microsoft: Building a Massively Scalable System with DataStax and Microsoft's...
DataStax Academy
 
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Acunu
 
Amazon AWS basics needed to run a Cassandra Cluster in AWS
Jean-Paul Azar
 
Ad

Similar to Running Cassandra in AWS (20)

PDF
NetflixOSS Meetup season 3 episode 1
Ruslan Meshenberg
 
PDF
Introducing the ultimate MariaDB cloud, SkySQL
MariaDB plc
 
PDF
Real-time analytics with Druid at Appsflyer
Michael Spector
 
PDF
Study Notes - Architecting for the cloud (AWS Best Practices, Feb 2016)
Rick Hwang
 
PPTX
Automating using Ansible
Alok Patra
 
PDF
Netflix Container Scheduling and Execution - QCon New York 2016
aspyker
 
PDF
Scheduling a fuller house - Talk at QCon NY 2016
Sharma Podila
 
PDF
An Introduction to Apache Cassandra
Saeid Zebardast
 
PDF
Lambda at Weather Scale - Cassandra Summit 2015
Robbie Strickland
 
PDF
Public Cloud Workshop
Amer Ather
 
PDF
[RightScale Webinar] Architecting Databases in the cloud: How RightScale Doe...
RightScale
 
PDF
[Virtual Meetup] Using Elasticsearch as a Time-Series Database in the Endpoin...
Anna Ossowski
 
PPTX
AWS Big Data Demystified #1: Big data architecture lessons learned
Omid Vahdaty
 
PDF
Initial presentation of swift (for montreal user group)
Marcos García
 
PDF
Orchestrating Cassandra with Kubernetes: Challenges and Opportunities
Raghavendra Prabhu
 
PDF
Welcome to icehouse
Marcos García
 
PPTX
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
VMware Tanzu
 
PPTX
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
Carlos Andrés García
 
PDF
Elasticsearch as a time series database
felixbarny
 
PDF
Insta clustr seattle kafka meetup presentation bb
Nitin Kumar
 
NetflixOSS Meetup season 3 episode 1
Ruslan Meshenberg
 
Introducing the ultimate MariaDB cloud, SkySQL
MariaDB plc
 
Real-time analytics with Druid at Appsflyer
Michael Spector
 
Study Notes - Architecting for the cloud (AWS Best Practices, Feb 2016)
Rick Hwang
 
Automating using Ansible
Alok Patra
 
Netflix Container Scheduling and Execution - QCon New York 2016
aspyker
 
Scheduling a fuller house - Talk at QCon NY 2016
Sharma Podila
 
An Introduction to Apache Cassandra
Saeid Zebardast
 
Lambda at Weather Scale - Cassandra Summit 2015
Robbie Strickland
 
Public Cloud Workshop
Amer Ather
 
[RightScale Webinar] Architecting Databases in the cloud: How RightScale Doe...
RightScale
 
[Virtual Meetup] Using Elasticsearch as a Time-Series Database in the Endpoin...
Anna Ossowski
 
AWS Big Data Demystified #1: Big data architecture lessons learned
Omid Vahdaty
 
Initial presentation of swift (for montreal user group)
Marcos García
 
Orchestrating Cassandra with Kubernetes: Challenges and Opportunities
Raghavendra Prabhu
 
Welcome to icehouse
Marcos García
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
VMware Tanzu
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
Carlos Andrés García
 
Elasticsearch as a time series database
felixbarny
 
Insta clustr seattle kafka meetup presentation bb
Nitin Kumar
 
Ad

More from DataStax Academy (20)

PDF
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
DataStax Academy
 
PPTX
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
DataStax Academy
 
PDF
Cassandra 3.0 Data Modeling
DataStax Academy
 
PPTX
Cassandra Adoption on Cisco UCS & Open stack
DataStax Academy
 
PDF
Data Modeling for Apache Cassandra
DataStax Academy
 
PDF
Coursera Cassandra Driver
DataStax Academy
 
PDF
Production Ready Cassandra
DataStax Academy
 
PDF
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
DataStax Academy
 
PPTX
Cassandra @ Sony: The good, the bad, and the ugly part 1
DataStax Academy
 
PPTX
Cassandra @ Sony: The good, the bad, and the ugly part 2
DataStax Academy
 
PDF
Standing Up Your First Cluster
DataStax Academy
 
PDF
Real Time Analytics with Dse
DataStax Academy
 
PDF
Introduction to Data Modeling with Apache Cassandra
DataStax Academy
 
PDF
Cassandra Core Concepts
DataStax Academy
 
PPTX
Enabling Search in your Cassandra Application with DataStax Enterprise
DataStax Academy
 
PPTX
Bad Habits Die Hard
DataStax Academy
 
PDF
Advanced Data Modeling with Apache Cassandra
DataStax Academy
 
PDF
Advanced Cassandra
DataStax Academy
 
PDF
Apache Cassandra and Drivers
DataStax Academy
 
PDF
Getting Started with Graph Databases
DataStax Academy
 
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
DataStax Academy
 
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
DataStax Academy
 
Cassandra 3.0 Data Modeling
DataStax Academy
 
Cassandra Adoption on Cisco UCS & Open stack
DataStax Academy
 
Data Modeling for Apache Cassandra
DataStax Academy
 
Coursera Cassandra Driver
DataStax Academy
 
Production Ready Cassandra
DataStax Academy
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
DataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
DataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
DataStax Academy
 
Standing Up Your First Cluster
DataStax Academy
 
Real Time Analytics with Dse
DataStax Academy
 
Introduction to Data Modeling with Apache Cassandra
DataStax Academy
 
Cassandra Core Concepts
DataStax Academy
 
Enabling Search in your Cassandra Application with DataStax Enterprise
DataStax Academy
 
Bad Habits Die Hard
DataStax Academy
 
Advanced Data Modeling with Apache Cassandra
DataStax Academy
 
Advanced Cassandra
DataStax Academy
 
Apache Cassandra and Drivers
DataStax Academy
 
Getting Started with Graph Databases
DataStax Academy
 

Recently uploaded (20)

PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 

Running Cassandra in AWS

  • 1. Running Cassandra in AWS Patrick Eaton, PhD [email protected] @PatrickREaton Joey Imbasciano [email protected] @_joeyi
  • 2. Stackdriver at a Glance Stackdriver's hosted intelligent monitoring service helps SaaS companies innovate more by reducing the burden of day-to-day operations ● Cloud-native and cloud-aware ● Designed for complex distributed applications ● Founded by cloud/infrastructure industry veterans (Microsoft, VMware, EMC, Endeca, Red Hat) with deep systems and DevOps expertise ● Team of ~25, based in Downtown Boston
  • 3. Intelligent Monitoring Discover customer’s cloud-hosted applications ● ● ● ● Infrastructure inventory Logical units, like groups/clusters Services, hosted and self-managed Elastic resources Monitor ● ● Various data sources ● Provider metrics ● Host metrics ● Custom metrics ● Endpoints ● Events ● Health Rich visualizations Analyze ● ● ● ● ● Integrate data sources Aggregate metrics Report utilization, cost, etc. Detect policy violations Recommend actions
  • 4. Lambda Architecture ● ● ● ● ● ● Typical of modern architectures for on-line applications. Formalized by Nathan Marz Composed of "batch", "speed", and "serving" layers Batch layer ○ Store of record ○ Compute arbitrary views Speed layer ○ Low latency updates ○ Streaming algorithms Serving layer ○ Combine data from batch and speed layers to answer queries Serving Speed Batch Data
  • 5. Stackdriver Architecture ● ● ● ● ● Shares characteristics of lambda architecture Indexing (speed) path ○ Make "live" data available "pre-analysis" Analysis (batch) path ○ Compute aggregations ○ Create recommendations Query (serving) layer ○ Combine "live" and analyzed data to answer queries ○ May require on-the-fly analysis Alerting (speed) path (not discussed here) ○ Stream processing to detect Query (Serving) Notification (Serving) Database Indexing (Speed) Analysis (Batch) policy-based anomalies Data Alerting (Speed)
  • 6. Database Options ● We chose Cassandra! ○ True P2P architecture ○ Good support for write-heavy workloads ○ Compatible data model for time series data ■ Column per metric type, timestamps as columns ● Why not MySQL? ○ Experience with operating large, sharded deployments ○ Relational data model not a good match ● Why not HBase? ○ Operational complexity - zk, hadoop, hdfs, ... ○ Special "Master" role ● Why not Dynamo? ○ Avoid vendor lock-in and high cost
  • 7. Stackdriver Architecture ++ ● Archival pipeline stores all data ● Very small surface area, battle-tested ● Critical for disaster recovery ● S3 considered durable enough ● Replicated for availability Query Cassandra Roll-ups Analysis Recs Inventory Data Series Analyze ● ● ● Archive means Cassandra is "soft state" C* consolidates analysis and indexing results Properties of data in C* ● Immutable data ● Append-only ● Read-1, write-1 consistency S3 Archive Index ● Scales out easily ● Indexers, archivers, analyzers, query servers Data
  • 8. Cassandra at Stackdriver Cluster Configuration ● ● ● ● ● ● Version: Datastax Community Edition 1.2.10 Replication Factor: 3 Vnodes Murmur3Partitioner Ec2Snitch ○ Aids in request efficiency ○ Enables Cassandra to ensure replicas are in different Availability Zones phi_convict_threshold: 8 -> 12 ○ Used to determine when nodes are down ○ AWS network can be spotty
  • 9. Cassandra Topology in AWS Where we started... Where we are... 1 us-east-1a us-east-1a 3 2 us-east-1c us-east-1b us-east-1c Keep it balanced! us-east-1b
  • 10. Cassandra EC2 Node Configuration ● m1.xlarge ○ 4 cores ○ 15 GB RAM ○ 4 ephemeral disks available ● 4 disks RAID-0 for Data Volume and CommitLog ○ ○ ○ ○ ext4 - defaults,noatime mdadm RAID-0 Compactions Heavy Read/Write IO
  • 11. Cassandra Automation and Operations ● Combination of Boto, Fabric, & Puppet ○ Boto for AWS API ○ Fabric + Puppet for Bootstrapping ○ Fabric for Operations ● One command to: ○ ○ ○ ○ ○ Launch a new cluster Upsize a cluster Replace a dead node Remove existing nodes List nodes in a cluster
  • 13. Cassandra Backups using S3 ● No Cassandra Powered Backups ● Restore from S3 ● Useful for major version upgrades Data S3 Bulk Loader Map Reduce 1. Data is archived when it is received 2. Bulk loader reads from S3 3. M/R re-analyzes data 4. Cassandra is repopulated Cassandra
  • 14. Disaster Recover in the Wild ● ● ● ● ● ● ● ● October 23, Stackdriver suffered a total loss of our C* cluster ● Exhausted memory due to number of open file descriptors (see graph) We did not notice the problem until it was too late ● Nodes began crashing, resulted in inconsistent view of the ring Attempted to restart the cluster unsuccessfully for ~2 hours Provisioned new 36 node cluster in ~2 hours Directed “live” data to new cluster Started bulk restore operation from archive ● Full-fidelity data and aggregations No data loss due to archival pipeline See http://www.stackdriver.com/post-mortem-october-23-stackdriver-outage/
  • 15. Cluster Restoration Process S3 Map Reduce Bulk Loader Historical Data New Cluster UI UI UI UI UI API UI UI Gateway New Data Old Cluster
  • 16. Thank you! Yes, we are hiring! Patrick Eaton - [email protected] - @PatrickREaton Joey Imbasciano - [email protected] - @_joeyi