SlideShare a Scribd company logo
1 of 31
Download to read offline
Building Highly Available Services
Using Cassandra
USE jax_london;!
SELECT * FROM presenters WHERE name = ‘Hayato Shimizu’;!
name
| title
| company | area!
----------------+---------------------+----------+------!
Hayato Shimizu | Solutions Architect | DataStax | EMEA!
Apache Cassandra
• 
• 
• 
• 
• 
• 
• 
• 

Created by Avinash Lakshman and Prashant Malik at Facebook
Amazon Dynamo + Google BigTable
Highly distributed database with data replication for redundancy
Active-Active Multi DC, master-less design – no single point of failure
High throughput!
Linearly scalable – volume, throughput
Used by many mission critical applications and services
2.0 is out!

©2013 DataStax Confidential. Do not distribute without consent.

2
C* Architecture – Data Replication

•  Token Range 0 -> 2127-1 in Ring Formation
•  Consistent Hashing Algorithm
•  Replica nodes in clockwise

©2013 DataStax Confidential. Do not distribute without consent.

3
C* Architecture - No Single Point of Failure

•  Client Load Balances
•  Do not use a hardware LB

©2013 DataStax Confidential. Do not distribute without consent.

4
C* Architecture - Multi DC Replication

©2013 DataStax Confidential. Do not distribute without consent.

5
C* Architecture – Data Consistency
•  C* offers TUNABLE consistency
•  Client decides consistency per query
•  ANY, ONE, TWO, THREE, QUORUM, LOCAL_QUORUM,
EACH_QUORUM, ALL
•  QUORUM = (replication_factor / 2 ) + 1
•  Replication Factor = 3 can maintain Quorum with tolerance of 1 node
failure

©2013 DataStax Confidential. Do not distribute without consent.

6
Setting Up Cassandra for Multi DC
On each node – edit the following file:
conf/cassandra-rackdc.properties
With the following entry:
dc=DC1
rack=RACK1
On each node – edit the following file:
conf/cassandra.yaml
With the following entry:
endpoint_snitch: GossipingPropertyFileSnitch
Create keyspace:
CREATE KEYSPACE new_keyspace WITH
replication = {'class': 'NetworkTopologyStrategy', 'DC1' : 3, 'DC2' : 3};

©2013 DataStax Confidential. Do not distribute without consent.

7
C* Architecture – Data Centre Configuration
Data 1
Data 3
Data 4

Data 2
Data 3
Data 4

©2013 DataStax Confidential. Do not distribute without consent.

Data 1
Data 2
Data 4

Data 1
Data 2
Data 3

8
Cassandra Architecture - Writes

INSERT INTO…
memtable

Commit log
SSTable

©2013 DataStax Confidential. Do not distribute without consent.

9
Tooling
• 
• 
• 
• 

