SlideShare a Scribd company logo
@chbatey
Fault tolerant microservices on
the JVM
Christopher Batey
DataStax
@chbatey
@chbatey
Who am I?
• DataStax
- Technical Evangelist / Software Engineer
- Builds enterprise ready version of Apache Cassandra
• Sky: Building next generation Internet TV platform
• Lots of time working on a test double for Apache Cassandra
@chbatey
Agenda
•Setting the scene
-What do we mean by a fault?
-What is a micro(ish)service?
-Monolith application vs the micro(ish)service
•A worked example
-Identify an issue
-Reproduce/test it
-Show how to deal with the issue
@chbatey
So… what do applications look like?
@chbatey
So… what do applications look like?
@chbatey
So… what do applications look like?
@chbatey
So… what do applications look like?
@chbatey
So… what do applications look like?
@chbatey
Small horizontal scalable services
• Move to small services independently deployed
- Login service
- Device service
- etc
• Move to a horizontally scalable Database that can run active
active in multiple data centres
@chbatey
So… what do applications look like?
@chbatey
So... what do systems look like now?
@chbatey
Pin
Service
Movie Player
User
Service
Device
Service
Play Movie
Example: Movie player service
@chbatey
Time for an example...
•All examples are on github
•Technologies used:
-Dropwizard
-Spring Boot
-Wiremock
-Hystrix
-Graphite
-Saboteur
@chbatey
Testing microservices
• You don’t know a service is fault tolerant if you don’t test faults
@chbatey
The test double
Wiremock for HTTP integration
Stubbed Cassandra for Database
Kafka Unit
@chbatey
Isolated service tests
Movie service
Mocks
User
Device
Pin
service
Play Movie
Acceptan
ce
Test
Prime
Real HTTP/TCP
@chbatey
Fault tolerance
1.Don’t take forever - Timeouts
2.Don’t try if you can’t succeed
3.Fail gracefully
4.Know if it’s your fault
5.Don’t whack a dead horse
6.Turn broken stuff off
@chbatey
1 - Don’t take forever
• If at first you don’t succeed, don’t take forever to tell
someone
• Timeout and fail fast
@chbatey
Which timeouts?
• Socket connection timeout
• Socket read timeout
@chbatey
Your service hung for 30 seconds :(
Customer
You :(
@chbatey
Which timeouts?
• Socket connection timeout
• Socket read timeout
• Resource acquisition
@chbatey
Your service hung for 10 minutes :(
@chbatey
Let’s think about this
@chbatey
A little more detail
@chbatey
Adding a automated test
@chbatey
Adding a automated test
•Vagrant - launches + provisions localVMs
•Saboteur - uses tc, iptables to simulate network issues
•Wiremock - used to mock HTTP dependencies
•Cucumber - acceptance tests
@chbatey
I can write an automated test for that?
Wiremock:
•User Service
•Device Service
•Pin Service
S
a
b
o
t
e
u
r
Vagrant + Virtual box VM
Movie
Service
Acceptance
prime to drop traffic
reset
@chbatey
Implementing reliable timeouts
@chbatey
Implementing reliable timeouts
• Protect the container thread!
• Homemade:Worker Queue + Thread pool (executor)
@chbatey
Implementing reliable timeouts
• Protect the container thread!
• Homemade:Worker Queue + Thread pool (executor)
• Hystrix
• Spring cloud Netflix
@chbatey
A simple Spring RestController
@RestController

public class Resource {



private static final Logger LOGGER = LoggerFactory.getLogger(Resource.class);



@Autowired

private ScaryDependency scaryDependency;



@RequestMapping("/scary")

public String callTheScaryDependency() {

LOGGER.info("Resource later: I wonder which thread I am on!");

return scaryDependency.getScaryString();

}

}
@chbatey
Scary dependency
@Component

public class ScaryDependency {



private static final Logger LOGGER = LoggerFactory.getLogger(ScaryDependency.class);



public String getScaryString() {

LOGGER.info("Scary Dependency: I wonder which thread I am on! Tomcats?”);

if (System.currentTimeMillis() % 2 == 0) {

return "Scary String";

} else {
Thread.sleep(5000)

return “Slow Scary String";

}

}

}
@chbatey
All on the tomcat thread
13:47:20.200 [http-8080-exec-1] INFO info.batey.examples.Resource -
Resource later: I wonder which thread I am on!
13:47:20.200 [http-8080-exec-1] INFO info.batey.examples.ScaryDependency
- Scary Dependency: I wonder which thread I am on! Tomcats?
@chbatey
Scary dependency
@Component

public class ScaryDependency {



private static final Logger LOGGER = LoggerFactory.getLogger(ScaryDependency.class);



@HystrixCommand()

public String getScaryString() {

LOGGER.info("Scary Dependency: I wonder which thread I am on! Tomcats?”);

if (System.currentTimeMillis() % 2 == 0) {

return "Scary String";

} else {
Thread.sleep(5000)

return “Slow Scary String";

}

}

}
@chbatey
What an annotation can do...
13:51:21.513 [http-8080-exec-1] INFO info.batey.examples.Resource - Resource
later: I wonder which thread I am on!
13:51:21.614 [hystrix-ScaryDependency-1] INFO info.batey.examples.ScaryDependency
- Scary Dependency: I wonder which thread I am on! Tomcats? :P
@chbatey
Async libraries are your friend
• DataStax Java Driver
- Guava ListenableFuture
@chbatey
Timeouts take home
• You can’t use network level timeouts for SLAs
• Test your SLAs - if someone says you can’t, hit them with a
stick
• Scary things happen without network issues
@chbatey
Fault tolerance
1.Don’t take forever - Timeouts
2.Don’t try if you can’t succeed
3.Fail gracefully
4.Know if it’s your fault
5.Don’t whack a dead horse
6.Turn broken stuff off
@chbatey
2 - Don’t try if you can’t succeed
@chbatey
Complexity
“When an application grows
in complexity it will
eventually start sending
emails”
@chbatey
Complexity
“When an application grows
in complexity it will
eventually start using
queues and thread pools”
@chbatey
Don’t try if you can’t succeed
@chbatey
Don’t try if you can’t succeed
• Executor Unbounded queues :(
- newFixedThreadPool
- newSingleThreadExecutor
- newThreadCachedThreadPool
• Bound your queues and threads
• Fail quickly when the queue / maxPoolSize is met
• Know your drivers
@chbatey
This is a functional requirement
• Set the timeout very high
• Use Wiremock to add a large delay to the requests
@chbatey
This is a functional requirement
• Set the timeout very high
• Use Wiremock to add a large delay to the requests
• Set queue size and thread pool size to 1
• Send in 2 requests to use the thread and fill the queue
• What happens on the 3rd request?
@chbatey
Fault tolerance
1.Don’t take forever - Timeouts
2.Don’t try if you can’t succeed
3.Fail gracefully
4.Know if it’s your fault
5.Don’t whack a dead horse
6.Turn broken stuff off
@chbatey
3 - Fail gracefully
@chbatey
Expect rubbish
• Expect invalid HTTP
• Expect malformed response bodies
• Expect connection failures
• Expect huge / tiny responses
@chbatey
Testing with Wiremock
stubFor(get(urlEqualTo("/dependencyPath"))

.willReturn(aResponse()

.withFault(Fault.MALFORMED_RESPONSE_CHUNK)));

{

"request": {

"method": "GET",

"url": "/fault"

},

"response": {

"fault": "RANDOM_DATA_THEN_CLOSE"

}

{

"request": {

"method": "GET",

"url": "/fault"

},

"response": {

"fault": "EMPTY_RESPONSE"

}

}
@chbatey
Stubbed Cassandra
@chbatey
Fault tolerance
1.Don’t take forever - Timeouts
2.Don’t try if you can’t succeed
3.Fail gracefully
4.Know if it’s your fault
5.Don’t whack a dead horse
6.Turn broken stuff off
@chbatey
4 - Know if it’s your fault
@chbatey
Record stuff
• Metrics:
- Timings
- Errors
- Concurrent incoming requests
- Thread pool statistics
- Connection pool statistics
• Logging: Boundary logging, ElasticSearch / Logstash
• Request identifiers
@chbatey
Zipkin from Twitter
@chbatey
Graphite + Codahale
@chbatey
Response times
@chbatey
Separate resource pools
• Don’t flood your dependencies
• Be able to answer the questions:
- How many connections will you make to
dependency X?
- Are you getting close to your max
connections?
@chbatey
So easy with Dropwizard + Hystrix
metrics:

reporters:

- type: graphite

host: 192.168.10.120

port: 2003

prefix: shiny_app
metrics:

reporters:

- type: graphite

host: 192.168.10.120

port: 2003

prefix: shiny_app
@Override

public void initialize(Bootstrap<AppConfig> appConfigBootstrap) {

HystrixCodaHaleMetricsPublisher metricsPublisher = 

new HystrixCodaHaleMetricsPublisher(appConfigBootstrap.getMetricRegistry());

HystrixPlugins.getInstance().registerMetricsPublisher(metricsPublisher);

}
@chbatey
Fault tolerance
1.Don’t take forever - Timeouts
2.Don’t try if you can’t succeed
3.Fail gracefully
4.Know if it’s your fault
5.Don’t whack a dead horse
6.Turn broken stuff off
@chbatey
5 - Don’t whack a dead horse
Movie Player
User
Service
Device
Service
Play Movie
Pin
Service
@chbatey
What to do…
• Yes this will happen…
• Mandatory dependency - fail *really* fast
• Throttling
• Fallbacks
@chbatey
Circuit breaker pattern
@chbatey
Implementation with Hystrix


@Path("integrate")

public class IntegrationResource {



private static final Logger LOGGER = LoggerFactory.getLogger(IntegrationResource.class);



@GET

@Timed

public String integrate() {

LOGGER.info("integrate");

String user = new UserServiceDependency(userService).execute();

String device = new DeviceServiceDependency(deviceService).execute();

Boolean pinCheck = new PinCheckDependency(pinService).execute();

return String.format("[User info: %s] n[Device info: %s] n[Pin check: %s] n", user, device,
pinCheck);

}



}
@chbatey
Implementation with Hystrix


public class PinCheckDependency extends HystrixCommand<Boolean> {



private HttpClient httpClient;



public PinCheckDependency(HttpClient httpClient) {

super(HystrixCommandGroupKey.Factory.asKey("PinCheckService"));

this.httpClient = httpClient;

}



@Override

protected Boolean run() throws Exception {

HttpGet pinCheck = new HttpGet("http://localhost:9090/pincheck");

HttpResponse pinCheckResponse = httpClient.execute(pinCheck);

int statusCode = pinCheckResponse.getStatusLine().getStatusCode();

if (statusCode != 200) {

throw new RuntimeException("Oh dear no pin check, status code " + statusCode);

}

String pinCheckInfo = EntityUtils.toString(pinCheckResponse.getEntity());

return Boolean.valueOf(pinCheckInfo);

}



}

@chbatey
Implementation with Hystrix


public class PinCheckDependency extends HystrixCommand<Boolean> {



private HttpClient httpClient;



public PinCheckDependency(HttpClient httpClient) {

super(HystrixCommandGroupKey.Factory.asKey("PinCheckService"));

this.httpClient = httpClient;

}



@Override

protected Boolean run() throws Exception {

HttpGet pinCheck = new HttpGet("http://localhost:9090/pincheck");

HttpResponse pinCheckResponse = httpClient.execute(pinCheck);

int statusCode = pinCheckResponse.getStatusLine().getStatusCode();

if (statusCode != 200) {

throw new RuntimeException("Oh dear no pin check, status code " + statusCode);

}

String pinCheckInfo = EntityUtils.toString(pinCheckResponse.getEntity());

return Boolean.valueOf(pinCheckInfo);

}



@Override

public Boolean getFallback() {

return true;

}

}

@chbatey
Triggering the fallback
• Error threshold percentage
• Bucket of time for the percentage
• Minimum number of requests to trigger
• Time before trying a request again
• Disable
• Per instance statistics
@chbatey
Fault tolerance
1.Don’t take forever - Timeouts
2.Don’t try if you can’t succeed
3.Fail gracefully
4.Know if it’s your fault
5.Don’t whack a dead horse
6.Turn broken stuff off
@chbatey
6 - Turn off broken stuff
• The kill switch
@chbatey
To recap
1.Don’t take forever - Timeouts
2.Don’t try if you can’t succeed
3.Fail gracefully
4.Know if it’s your fault
5.Don’t whack a dead horse
6.Turn broken stuff off
@chbatey
Links
• Examples:
- https://github.com/chbatey/spring-cloud-example
- https://github.com/chbatey/dropwizard-hystrix
- https://github.com/chbatey/vagrant-wiremock-saboteur
• Tech:
- https://github.com/Netflix/Hystrix
- https://www.vagrantup.com/
- http://wiremock.org/
- https://github.com/tomakehurst/saboteur
@chbatey
Questions?
Thanks for listening!
Questions: @chbatey
http://christopher-batey.blogspot.co.uk/
http://www.eventbrite.com/e/cassandra-day-paris-france-2015-june-16th-2015-tickets-15053035033?aff=meetup1
http://www.eventbrite.com/e/cassandra-day-london-2015-april-22nd-2015-tickets-15053026006?aff=meetup1

More Related Content

What's hot

Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applications
Konrad Malawski
 
The Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldThe Need for Async @ ScalaWorld
The Need for Async @ ScalaWorld
Konrad Malawski
 
Manchester Hadoop Meetup: Cassandra Spark internals
Manchester Hadoop Meetup: Cassandra Spark internalsManchester Hadoop Meetup: Cassandra Spark internals
Manchester Hadoop Meetup: Cassandra Spark internals
Christopher Batey
 
Reactive Programming with Rx
 Reactive Programming with Rx Reactive Programming with Rx
Reactive Programming with Rx
C4Media
 
DataStax: Making Cassandra Fail (for effective testing)
DataStax: Making Cassandra Fail (for effective testing)DataStax: Making Cassandra Fail (for effective testing)
DataStax: Making Cassandra Fail (for effective testing)
DataStax Academy
 
Real World Mocking In Swift
Real World Mocking In SwiftReal World Mocking In Swift
Real World Mocking In Swift
Veronica Lillie
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tour
cacois
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabs
Konrad Malawski
 
How to debug slow lambda response times
How to debug slow lambda response timesHow to debug slow lambda response times
How to debug slow lambda response times
Yan Cui
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and Akka
Konrad Malawski
 
Altitude SF 2017: Debugging Fastly VCL 101
Altitude SF 2017: Debugging Fastly VCL 101Altitude SF 2017: Debugging Fastly VCL 101
Altitude SF 2017: Debugging Fastly VCL 101
Fastly
 
State of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeState of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to come
Konrad Malawski
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
Konrad Malawski
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Fastly
 
Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015
Fastly
 
Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"
Konrad Malawski
 
We Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentWe Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End Development
All Things Open
 
Prometheus: From technical metrics to business observability
Prometheus: From technical metrics to business observabilityPrometheus: From technical metrics to business observability
Prometheus: From technical metrics to business observability
Julien Pivotto
 
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic ContentCaching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Fastly
 
Async - react, don't wait - PingConf
Async - react, don't wait - PingConfAsync - react, don't wait - PingConf
Async - react, don't wait - PingConf
Johan Andrén
 

What's hot (20)

Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applications
 
The Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldThe Need for Async @ ScalaWorld
The Need for Async @ ScalaWorld
 
Manchester Hadoop Meetup: Cassandra Spark internals
Manchester Hadoop Meetup: Cassandra Spark internalsManchester Hadoop Meetup: Cassandra Spark internals
Manchester Hadoop Meetup: Cassandra Spark internals
 
Reactive Programming with Rx
 Reactive Programming with Rx Reactive Programming with Rx
Reactive Programming with Rx
 
DataStax: Making Cassandra Fail (for effective testing)
DataStax: Making Cassandra Fail (for effective testing)DataStax: Making Cassandra Fail (for effective testing)
DataStax: Making Cassandra Fail (for effective testing)
 
Real World Mocking In Swift
Real World Mocking In SwiftReal World Mocking In Swift
Real World Mocking In Swift
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tour
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabs
 
How to debug slow lambda response times
How to debug slow lambda response timesHow to debug slow lambda response times
How to debug slow lambda response times
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and Akka
 
Altitude SF 2017: Debugging Fastly VCL 101
Altitude SF 2017: Debugging Fastly VCL 101Altitude SF 2017: Debugging Fastly VCL 101
Altitude SF 2017: Debugging Fastly VCL 101
 
State of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeState of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to come
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
 
Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015
 
Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"
 
We Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentWe Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End Development
 
Prometheus: From technical metrics to business observability
Prometheus: From technical metrics to business observabilityPrometheus: From technical metrics to business observability
Prometheus: From technical metrics to business observability
 
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic ContentCaching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
 
Async - react, don't wait - PingConf
Async - react, don't wait - PingConfAsync - react, don't wait - PingConf
Async - react, don't wait - PingConf
 

Viewers also liked

Cassandra Day London: Building Java Applications
Cassandra Day London: Building Java ApplicationsCassandra Day London: Building Java Applications
Cassandra Day London: Building Java Applications
Christopher Batey
 
Think your software is fault-tolerant? Prove it!
Think your software is fault-tolerant? Prove it!Think your software is fault-tolerant? Prove it!
Think your software is fault-tolerant? Prove it!
Christopher Batey
 
Cassandra summit LWTs
Cassandra summit  LWTsCassandra summit  LWTs
Cassandra summit LWTs
Christopher Batey
 
IoT London July 2015
IoT London July 2015IoT London July 2015
IoT London July 2015
Christopher Batey
 
1 Dundee - Cassandra 101
1 Dundee - Cassandra 1011 Dundee - Cassandra 101
1 Dundee - Cassandra 101
Christopher Batey
 
Dublin Meetup: Cassandra anti patterns
Dublin Meetup: Cassandra anti patternsDublin Meetup: Cassandra anti patterns
Dublin Meetup: Cassandra anti patterns
Christopher Batey
 
3 Dundee-Spark Overview for C* developers
3 Dundee-Spark Overview for C* developers3 Dundee-Spark Overview for C* developers
3 Dundee-Spark Overview for C* developers
Christopher Batey
 
Cassandra London - C* Spark Connector
Cassandra London - C* Spark ConnectorCassandra London - C* Spark Connector
Cassandra London - C* Spark Connector
Christopher Batey
 
Cassandra Day NYC - Cassandra anti patterns
Cassandra Day NYC - Cassandra anti patternsCassandra Day NYC - Cassandra anti patterns
Cassandra Day NYC - Cassandra anti patterns
Christopher Batey
 
Cassandra London - 2.2 and 3.0
Cassandra London - 2.2 and 3.0Cassandra London - 2.2 and 3.0
Cassandra London - 2.2 and 3.0
Christopher Batey
 
Counters At Scale - A Cautionary Tale
Counters At Scale - A Cautionary TaleCounters At Scale - A Cautionary Tale
Counters At Scale - A Cautionary Tale
Eric Lubow
 
Manage your compactions before they manage you!
Manage your compactions before they manage you!Manage your compactions before they manage you!
Manage your compactions before they manage you!
Carlos Juzarte Rolo
 
2 Dundee - Cassandra-3
2 Dundee - Cassandra-32 Dundee - Cassandra-3
2 Dundee - Cassandra-3
Christopher Batey
 
Manchester Hadoop User Group: Cassandra Intro
Manchester Hadoop User Group: Cassandra IntroManchester Hadoop User Group: Cassandra Intro
Manchester Hadoop User Group: Cassandra Intro
Christopher Batey
 
Manchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra IntegrationManchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra Integration
Christopher Batey
 
Cassandra from tarball to production
Cassandra   from tarball to productionCassandra   from tarball to production
Cassandra from tarball to production
Ron Kuris
 
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable CassandraCassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
aaronmorton
 
Docker and jvm. A good idea?
Docker and jvm. A good idea?Docker and jvm. A good idea?
Docker and jvm. A good idea?
Christopher Batey
 
A deep look at the cql where clause
A deep look at the cql where clauseA deep look at the cql where clause
A deep look at the cql where clause
Benjamin Lerer
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
zznate
 

Viewers also liked (20)

Cassandra Day London: Building Java Applications
Cassandra Day London: Building Java ApplicationsCassandra Day London: Building Java Applications
Cassandra Day London: Building Java Applications
 
Think your software is fault-tolerant? Prove it!
Think your software is fault-tolerant? Prove it!Think your software is fault-tolerant? Prove it!
Think your software is fault-tolerant? Prove it!
 
Cassandra summit LWTs
Cassandra summit  LWTsCassandra summit  LWTs
Cassandra summit LWTs
 
IoT London July 2015
IoT London July 2015IoT London July 2015
IoT London July 2015
 
1 Dundee - Cassandra 101
1 Dundee - Cassandra 1011 Dundee - Cassandra 101
1 Dundee - Cassandra 101
 
Dublin Meetup: Cassandra anti patterns
Dublin Meetup: Cassandra anti patternsDublin Meetup: Cassandra anti patterns
Dublin Meetup: Cassandra anti patterns
 
3 Dundee-Spark Overview for C* developers
3 Dundee-Spark Overview for C* developers3 Dundee-Spark Overview for C* developers
3 Dundee-Spark Overview for C* developers
 
Cassandra London - C* Spark Connector
Cassandra London - C* Spark ConnectorCassandra London - C* Spark Connector
Cassandra London - C* Spark Connector
 
Cassandra Day NYC - Cassandra anti patterns
Cassandra Day NYC - Cassandra anti patternsCassandra Day NYC - Cassandra anti patterns
Cassandra Day NYC - Cassandra anti patterns
 
Cassandra London - 2.2 and 3.0
Cassandra London - 2.2 and 3.0Cassandra London - 2.2 and 3.0
Cassandra London - 2.2 and 3.0
 
Counters At Scale - A Cautionary Tale
Counters At Scale - A Cautionary TaleCounters At Scale - A Cautionary Tale
Counters At Scale - A Cautionary Tale
 
Manage your compactions before they manage you!
Manage your compactions before they manage you!Manage your compactions before they manage you!
Manage your compactions before they manage you!
 
2 Dundee - Cassandra-3
2 Dundee - Cassandra-32 Dundee - Cassandra-3
2 Dundee - Cassandra-3
 
Manchester Hadoop User Group: Cassandra Intro
Manchester Hadoop User Group: Cassandra IntroManchester Hadoop User Group: Cassandra Intro
Manchester Hadoop User Group: Cassandra Intro
 
Manchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra IntegrationManchester Hadoop Meetup: Spark Cassandra Integration
Manchester Hadoop Meetup: Spark Cassandra Integration
 
Cassandra from tarball to production
Cassandra   from tarball to productionCassandra   from tarball to production
Cassandra from tarball to production
 
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable CassandraCassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
 
Docker and jvm. A good idea?
Docker and jvm. A good idea?Docker and jvm. A good idea?
Docker and jvm. A good idea?
 
A deep look at the cql where clause
A deep look at the cql where clauseA deep look at the cql where clause
A deep look at the cql where clause
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
 

Similar to Devoxx France: Fault tolerant microservices on the JVM with Cassandra

LJC: Fault tolerance with Apache Cassandra
LJC: Fault tolerance with Apache CassandraLJC: Fault tolerance with Apache Cassandra
LJC: Fault tolerance with Apache Cassandra
Christopher Batey
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
John Adams
 
Release the Monkeys ! Testing in the Wild at Netflix
Release the Monkeys !  Testing in the Wild at NetflixRelease the Monkeys !  Testing in the Wild at Netflix
Release the Monkeys ! Testing in the Wild at Netflix
Gareth Bowles
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
Fabio Tiriticco
 
Paris Day Cassandra: Use case
Paris Day Cassandra: Use caseParis Day Cassandra: Use case
Paris Day Cassandra: Use case
Christopher Batey
 
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Flink Forward
 
Cloud patterns forwardjs April Ottawa 2019
Cloud patterns forwardjs April Ottawa 2019Cloud patterns forwardjs April Ottawa 2019
Cloud patterns forwardjs April Ottawa 2019
Taswar Bhatti
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
I Don't Test Often ...
I Don't Test Often ...I Don't Test Often ...
I Don't Test Often ...
Gareth Bowles
 
I don't always test...but when I do I test in production - Gareth Bowles
I don't always test...but when I do I test in production - Gareth BowlesI don't always test...but when I do I test in production - Gareth Bowles
I don't always test...but when I do I test in production - Gareth Bowles
QA or the Highway
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
Eugene Lazutkin
 
Monitoring your Python with Prometheus (Python Ireland April 2015)
Monitoring your Python with Prometheus (Python Ireland April 2015)Monitoring your Python with Prometheus (Python Ireland April 2015)
Monitoring your Python with Prometheus (Python Ireland April 2015)
Brian Brazil
 
Dmk blackops2006 ccc
Dmk blackops2006 cccDmk blackops2006 ccc
Dmk blackops2006 cccDan Kaminsky
 
Interactions complicate debugging
Interactions complicate debuggingInteractions complicate debugging
Interactions complicate debugging
Syed Zaid Irshad
 
Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)
Igalia
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pieTomas Doran
 
LASCON 2016 - It's 10PM Do You Know Where Your Access Keys Are?
LASCON 2016 - It's 10PM Do You Know Where Your Access Keys Are?LASCON 2016 - It's 10PM Do You Know Where Your Access Keys Are?
LASCON 2016 - It's 10PM Do You Know Where Your Access Keys Are?
Ken Johnson
 
Rust meetup delhi nov 18
Rust meetup delhi nov 18Rust meetup delhi nov 18
Rust meetup delhi nov 18
Abhiram Ravikumar
 
MassTLC Cloud Summit Keynote
MassTLC Cloud Summit KeynoteMassTLC Cloud Summit Keynote
MassTLC Cloud Summit Keynote
Ariel Tseitlin
 
Resiliency through Failure @ OSCON 2013
Resiliency through Failure @ OSCON 2013Resiliency through Failure @ OSCON 2013
Resiliency through Failure @ OSCON 2013
Ariel Tseitlin
 

Similar to Devoxx France: Fault tolerant microservices on the JVM with Cassandra (20)

LJC: Fault tolerance with Apache Cassandra
LJC: Fault tolerance with Apache CassandraLJC: Fault tolerance with Apache Cassandra
LJC: Fault tolerance with Apache Cassandra
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
 
Release the Monkeys ! Testing in the Wild at Netflix
Release the Monkeys !  Testing in the Wild at NetflixRelease the Monkeys !  Testing in the Wild at Netflix
Release the Monkeys ! Testing in the Wild at Netflix
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
Paris Day Cassandra: Use case
Paris Day Cassandra: Use caseParis Day Cassandra: Use case
Paris Day Cassandra: Use case
 
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
 
Cloud patterns forwardjs April Ottawa 2019
Cloud patterns forwardjs April Ottawa 2019Cloud patterns forwardjs April Ottawa 2019
Cloud patterns forwardjs April Ottawa 2019
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
I Don't Test Often ...
I Don't Test Often ...I Don't Test Often ...
I Don't Test Often ...
 
I don't always test...but when I do I test in production - Gareth Bowles
I don't always test...but when I do I test in production - Gareth BowlesI don't always test...but when I do I test in production - Gareth Bowles
I don't always test...but when I do I test in production - Gareth Bowles
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
Monitoring your Python with Prometheus (Python Ireland April 2015)
Monitoring your Python with Prometheus (Python Ireland April 2015)Monitoring your Python with Prometheus (Python Ireland April 2015)
Monitoring your Python with Prometheus (Python Ireland April 2015)
 
Dmk blackops2006 ccc
Dmk blackops2006 cccDmk blackops2006 ccc
Dmk blackops2006 ccc
 
Interactions complicate debugging
Interactions complicate debuggingInteractions complicate debugging
Interactions complicate debugging
 
Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pie
 
LASCON 2016 - It's 10PM Do You Know Where Your Access Keys Are?
LASCON 2016 - It's 10PM Do You Know Where Your Access Keys Are?LASCON 2016 - It's 10PM Do You Know Where Your Access Keys Are?
LASCON 2016 - It's 10PM Do You Know Where Your Access Keys Are?
 
Rust meetup delhi nov 18
Rust meetup delhi nov 18Rust meetup delhi nov 18
Rust meetup delhi nov 18
 
MassTLC Cloud Summit Keynote
MassTLC Cloud Summit KeynoteMassTLC Cloud Summit Keynote
MassTLC Cloud Summit Keynote
 
Resiliency through Failure @ OSCON 2013
Resiliency through Failure @ OSCON 2013Resiliency through Failure @ OSCON 2013
Resiliency through Failure @ OSCON 2013
 

More from Christopher Batey

Data Science Lab Meetup: Cassandra and Spark
Data Science Lab Meetup: Cassandra and SparkData Science Lab Meetup: Cassandra and Spark
Data Science Lab Meetup: Cassandra and Spark
Christopher Batey
 
Webinar Cassandra Anti-Patterns
Webinar Cassandra Anti-PatternsWebinar Cassandra Anti-Patterns
Webinar Cassandra Anti-Patterns
Christopher Batey
 
Munich March 2015 - Cassandra + Spark Overview
Munich March 2015 -  Cassandra + Spark OverviewMunich March 2015 -  Cassandra + Spark Overview
Munich March 2015 - Cassandra + Spark Overview
Christopher Batey
 
Reading Cassandra Meetup Feb 2015: Apache Spark
Reading Cassandra Meetup Feb 2015: Apache SparkReading Cassandra Meetup Feb 2015: Apache Spark
Reading Cassandra Meetup Feb 2015: Apache Spark
Christopher Batey
 
LA Cassandra Day 2015 - Testing Cassandra
LA Cassandra Day 2015  - Testing CassandraLA Cassandra Day 2015  - Testing Cassandra
LA Cassandra Day 2015 - Testing Cassandra
Christopher Batey
 
LA Cassandra Day 2015 - Cassandra for developers
LA Cassandra Day 2015  - Cassandra for developersLA Cassandra Day 2015  - Cassandra for developers
LA Cassandra Day 2015 - Cassandra for developers
Christopher Batey
 
Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!
Christopher Batey
 
Jan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester MeetupJan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester Meetup
Christopher Batey
 

More from Christopher Batey (8)

Data Science Lab Meetup: Cassandra and Spark
Data Science Lab Meetup: Cassandra and SparkData Science Lab Meetup: Cassandra and Spark
Data Science Lab Meetup: Cassandra and Spark
 
Webinar Cassandra Anti-Patterns
Webinar Cassandra Anti-PatternsWebinar Cassandra Anti-Patterns
Webinar Cassandra Anti-Patterns
 
Munich March 2015 - Cassandra + Spark Overview
Munich March 2015 -  Cassandra + Spark OverviewMunich March 2015 -  Cassandra + Spark Overview
Munich March 2015 - Cassandra + Spark Overview
 
Reading Cassandra Meetup Feb 2015: Apache Spark
Reading Cassandra Meetup Feb 2015: Apache SparkReading Cassandra Meetup Feb 2015: Apache Spark
Reading Cassandra Meetup Feb 2015: Apache Spark
 
LA Cassandra Day 2015 - Testing Cassandra
LA Cassandra Day 2015  - Testing CassandraLA Cassandra Day 2015  - Testing Cassandra
LA Cassandra Day 2015 - Testing Cassandra
 
LA Cassandra Day 2015 - Cassandra for developers
LA Cassandra Day 2015  - Cassandra for developersLA Cassandra Day 2015  - Cassandra for developers
LA Cassandra Day 2015 - Cassandra for developers
 
Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!Vienna Feb 2015: Cassandra: How it works and what it's good for!
Vienna Feb 2015: Cassandra: How it works and what it's good for!
 
Jan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester MeetupJan 2015 - Cassandra101 Manchester Meetup
Jan 2015 - Cassandra101 Manchester Meetup
 

Recently uploaded

A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 

Recently uploaded (20)

A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 

Devoxx France: Fault tolerant microservices on the JVM with Cassandra

  • 1. @chbatey Fault tolerant microservices on the JVM Christopher Batey DataStax @chbatey
  • 2. @chbatey Who am I? • DataStax - Technical Evangelist / Software Engineer - Builds enterprise ready version of Apache Cassandra • Sky: Building next generation Internet TV platform • Lots of time working on a test double for Apache Cassandra
  • 3. @chbatey Agenda •Setting the scene -What do we mean by a fault? -What is a micro(ish)service? -Monolith application vs the micro(ish)service •A worked example -Identify an issue -Reproduce/test it -Show how to deal with the issue
  • 4. @chbatey So… what do applications look like?
  • 5. @chbatey So… what do applications look like?
  • 6. @chbatey So… what do applications look like?
  • 7. @chbatey So… what do applications look like?
  • 8. @chbatey So… what do applications look like?
  • 9. @chbatey Small horizontal scalable services • Move to small services independently deployed - Login service - Device service - etc • Move to a horizontally scalable Database that can run active active in multiple data centres
  • 10. @chbatey So… what do applications look like?
  • 11. @chbatey So... what do systems look like now?
  • 13. @chbatey Time for an example... •All examples are on github •Technologies used: -Dropwizard -Spring Boot -Wiremock -Hystrix -Graphite -Saboteur
  • 14. @chbatey Testing microservices • You don’t know a service is fault tolerant if you don’t test faults
  • 15. @chbatey The test double Wiremock for HTTP integration Stubbed Cassandra for Database Kafka Unit
  • 16. @chbatey Isolated service tests Movie service Mocks User Device Pin service Play Movie Acceptan ce Test Prime Real HTTP/TCP
  • 17. @chbatey Fault tolerance 1.Don’t take forever - Timeouts 2.Don’t try if you can’t succeed 3.Fail gracefully 4.Know if it’s your fault 5.Don’t whack a dead horse 6.Turn broken stuff off
  • 18. @chbatey 1 - Don’t take forever • If at first you don’t succeed, don’t take forever to tell someone • Timeout and fail fast
  • 19. @chbatey Which timeouts? • Socket connection timeout • Socket read timeout
  • 20. @chbatey Your service hung for 30 seconds :( Customer You :(
  • 21. @chbatey Which timeouts? • Socket connection timeout • Socket read timeout • Resource acquisition
  • 22. @chbatey Your service hung for 10 minutes :(
  • 26. @chbatey Adding a automated test •Vagrant - launches + provisions localVMs •Saboteur - uses tc, iptables to simulate network issues •Wiremock - used to mock HTTP dependencies •Cucumber - acceptance tests
  • 27. @chbatey I can write an automated test for that? Wiremock: •User Service •Device Service •Pin Service S a b o t e u r Vagrant + Virtual box VM Movie Service Acceptance prime to drop traffic reset
  • 29. @chbatey Implementing reliable timeouts • Protect the container thread! • Homemade:Worker Queue + Thread pool (executor)
  • 30. @chbatey Implementing reliable timeouts • Protect the container thread! • Homemade:Worker Queue + Thread pool (executor) • Hystrix • Spring cloud Netflix
  • 31. @chbatey A simple Spring RestController @RestController
 public class Resource {
 
 private static final Logger LOGGER = LoggerFactory.getLogger(Resource.class);
 
 @Autowired
 private ScaryDependency scaryDependency;
 
 @RequestMapping("/scary")
 public String callTheScaryDependency() {
 LOGGER.info("Resource later: I wonder which thread I am on!");
 return scaryDependency.getScaryString();
 }
 }
  • 32. @chbatey Scary dependency @Component
 public class ScaryDependency {
 
 private static final Logger LOGGER = LoggerFactory.getLogger(ScaryDependency.class);
 
 public String getScaryString() {
 LOGGER.info("Scary Dependency: I wonder which thread I am on! Tomcats?”);
 if (System.currentTimeMillis() % 2 == 0) {
 return "Scary String";
 } else { Thread.sleep(5000)
 return “Slow Scary String";
 }
 }
 }
  • 33. @chbatey All on the tomcat thread 13:47:20.200 [http-8080-exec-1] INFO info.batey.examples.Resource - Resource later: I wonder which thread I am on! 13:47:20.200 [http-8080-exec-1] INFO info.batey.examples.ScaryDependency - Scary Dependency: I wonder which thread I am on! Tomcats?
  • 34. @chbatey Scary dependency @Component
 public class ScaryDependency {
 
 private static final Logger LOGGER = LoggerFactory.getLogger(ScaryDependency.class);
 
 @HystrixCommand()
 public String getScaryString() {
 LOGGER.info("Scary Dependency: I wonder which thread I am on! Tomcats?”);
 if (System.currentTimeMillis() % 2 == 0) {
 return "Scary String";
 } else { Thread.sleep(5000)
 return “Slow Scary String";
 }
 }
 }
  • 35. @chbatey What an annotation can do... 13:51:21.513 [http-8080-exec-1] INFO info.batey.examples.Resource - Resource later: I wonder which thread I am on! 13:51:21.614 [hystrix-ScaryDependency-1] INFO info.batey.examples.ScaryDependency - Scary Dependency: I wonder which thread I am on! Tomcats? :P
  • 36. @chbatey Async libraries are your friend • DataStax Java Driver - Guava ListenableFuture
  • 37. @chbatey Timeouts take home • You can’t use network level timeouts for SLAs • Test your SLAs - if someone says you can’t, hit them with a stick • Scary things happen without network issues
  • 38. @chbatey Fault tolerance 1.Don’t take forever - Timeouts 2.Don’t try if you can’t succeed 3.Fail gracefully 4.Know if it’s your fault 5.Don’t whack a dead horse 6.Turn broken stuff off
  • 39. @chbatey 2 - Don’t try if you can’t succeed
  • 40. @chbatey Complexity “When an application grows in complexity it will eventually start sending emails”
  • 41. @chbatey Complexity “When an application grows in complexity it will eventually start using queues and thread pools”
  • 42. @chbatey Don’t try if you can’t succeed
  • 43. @chbatey Don’t try if you can’t succeed • Executor Unbounded queues :( - newFixedThreadPool - newSingleThreadExecutor - newThreadCachedThreadPool • Bound your queues and threads • Fail quickly when the queue / maxPoolSize is met • Know your drivers
  • 44. @chbatey This is a functional requirement • Set the timeout very high • Use Wiremock to add a large delay to the requests
  • 45. @chbatey This is a functional requirement • Set the timeout very high • Use Wiremock to add a large delay to the requests • Set queue size and thread pool size to 1 • Send in 2 requests to use the thread and fill the queue • What happens on the 3rd request?
  • 46. @chbatey Fault tolerance 1.Don’t take forever - Timeouts 2.Don’t try if you can’t succeed 3.Fail gracefully 4.Know if it’s your fault 5.Don’t whack a dead horse 6.Turn broken stuff off
  • 47. @chbatey 3 - Fail gracefully
  • 48. @chbatey Expect rubbish • Expect invalid HTTP • Expect malformed response bodies • Expect connection failures • Expect huge / tiny responses
  • 49. @chbatey Testing with Wiremock stubFor(get(urlEqualTo("/dependencyPath"))
 .willReturn(aResponse()
 .withFault(Fault.MALFORMED_RESPONSE_CHUNK)));
 {
 "request": {
 "method": "GET",
 "url": "/fault"
 },
 "response": {
 "fault": "RANDOM_DATA_THEN_CLOSE"
 }
 {
 "request": {
 "method": "GET",
 "url": "/fault"
 },
 "response": {
 "fault": "EMPTY_RESPONSE"
 }
 }
  • 51. @chbatey Fault tolerance 1.Don’t take forever - Timeouts 2.Don’t try if you can’t succeed 3.Fail gracefully 4.Know if it’s your fault 5.Don’t whack a dead horse 6.Turn broken stuff off
  • 52. @chbatey 4 - Know if it’s your fault
  • 53. @chbatey Record stuff • Metrics: - Timings - Errors - Concurrent incoming requests - Thread pool statistics - Connection pool statistics • Logging: Boundary logging, ElasticSearch / Logstash • Request identifiers
  • 57. @chbatey Separate resource pools • Don’t flood your dependencies • Be able to answer the questions: - How many connections will you make to dependency X? - Are you getting close to your max connections?
  • 58. @chbatey So easy with Dropwizard + Hystrix metrics:
 reporters:
 - type: graphite
 host: 192.168.10.120
 port: 2003
 prefix: shiny_app metrics:
 reporters:
 - type: graphite
 host: 192.168.10.120
 port: 2003
 prefix: shiny_app @Override
 public void initialize(Bootstrap<AppConfig> appConfigBootstrap) {
 HystrixCodaHaleMetricsPublisher metricsPublisher = 
 new HystrixCodaHaleMetricsPublisher(appConfigBootstrap.getMetricRegistry());
 HystrixPlugins.getInstance().registerMetricsPublisher(metricsPublisher);
 }
  • 59. @chbatey Fault tolerance 1.Don’t take forever - Timeouts 2.Don’t try if you can’t succeed 3.Fail gracefully 4.Know if it’s your fault 5.Don’t whack a dead horse 6.Turn broken stuff off
  • 60. @chbatey 5 - Don’t whack a dead horse Movie Player User Service Device Service Play Movie Pin Service
  • 61. @chbatey What to do… • Yes this will happen… • Mandatory dependency - fail *really* fast • Throttling • Fallbacks
  • 63. @chbatey Implementation with Hystrix 
 @Path("integrate")
 public class IntegrationResource {
 
 private static final Logger LOGGER = LoggerFactory.getLogger(IntegrationResource.class);
 
 @GET
 @Timed
 public String integrate() {
 LOGGER.info("integrate");
 String user = new UserServiceDependency(userService).execute();
 String device = new DeviceServiceDependency(deviceService).execute();
 Boolean pinCheck = new PinCheckDependency(pinService).execute();
 return String.format("[User info: %s] n[Device info: %s] n[Pin check: %s] n", user, device, pinCheck);
 }
 
 }
  • 64. @chbatey Implementation with Hystrix 
 public class PinCheckDependency extends HystrixCommand<Boolean> {
 
 private HttpClient httpClient;
 
 public PinCheckDependency(HttpClient httpClient) {
 super(HystrixCommandGroupKey.Factory.asKey("PinCheckService"));
 this.httpClient = httpClient;
 }
 
 @Override
 protected Boolean run() throws Exception {
 HttpGet pinCheck = new HttpGet("http://localhost:9090/pincheck");
 HttpResponse pinCheckResponse = httpClient.execute(pinCheck);
 int statusCode = pinCheckResponse.getStatusLine().getStatusCode();
 if (statusCode != 200) {
 throw new RuntimeException("Oh dear no pin check, status code " + statusCode);
 }
 String pinCheckInfo = EntityUtils.toString(pinCheckResponse.getEntity());
 return Boolean.valueOf(pinCheckInfo);
 }
 
 }

  • 65. @chbatey Implementation with Hystrix 
 public class PinCheckDependency extends HystrixCommand<Boolean> {
 
 private HttpClient httpClient;
 
 public PinCheckDependency(HttpClient httpClient) {
 super(HystrixCommandGroupKey.Factory.asKey("PinCheckService"));
 this.httpClient = httpClient;
 }
 
 @Override
 protected Boolean run() throws Exception {
 HttpGet pinCheck = new HttpGet("http://localhost:9090/pincheck");
 HttpResponse pinCheckResponse = httpClient.execute(pinCheck);
 int statusCode = pinCheckResponse.getStatusLine().getStatusCode();
 if (statusCode != 200) {
 throw new RuntimeException("Oh dear no pin check, status code " + statusCode);
 }
 String pinCheckInfo = EntityUtils.toString(pinCheckResponse.getEntity());
 return Boolean.valueOf(pinCheckInfo);
 }
 
 @Override
 public Boolean getFallback() {
 return true;
 }
 }

  • 66. @chbatey Triggering the fallback • Error threshold percentage • Bucket of time for the percentage • Minimum number of requests to trigger • Time before trying a request again • Disable • Per instance statistics
  • 67. @chbatey Fault tolerance 1.Don’t take forever - Timeouts 2.Don’t try if you can’t succeed 3.Fail gracefully 4.Know if it’s your fault 5.Don’t whack a dead horse 6.Turn broken stuff off
  • 68. @chbatey 6 - Turn off broken stuff • The kill switch
  • 69. @chbatey To recap 1.Don’t take forever - Timeouts 2.Don’t try if you can’t succeed 3.Fail gracefully 4.Know if it’s your fault 5.Don’t whack a dead horse 6.Turn broken stuff off
  • 70. @chbatey Links • Examples: - https://github.com/chbatey/spring-cloud-example - https://github.com/chbatey/dropwizard-hystrix - https://github.com/chbatey/vagrant-wiremock-saboteur • Tech: - https://github.com/Netflix/Hystrix - https://www.vagrantup.com/ - http://wiremock.org/ - https://github.com/tomakehurst/saboteur
  • 71. @chbatey Questions? Thanks for listening! Questions: @chbatey http://christopher-batey.blogspot.co.uk/ http://www.eventbrite.com/e/cassandra-day-paris-france-2015-june-16th-2015-tickets-15053035033?aff=meetup1 http://www.eventbrite.com/e/cassandra-day-london-2015-april-22nd-2015-tickets-15053026006?aff=meetup1