Cassandra Download (http://planetcassandra.org)
DataStax Enterprise Download (http://www.datastax.com/download)
DataStax JAVA Driver (http://github.com/datastax/java-driver)
DataStax DevCenter (http://www.datastax.com)

©2013 DataStax Confidential. Do not distribute without consent.

10
Building
Highly Available Services

©2013 DataStax Confidential. Do not distribute without consent.

11
Single Data Centre
•  Resiliency through C* Data Replication

12

©2013 DataStax Confidential. Do not distribute without consent.
Multi DC – Active/Passive
• 
• 
• 
• 
• 
• 
• 
• 

Wasteful
Do you test this? Does it actually work when it fails over?
What is the decision point for failing over?
Do you try and fix your problem in the active DC?
Is it a manual process?
How long does it take to failover to passive DC?
How many people and which departments will need to be involved?
Incident managers?

©2013 DataStax Confidential. Do not distribute without consent.

13
Active-Everywhere is the Norm

Cloud
Datacenter
Source: (http://www.datastax.com/resources/whitepapers/bigdata)
©2013 DataStax Confidential. Do not distribute without consent.

14
Design Considerations - Active-Everywhere DC Strategies
•  24 x 7 services are what businesses and consumers now expect
•  Service failure costs money and reputational damage
•  99.999+% service up time?
•  Data Replication Strategies
•  Consistent data replication across all DCs
•  Eventually consistent replication across DCs

©2013 DataStax Confidential. Do not distribute without consent.

15
Design Considerations - Data Replication Strategies
•  Latency is not going away – embrace it
•  Possible Solutions
•  Sharded users
•  Full data consistency in all DCs
•  Eventually consistency to other DCs

©2013 DataStax Confidential. Do not distribute without consent.

16
Design Considerations - Full Consistency Across All Data Centres
• 
• 
• 
• 

Does your service really require this?
Performance considerations
Think about your service usage patterns
Failure scenarios
•  WAN Link failure

©2013 DataStax Confidential. Do not distribute without consent.

17
Design Considerations - Eventual Consistency Across DCs
•  Identify data access patterns for each service
•  Data access patterns
•  Write-Only
•  Read-Only
•  Mixture of both
•  Access frequency

©2013 DataStax Confidential. Do not distribute without consent.

18
Design Considerations - Failure Scenarios
• 
• 
• 
• 
• 
• 
• 

Data centre total failure – natural disaster, power, etc
Network storm
Network kit firmware upgrade failure
SAN Upgrades – wrong Fibre Channel cable pulled out
WAN link failure
Service dependency failure
Etc, etc

•  Failure probabilities - do your maths!

©2013 DataStax Confidential. Do not distribute without consent.

19
User Session Persistence to One DC
Session 1

Session 2

DC1

DC2
Service

C*

©2013 DataStax Confidential. Do not distribute without consent.

Service

Async
Replication

20

C*
DC Session Persistence Technique 1
•  GTM – Global Traffic Management
•  DNS based solution
•  Hardware / SaaS solutions
•  Traffic weighting for each DC
•  Persistence guaranteed in private network using hardware
•  Internet facing slightly more difficult – DNS RFC spec

©2013 DataStax Confidential. Do not distribute without consent.

21
DC Session Persistence Technique 2
•  A famous company providing edge based load balancing
•  Users connect via their service
•  Cookie / query string based

Edge Load Balancer
https
async

DC1

©2013 DataStax Confidential. Do not distribute without consent.

https

22

DC2
DC Session Persistence Technique 3

©2013 DataStax Confidential. Do not distribute without consent.

23
Application Tier Resilience
• 
• 
• 
• 

Make it fault tolerant – stateless.
Make it horizontally scalable
Load balancer stickiness – really?
Use C* to store sessions - sessions will recover in a DR scenario.

App Tier
Session1

App Tier

App Tier

Session1

App Tier
Session1

Cassandra Replication
Session1

©2013 DataStax Confidential. Do not distribute without consent.

24
Seamless Application Releases & System Maintenance
•  99.999+% SLA includes maintenance!
•  C* rolling upgrades
•  Kernel patching etc
•  Schema Changes – C* will help
•  Code should now handle the data structure versions
•  Code deployment - statelessness will help here again!

©2013 DataStax Confidential. Do not distribute without consent.

25
Business Intelligence

©2013 DataStax Confidential. Do not distribute without consent.

26
Embracing the Cloud
• 
• 
• 
• 

High demand can kill your service – make it scalable
Bursting into the cloud for peak load
Flexible provisioning model
DR on the cheap

©2013 DataStax Confidential. Do not distribute without consent.

27
Conclusions

©2013 DataStax Confidential. Do not distribute without consent.

28
Conclusion
•  Developers - think about your infrastructure. Don’t just leave it to the Ops
or DevOps teams.
•  Ops / DevOps Engineers – think about the application and learn how they
work.
•  Collaborate with each other.
•  Building out resilient infrastructure is not that hard. Just requires some
thoughts, communications, and execution.
•  Think about scale.
•  Keep IT Simple
•  Use great tools like Cassandra

©2013 DataStax Confidential. Do not distribute without consent.

29
Thank You

Downloads

Twitter

http://planetcassandra.org
http://www.datastax.com
http://cassandra.apache.org

@hayato_shimizu
@datastaxEU
@planetcassandra
@cassandraEUROPE

©2013 DataStax Confidential. Do not distribute without consent.

30
Thank You

Q&A
©2013 DataStax Confidential. Do not distribute without consent.

31

More Related Content

What's hot

What's hot (20)

Transforms Document Management at Scale with Distributed Database Solution wi...
Transforms Document Management at Scale with Distributed Database Solution wi...Transforms Document Management at Scale with Distributed Database Solution wi...
Transforms Document Management at Scale with Distributed Database Solution wi...
 
Making Every Drop Count: How i20 Addresses the Water Crisis with the IoT and ...
Making Every Drop Count: How i20 Addresses the Water Crisis with the IoT and ...Making Every Drop Count: How i20 Addresses the Water Crisis with the IoT and ...
Making Every Drop Count: How i20 Addresses the Water Crisis with the IoT and ...
 
Managing Cassandra Databases with OpenStack Trove
Managing Cassandra Databases with OpenStack TroveManaging Cassandra Databases with OpenStack Trove
Managing Cassandra Databases with OpenStack Trove
 
How jKool Analyzes Streaming Data in Real Time with DataStax
How jKool Analyzes Streaming Data in Real Time with DataStaxHow jKool Analyzes Streaming Data in Real Time with DataStax
How jKool Analyzes Streaming Data in Real Time with DataStax
 
Real-time personal trainer on the SMACK stack
Real-time personal trainer on the SMACK stackReal-time personal trainer on the SMACK stack
Real-time personal trainer on the SMACK stack
 
Building a Digital Bank
Building a Digital BankBuilding a Digital Bank
Building a Digital Bank
 
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...
 
Introducing DataStax Enterprise 4.7
Introducing DataStax Enterprise 4.7Introducing DataStax Enterprise 4.7
Introducing DataStax Enterprise 4.7
 
How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...
How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...
How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...
 
Webinar: ROI on Big Data - RDBMS, NoSQL or Both? A Simple Guide for Knowing H...
Webinar: ROI on Big Data - RDBMS, NoSQL or Both? A Simple Guide for Knowing H...Webinar: ROI on Big Data - RDBMS, NoSQL or Both? A Simple Guide for Knowing H...
Webinar: ROI on Big Data - RDBMS, NoSQL or Both? A Simple Guide for Knowing H...
 
How Orwell built a geo-distributed Bank-as-a-Service with microservices
How Orwell built a geo-distributed Bank-as-a-Service with microservicesHow Orwell built a geo-distributed Bank-as-a-Service with microservices
How Orwell built a geo-distributed Bank-as-a-Service with microservices
 
DataStax Training – Everything you need to become a Cassandra Rockstar
DataStax Training – Everything you need to become a Cassandra RockstarDataStax Training – Everything you need to become a Cassandra Rockstar
DataStax Training – Everything you need to become a Cassandra Rockstar
 
DataStax C*ollege Credit: What and Why NoSQL?
DataStax C*ollege Credit: What and Why NoSQL?DataStax C*ollege Credit: What and Why NoSQL?
DataStax C*ollege Credit: What and Why NoSQL?
 
Scylla Summit 2022: ScyllaDB Cloud: Simplifying Deployment to the Public Cloud
Scylla Summit 2022: ScyllaDB Cloud: Simplifying Deployment to the Public CloudScylla Summit 2022: ScyllaDB Cloud: Simplifying Deployment to the Public Cloud
Scylla Summit 2022: ScyllaDB Cloud: Simplifying Deployment to the Public Cloud
 
Getting started in the cloud for developers
Getting started in the cloud for developersGetting started in the cloud for developers
Getting started in the cloud for developers
 
Webinar: Bitcoins and Blockchains - Emerging Financial Services Trends and Te...
Webinar: Bitcoins and Blockchains - Emerging Financial Services Trends and Te...Webinar: Bitcoins and Blockchains - Emerging Financial Services Trends and Te...
Webinar: Bitcoins and Blockchains - Emerging Financial Services Trends and Te...
 
Announcing Spark Driver for Cassandra
Announcing Spark Driver for CassandraAnnouncing Spark Driver for Cassandra
Announcing Spark Driver for Cassandra
 
Cassandra at eBay - Cassandra Summit 2013
Cassandra at eBay - Cassandra Summit 2013Cassandra at eBay - Cassandra Summit 2013
Cassandra at eBay - Cassandra Summit 2013
 
Introducing workload analysis
Introducing workload analysisIntroducing workload analysis
Introducing workload analysis
 
Life After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data CloudLife After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data Cloud
 

Viewers also liked

Interactive media applications
Interactive media applicationsInteractive media applications
Interactive media applications
Nicole174
 
45 second video proposal
45 second video proposal45 second video proposal
45 second video proposal
Nicole174
 
Legal and ethical considerations redone
Legal and ethical considerations   redoneLegal and ethical considerations   redone
Legal and ethical considerations redone
Nicole174
 
Interactive media applications
Interactive media applicationsInteractive media applications
Interactive media applications
Nicole174
 

Viewers also liked (20)

Big Events, Mob Scale - Darach Ennis (Push Technology)
Big Events, Mob Scale - Darach Ennis (Push Technology)Big Events, Mob Scale - Darach Ennis (Push Technology)
Big Events, Mob Scale - Darach Ennis (Push Technology)
 
Lambda Expressions: Myths and Mistakes - Richard Warburton (jClarity)
Lambda Expressions: Myths and Mistakes - Richard Warburton (jClarity)Lambda Expressions: Myths and Mistakes - Richard Warburton (jClarity)
Lambda Expressions: Myths and Mistakes - Richard Warburton (jClarity)
 
Packed Objects: Fast Talking Java Meets Native Code - Steve Poole (IBM)
Packed Objects: Fast Talking Java Meets Native Code - Steve Poole (IBM)Packed Objects: Fast Talking Java Meets Native Code - Steve Poole (IBM)
Packed Objects: Fast Talking Java Meets Native Code - Steve Poole (IBM)
 
Are Hypermedia APIs Just Hype? - Aaron Phethean (Temenos) & Daniel Feist (Mul...
Are Hypermedia APIs Just Hype? - Aaron Phethean (Temenos) & Daniel Feist (Mul...Are Hypermedia APIs Just Hype? - Aaron Phethean (Temenos) & Daniel Feist (Mul...
Are Hypermedia APIs Just Hype? - Aaron Phethean (Temenos) & Daniel Feist (Mul...
 
Interactive media applications
Interactive media applicationsInteractive media applications
Interactive media applications
 
45 second video proposal
45 second video proposal45 second video proposal
45 second video proposal
 
Big data from the LHC commissioning: practical lessons from big science - Sim...
Big data from the LHC commissioning: practical lessons from big science - Sim...Big data from the LHC commissioning: practical lessons from big science - Sim...
Big data from the LHC commissioning: practical lessons from big science - Sim...
 
Scaling Scala to the database - Stefan Zeiger (Typesafe)
Scaling Scala to the database - Stefan Zeiger (Typesafe)Scaling Scala to the database - Stefan Zeiger (Typesafe)
Scaling Scala to the database - Stefan Zeiger (Typesafe)
 
How Hailo fuels its growth using NoSQL storage and analytics - Dave Gardner (...
How Hailo fuels its growth using NoSQL storage and analytics - Dave Gardner (...How Hailo fuels its growth using NoSQL storage and analytics - Dave Gardner (...
How Hailo fuels its growth using NoSQL storage and analytics - Dave Gardner (...
 
Why other ppl_dont_get_it
Why other ppl_dont_get_itWhy other ppl_dont_get_it
Why other ppl_dont_get_it
 
Practical Performance: Understand the Performance of Your Application - Chris...
Practical Performance: Understand the Performance of Your Application - Chris...Practical Performance: Understand the Performance of Your Application - Chris...
Practical Performance: Understand the Performance of Your Application - Chris...
 
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
 
Little words of wisdom for the developer - Guillaume Laforge (Pivotal)
Little words of wisdom for the developer - Guillaume Laforge (Pivotal)Little words of wisdom for the developer - Guillaume Laforge (Pivotal)
Little words of wisdom for the developer - Guillaume Laforge (Pivotal)
 
Designing and Building a Graph Database Application - Ian Robinson (Neo Techn...
Designing and Building a Graph Database Application - Ian Robinson (Neo Techn...Designing and Building a Graph Database Application - Ian Robinson (Neo Techn...
Designing and Building a Graph Database Application - Ian Robinson (Neo Techn...
 
Legal and ethical considerations redone
Legal and ethical considerations   redoneLegal and ethical considerations   redone
Legal and ethical considerations redone
 
Streams and Things - Darach Ennis (Ubiquiti Networks)
Streams and Things - Darach Ennis (Ubiquiti Networks)Streams and Things - Darach Ennis (Ubiquiti Networks)
Streams and Things - Darach Ennis (Ubiquiti Networks)
 
Design is a Process, not an Artefact - Trisha Gee (MongoDB)
Design is a Process, not an Artefact - Trisha Gee (MongoDB)Design is a Process, not an Artefact - Trisha Gee (MongoDB)
Design is a Process, not an Artefact - Trisha Gee (MongoDB)
 
A real-time architecture using Hadoop & Storm - Nathan Bijnens & Geert Van La...
A real-time architecture using Hadoop & Storm - Nathan Bijnens & Geert Van La...A real-time architecture using Hadoop & Storm - Nathan Bijnens & Geert Van La...
A real-time architecture using Hadoop & Storm - Nathan Bijnens & Geert Van La...
 
Interactive media applications
Interactive media applicationsInteractive media applications
Interactive media applications
 
What You Need to Know About Lambdas - Jamie Allen (Typesafe)
What You Need to Know About Lambdas - Jamie Allen (Typesafe)What You Need to Know About Lambdas - Jamie Allen (Typesafe)
What You Need to Know About Lambdas - Jamie Allen (Typesafe)
 

Similar to Designing Resilient Application Platforms with Apache Cassandra - Hayato Shimizu (DataStax)

Similar to Designing Resilient Application Platforms with Apache Cassandra - Hayato Shimizu (DataStax) (20)

Using Mainframe Data in the Cloud: Design Once, Deploy Anywhere in a Hybrid W...
Using Mainframe Data in the Cloud: Design Once, Deploy Anywhere in a Hybrid W...Using Mainframe Data in the Cloud: Design Once, Deploy Anywhere in a Hybrid W...
Using Mainframe Data in the Cloud: Design Once, Deploy Anywhere in a Hybrid W...
 
Keeping Data in Sync with Syncsort
Keeping Data in Sync with SyncsortKeeping Data in Sync with Syncsort
Keeping Data in Sync with Syncsort
 
Big data journey to the cloud 5.30.18 asher bartch
Big data journey to the cloud 5.30.18   asher bartchBig data journey to the cloud 5.30.18   asher bartch
Big data journey to the cloud 5.30.18 asher bartch
 
Webinar: What's Wrong with DRaaS and How to Fix it
Webinar: What's Wrong with DRaaS and How to Fix itWebinar: What's Wrong with DRaaS and How to Fix it
Webinar: What's Wrong with DRaaS and How to Fix it
 
Slides: Enterprise Architecture vs. Data Architecture
Slides: Enterprise Architecture vs. Data ArchitectureSlides: Enterprise Architecture vs. Data Architecture
Slides: Enterprise Architecture vs. Data Architecture
 
Technical Deck Delta Live Tables.pdf
Technical Deck Delta Live Tables.pdfTechnical Deck Delta Live Tables.pdf
Technical Deck Delta Live Tables.pdf
 
Webinar: Cloud Data Masking - Tips to Test Software Securely
Webinar: Cloud Data Masking - Tips to Test Software Securely Webinar: Cloud Data Masking - Tips to Test Software Securely
Webinar: Cloud Data Masking - Tips to Test Software Securely
 
The Pandemic Changes Everything, the Need for Speed and Resiliency
The Pandemic Changes Everything, the Need for Speed and ResiliencyThe Pandemic Changes Everything, the Need for Speed and Resiliency
The Pandemic Changes Everything, the Need for Speed and Resiliency
 
Key Database Criteria for Cloud Applications
Key Database Criteria for Cloud ApplicationsKey Database Criteria for Cloud Applications
Key Database Criteria for Cloud Applications
 
Going Remote: Running VFX Virtual Workstations
Going Remote: Running VFX Virtual WorkstationsGoing Remote: Running VFX Virtual Workstations
Going Remote: Running VFX Virtual Workstations
 
DimenXional Cloud Technologies (slideshare)
DimenXional Cloud Technologies (slideshare)DimenXional Cloud Technologies (slideshare)
DimenXional Cloud Technologies (slideshare)
 
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
 
Is Citrix Cloud Enterprise Ready? Best Practices to Get the Most Out of Citri...
Is Citrix Cloud Enterprise Ready? Best Practices to Get the Most Out of Citri...Is Citrix Cloud Enterprise Ready? Best Practices to Get the Most Out of Citri...
Is Citrix Cloud Enterprise Ready? Best Practices to Get the Most Out of Citri...
 
VMworld 2013: How To Build Your Hybrid Cloud and Consume the Public Cloud
VMworld 2013: How To Build Your Hybrid Cloud and Consume the Public Cloud VMworld 2013: How To Build Your Hybrid Cloud and Consume the Public Cloud
VMworld 2013: How To Build Your Hybrid Cloud and Consume the Public Cloud
 
How Data Drives Business at Choice Hotels
How Data Drives Business at Choice HotelsHow Data Drives Business at Choice Hotels
How Data Drives Business at Choice Hotels
 
Implement a Universal Data Distribution Architecture to Manage All Streaming ...
Implement a Universal Data Distribution Architecture to Manage All Streaming ...Implement a Universal Data Distribution Architecture to Manage All Streaming ...
Implement a Universal Data Distribution Architecture to Manage All Streaming ...
 
Infrastructure Migration from Windows Server 2003 to the Cloud: An Interoute ...
Infrastructure Migration from Windows Server 2003 to the Cloud: An Interoute ...Infrastructure Migration from Windows Server 2003 to the Cloud: An Interoute ...
Infrastructure Migration from Windows Server 2003 to the Cloud: An Interoute ...
 
Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1
 
PartnerSkillUp_Enable a Streaming CDC Solution
PartnerSkillUp_Enable a Streaming CDC SolutionPartnerSkillUp_Enable a Streaming CDC Solution
PartnerSkillUp_Enable a Streaming CDC Solution
 
Designing CloudStack Clouds
Designing CloudStack CloudsDesigning CloudStack Clouds
Designing CloudStack Clouds
 

More from jaxLondonConference

More from jaxLondonConference (18)

Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...
 
Conflict Free Replicated Data-types in Eventually Consistent Systems - Joel J...
Conflict Free Replicated Data-types in Eventually Consistent Systems - Joel J...Conflict Free Replicated Data-types in Eventually Consistent Systems - Joel J...
Conflict Free Replicated Data-types in Eventually Consistent Systems - Joel J...
 
JVM Support for Multitenant Applications - Steve Poole (IBM)
JVM Support for Multitenant Applications - Steve Poole (IBM)JVM Support for Multitenant Applications - Steve Poole (IBM)
JVM Support for Multitenant Applications - Steve Poole (IBM)
 
Databases and agile development - Dwight Merriman (MongoDB)
Databases and agile development - Dwight Merriman (MongoDB)Databases and agile development - Dwight Merriman (MongoDB)
Databases and agile development - Dwight Merriman (MongoDB)
 
How Java got its Mojo Back - James Governor (Redmonk)
How Java got its Mojo Back - James Governor (Redmonk)					How Java got its Mojo Back - James Governor (Redmonk)
How Java got its Mojo Back - James Governor (Redmonk)
 
Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
 
Java Testing With Spock - Ken Sipe (Trexin Consulting)
Java Testing With Spock - Ken Sipe (Trexin Consulting)Java Testing With Spock - Ken Sipe (Trexin Consulting)
Java Testing With Spock - Ken Sipe (Trexin Consulting)
 
What makes Groovy Groovy - Guillaume Laforge (Pivotal)
What makes Groovy Groovy  - Guillaume Laforge (Pivotal)What makes Groovy Groovy  - Guillaume Laforge (Pivotal)
What makes Groovy Groovy - Guillaume Laforge (Pivotal)
 
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
 
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
 
Exploring the Talend unified Big Data toolset for sentiment analysis - Ben Br...
Exploring the Talend unified Big Data toolset for sentiment analysis - Ben Br...Exploring the Talend unified Big Data toolset for sentiment analysis - Ben Br...
Exploring the Talend unified Big Data toolset for sentiment analysis - Ben Br...
 
The Curious Clojurist - Neal Ford (Thoughtworks)
The Curious Clojurist - Neal Ford (Thoughtworks)The Curious Clojurist - Neal Ford (Thoughtworks)
The Curious Clojurist - Neal Ford (Thoughtworks)
 
TDD at scale - Mash Badar (UBS)
TDD at scale - Mash Badar (UBS)TDD at scale - Mash Badar (UBS)
TDD at scale - Mash Badar (UBS)
 
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
 
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)
Put your Java apps to sleep? Find out how - John Matthew Holt (Waratek)
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
 
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
 
Large scale, interactive ad-hoc queries over different datastores with Apache...
Large scale, interactive ad-hoc queries over different datastores with Apache...Large scale, interactive ad-hoc queries over different datastores with Apache...
Large scale, interactive ad-hoc queries over different datastores with Apache...
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
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...
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 

Designing Resilient Application Platforms with Apache Cassandra - Hayato Shimizu (DataStax)

  • 1. Building Highly Available Services Using Cassandra USE jax_london;! SELECT * FROM presenters WHERE name = ‘Hayato Shimizu’;! name | title | company | area! ----------------+---------------------+----------+------! Hayato Shimizu | Solutions Architect | DataStax | EMEA!
  • 2. Apache Cassandra •  •  •  •  •  •  •  •  Created by Avinash Lakshman and Prashant Malik at Facebook Amazon Dynamo + Google BigTable Highly distributed database with data replication for redundancy Active-Active Multi DC, master-less design – no single point of failure High throughput! Linearly scalable – volume, throughput Used by many mission critical applications and services 2.0 is out! ©2013 DataStax Confidential. Do not distribute without consent. 2
  • 3. C* Architecture – Data Replication •  Token Range 0 -> 2127-1 in Ring Formation •  Consistent Hashing Algorithm •  Replica nodes in clockwise ©2013 DataStax Confidential. Do not distribute without consent. 3
  • 4. C* Architecture - No Single Point of Failure •  Client Load Balances •  Do not use a hardware LB ©2013 DataStax Confidential. Do not distribute without consent. 4
  • 5. C* Architecture - Multi DC Replication ©2013 DataStax Confidential. Do not distribute without consent. 5
  • 6. C* Architecture – Data Consistency •  C* offers TUNABLE consistency •  Client decides consistency per query •  ANY, ONE, TWO, THREE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL •  QUORUM = (replication_factor / 2 ) + 1 •  Replication Factor = 3 can maintain Quorum with tolerance of 1 node failure ©2013 DataStax Confidential. Do not distribute without consent. 6
  • 7. Setting Up Cassandra for Multi DC On each node – edit the following file: conf/cassandra-rackdc.properties With the following entry: dc=DC1 rack=RACK1 On each node – edit the following file: conf/cassandra.yaml With the following entry: endpoint_snitch: GossipingPropertyFileSnitch Create keyspace: CREATE KEYSPACE new_keyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1' : 3, 'DC2' : 3}; ©2013 DataStax Confidential. Do not distribute without consent. 7
  • 8. C* Architecture – Data Centre Configuration Data 1 Data 3 Data 4 Data 2 Data 3 Data 4 ©2013 DataStax Confidential. Do not distribute without consent. Data 1 Data 2 Data 4 Data 1 Data 2 Data 3 8
  • 9. Cassandra Architecture - Writes INSERT INTO… memtable Commit log SSTable ©2013 DataStax Confidential. Do not distribute without consent. 9
  • 10. Tooling •  •  •  •  Cassandra Download (http://planetcassandra.org) DataStax Enterprise Download (http://www.datastax.com/download) DataStax JAVA Driver (http://github.com/datastax/java-driver) DataStax DevCenter (http://www.datastax.com) ©2013 DataStax Confidential. Do not distribute without consent. 10
  • 11. Building Highly Available Services ©2013 DataStax Confidential. Do not distribute without consent. 11
  • 12. Single Data Centre •  Resiliency through C* Data Replication 12 ©2013 DataStax Confidential. Do not distribute without consent.
  • 13. Multi DC – Active/Passive •  •  •  •  •  •  •  •  Wasteful Do you test this? Does it actually work when it fails over? What is the decision point for failing over? Do you try and fix your problem in the active DC? Is it a manual process? How long does it take to failover to passive DC? How many people and which departments will need to be involved? Incident managers? ©2013 DataStax Confidential. Do not distribute without consent. 13
  • 14. Active-Everywhere is the Norm Cloud Datacenter Source: (http://www.datastax.com/resources/whitepapers/bigdata) ©2013 DataStax Confidential. Do not distribute without consent. 14
  • 15. Design Considerations - Active-Everywhere DC Strategies •  24 x 7 services are what businesses and consumers now expect •  Service failure costs money and reputational damage •  99.999+% service up time? •  Data Replication Strategies •  Consistent data replication across all DCs •  Eventually consistent replication across DCs ©2013 DataStax Confidential. Do not distribute without consent. 15
  • 16. Design Considerations - Data Replication Strategies •  Latency is not going away – embrace it •  Possible Solutions •  Sharded users •  Full data consistency in all DCs •  Eventually consistency to other DCs ©2013 DataStax Confidential. Do not distribute without consent. 16
  • 17. Design Considerations - Full Consistency Across All Data Centres •  •  •  •  Does your service really require this? Performance considerations Think about your service usage patterns Failure scenarios •  WAN Link failure ©2013 DataStax Confidential. Do not distribute without consent. 17
  • 18. Design Considerations - Eventual Consistency Across DCs •  Identify data access patterns for each service •  Data access patterns •  Write-Only •  Read-Only •  Mixture of both •  Access frequency ©2013 DataStax Confidential. Do not distribute without consent. 18
  • 19. Design Considerations - Failure Scenarios •  •  •  •  •  •  •  Data centre total failure – natural disaster, power, etc Network storm Network kit firmware upgrade failure SAN Upgrades – wrong Fibre Channel cable pulled out WAN link failure Service dependency failure Etc, etc •  Failure probabilities - do your maths! ©2013 DataStax Confidential. Do not distribute without consent. 19
  • 20. User Session Persistence to One DC Session 1 Session 2 DC1 DC2 Service C* ©2013 DataStax Confidential. Do not distribute without consent. Service Async Replication 20 C*
  • 21. DC Session Persistence Technique 1 •  GTM – Global Traffic Management •  DNS based solution •  Hardware / SaaS solutions •  Traffic weighting for each DC •  Persistence guaranteed in private network using hardware •  Internet facing slightly more difficult – DNS RFC spec ©2013 DataStax Confidential. Do not distribute without consent. 21
  • 22. DC Session Persistence Technique 2 •  A famous company providing edge based load balancing •  Users connect via their service •  Cookie / query string based Edge Load Balancer https async DC1 ©2013 DataStax Confidential. Do not distribute without consent. https 22 DC2
  • 23. DC Session Persistence Technique 3 ©2013 DataStax Confidential. Do not distribute without consent. 23
  • 24. Application Tier Resilience •  •  •  •  Make it fault tolerant – stateless. Make it horizontally scalable Load balancer stickiness – really? Use C* to store sessions - sessions will recover in a DR scenario. App Tier Session1 App Tier App Tier Session1 App Tier Session1 Cassandra Replication Session1 ©2013 DataStax Confidential. Do not distribute without consent. 24
  • 25. Seamless Application Releases & System Maintenance •  99.999+% SLA includes maintenance! •  C* rolling upgrades •  Kernel patching etc •  Schema Changes – C* will help •  Code should now handle the data structure versions •  Code deployment - statelessness will help here again! ©2013 DataStax Confidential. Do not distribute without consent. 25
  • 26. Business Intelligence ©2013 DataStax Confidential. Do not distribute without consent. 26
  • 27. Embracing the Cloud •  •  •  •  High demand can kill your service – make it scalable Bursting into the cloud for peak load Flexible provisioning model DR on the cheap ©2013 DataStax Confidential. Do not distribute without consent. 27
  • 28. Conclusions ©2013 DataStax Confidential. Do not distribute without consent. 28
  • 29. Conclusion •  Developers - think about your infrastructure. Don’t just leave it to the Ops or DevOps teams. •  Ops / DevOps Engineers – think about the application and learn how they work. •  Collaborate with each other. •  Building out resilient infrastructure is not that hard. Just requires some thoughts, communications, and execution. •  Think about scale. •  Keep IT Simple •  Use great tools like Cassandra ©2013 DataStax Confidential. Do not distribute without consent. 29
  • 31. Thank You Q&A ©2013 DataStax Confidential. Do not distribute without consent. 31