SlideShare a Scribd company logo
Building Java applications for the Cloud: 
The DHARMA principles 
Daniel Bryant 
Principal Consultant, Open Credo 
daniel.bryant@opencredo.com 
@danielbryantuk 
@OpenCredo
What to expect 
• Problems when developing for the Cloud 
– “Lift and shift” 
– Smashing the monolith 
– Greenfield (“Cloud native”) 
• Some suggestions on where to focus efforts 
– Not specific platform/framework reviews 
• Tools and techniques 
• Lots of information… (slides will be available) 
15/10/2014 @danielbryantuk
Who Am I? 
• Principal Consultant at OpenCredo 
• LJC Associate 
 Agile transformations 
 DevOps 
 Microservices and Cloud 
• Adopt OpenJDK and JSR 
15/10/2014 @danielbryantuk
The Current Industry Wish List… 
• Service-Oriented Architecture 
• Cloud-based deployments 
• DevOps Culture 
15/10/2014 @danielbryantuk
The Current Industry Wish List… 
• Service-Oriented Architecture 
– Twitter’s Story (bit.ly/1j1WbmI) 
• Cloud-based deployments 
– Today! 
• DevOps Culture 
– Devoxx UK talk (bit.ly/1BylnZb) 
– Previous LJC Event (bit.ly/1elVPJz) 
15/10/2014 @danielbryantuk
Common Cloud Problems 
TL;DR… 
15/10/2014 @danielbryantuk
Not respecting the underlying environment 
15/10/2014 @danielbryantuk
Lack of application/platform monitoring… 
15/10/2014 @danielbryantuk
Bizarre failure modes… 
15/10/2014 @danielbryantuk
Difficulty in understanding 
the new architecture 
15/10/2014 @danielbryantuk
Confusion over environment provisioning and config 
15/10/2014 @danielbryantuk
Not testing in the Cloud… 
(hint: here be dragons!) 
15/10/2014 @danielbryantuk
We’ve created the “Cloud DHARMA Principles” 
to act as a checklist when building Cloud apps 
15/10/2014 @danielbryantuk
dharma 
/ˈdɑːmə,ˈdəːmə/ 
noun 
1. Signifies behaviors that are considered to be in 
accord with order that makes life and universe 
possible (Hinduism) 
2. "cosmic law and order”, but is also applied to 
the teachings of the Buddha (Buddhism) 
15/10/2014 @danielbryantuk
Documented (just enough) 
Highly cohesive/loosely coupled (all the way down) 
Automated from commit to Cloud 
Resource aware 
Monitored thoroughly 
Antifragile 
15/10/2014 @danielbryantuk
Documented (just enough) 
Highly cohesive/loosely coupled (all the way down) 
Automated from commit to Cloud 
Resource aware 
Monitored thoroughly 
Antifragile 
15/10/2014 @danielbryantuk
15/10/2014 @danielbryantuk
Documentation (just enough) 
• Provide a map for developers 
• Component purpose (and contract) 
• Initialisation instructions (mocks/stubs) 
• Highlights areas of operational risk 
15/10/2014 @danielbryantuk
Simon Brown’s C4 Model 
15/10/2014 @danielbryantuk 
www.codingthearchitecture.com
15/10/2014 @danielbryantuk
1155//1100//22010414 @@ddaanniieellbbrryyaanntutukk
API Docs with Swagger 
15/10/2014 @danielbryantuk 
helloreverb.com/developers/swagger
Create a PACT 
15/10/2014 @danielbryantuk 
github.com/DiUS/pact-jvm
Documented (just enough) 
Highly cohesive/loosely coupled (all the way down) 
Automated from commit to Cloud 
Resource aware 
Monitored thoroughly 
Antifragile 
15/10/2014 @danielbryantuk
High Cohesion / Loose Coupling 
(all the way down…) 
• Code 
• Architecture 
– Components 
– Services 
• Public API 
– PayPal (bit.ly/1hnZNly) 
15/10/2014 @danielbryantuk
Smashing the Monolith… 
• Business functionality -“Cart Service” 
• Technology chunk - “Email Service” 
• Vertical Slice 
– “Registration” (Groupon: vimeo.com/105880150) 
• Horizontal Slice 
– “User Repo” (Microservices: oreil.ly/1pp6qmx) 
15/10/2014 @danielbryantuk
Microservices 
• Probably won’t catch on… ;-) 
15/10/2014 @danielbryantuk
Twelve Factor Apps 
15/10/2014 @danielbryantuk 
http://12factor.net/
Documented (just enough) 
Highly cohesive/loosely coupled (all the way down) 
Automated from commit to Cloud 
Resource aware 
Monitored thoroughly 
Antifragile 
15/10/2014 @danielbryantuk
Automated from Commit to Cloud 
• Continuous Integration 
• Continuous Deployment 
• Continuous Delivery 
15/10/2014 @danielbryantuk
Our Build Pipeline 
Jenkins, with plugins… 
• Build Pipeline 
– wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin 
• Parameterized build 
– wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build 
• Promoted Builds Plugin 
– wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin 
15/10/2014 @danielbryantuk
Our Build Pipeline 
• Component Build 
– Compile 
– Unit Tests (surefire) 
– Integration Tests (failsafe) 
• Deployment onto QA Cloud 
– Python Scripts + Chef to provision 
– Verify success using Python 
– Serverspec serverspec.org 
15/10/2014 @danielbryantuk
Our Build Pipeline 
• Acceptance Tests 
– Cucumber (and Selenium) 
• Performance Tests 
– Jmeter + Jenkins performance plugin 
– Make sure environment is realistic!! 
• Live Deployment? 
15/10/2014 @danielbryantuk
Automating QA 
• Intra-component integration testing 
– Utilise embedded datastore/middleware 
– “Scassandra” (github.com/scassandra) 
– Service virtualisation (www.mbtest.org) 
• Inter-component integration testing 
– The hardest part of SOA… 
– Consider ‘synthetic txns’ (active monitoring) 
15/10/2014 @danielbryantuk
Infrastructure: Say No To Snowflakes! 
• Automate all provisioning (store in SCM) 
• Fry... 
– Chef, Puppet, SaltStack, Ansible 
– Bash, Python (Fabric) 
– Vendor APIs 
• …or bake? 
– Packer.io 
– Netflix Aminator 
15/10/2014 @danielbryantuk
Infrastructure: Say No To Snowflakes! 
• Doing “Proper Development” 
– Gareth Rushgrove at Craft Conf (bit.ly/1njuc49) 
– Chef Conf (www.youtube.com/user/getchef) 
• Local tooling/testing 
– Vagrant (www.vagrantup.com) 
– Docker (www.docker.io) 
15/10/2014 @danielbryantuk
Configuring the Cloud 
• Bundle config with app 
– Upload new config file 
– Re-deploy entire app (easier with Docker?) 
• Store externally 
– Zookeeper & Curator curator.apache.org 
– Netflix Archaius github.com/Netflix/archaius 
– etcd github.com/coreos/etcd 
– Consul.io www.consul.io 
15/10/2014 @danielbryantuk
Documented (just enough) 
Highly cohesive/loosely coupled (all the way down) 
Automated from commit to Cloud 
Resource aware 
Monitored thoroughly 
Antifragile 
15/10/2014 @danielbryantuk
Deployment Platform: What you’ve got… 
15/10/2014 @danielbryantuk
What you think you want… 
15/10/2014 @danielbryantuk
What you actually get… 
Fact: 9 out of 10 cheetahs prefer the 
taste of an Ops team over tinned food 
15/10/2014 @danielbryantuk
Thou Shalt Know thy Cloud… 
• AWS “Magnetic” EBS 100 IOPS 
– New SSD EBS 3K IOPS (burst, PIOPS available) 
– My Mac SSD does 49K IOPS 
• 1000Mbps network max transfer ~125MB/s 
– My Mac does 400+ MB/s Sequential Write to SSD 
Reference for Mac statistics: bit.ly/1ftJZH8 
15/10/2014 @danielbryantuk
Thou Shalt Know they Cloud… 
“Everything fails all the time [in the cloud]” 
Werner Vogels, CTO, Amazon.com 
• Everything is ephemeral 
• Volatility 
• Noisy (virtual) neighbours 
– bit.ly/1w1HQy7 
15/10/2014 @danielbryantuk
Thinking/Acting Operationally 
• Cultivate “Mechanical Sympathy” 
• Virtualisation 
– Tech Target (bit.ly/1kDVqyG) 
• Networking 
– ‘Unix and Linux System Administration Handbook’ 
– aws.amazon.com/documentation 
15/10/2014 @danielbryantuk
Thinking/Acting Operationally 
• Learn Linux fundamentals 
• Diagnostic skills 
– top, netstat, vmstat, tcpdump 
– Java utils: jps, jstat, jmap, jhat 
– “DevOps Troubleshooting” by K. Rankin 
15/10/2014 @danielbryantuk
Documented (just enough) 
Highly cohesive/loosely coupled (all the way down) 
Automated from commit to Cloud 
Resource aware 
Monitored thoroughly 
Antifragile 
15/10/2014 @danielbryantuk
Monitor All The Things! 
• Infrastructure monitoring 
– Nagios / Zabbix 
– AppDynamics 
• Distributed Tracing 
– twitter.github.io/zipkin 
• Centralised Logging 
– logstash.net 
15/10/2014 @danielbryantuk
Component Metrics 
• Dropwizard’s Metrics 
– metrics.codahale.com 
– Spring Boot (bit.ly/1rGo76V) 
• Netflix’s Servo 
– github.com/Netflix/servo 
• Etsy’s StatsD 
– github.com/etsy/statsd/wiki 
15/10/2014 @danielbryantuk
Health Checks 
15/10/2014 @danielbryantuk
Gauges, Counters, Meters, Timers… 
15/10/2014 @danielbryantuk
Graph It! 
15/10/2014 @danielbryantuk 
dashing.io
15/10/2014 @danielbryantuk 
Phrase borrowed from Etsy!
15/10/2014 @danielbryantuk
Documented (just enough) 
Highly cohesive/loosely coupled (all the way down) 
Automated from commit to Cloud 
Resource aware 
Monitored thoroughly 
Antifragile 
15/10/2014 @danielbryantuk
Antifragile 
• The opposite of fragile? 
– Robust… 
– Antifragile… 
• Netflix are best-in-class 
– bit.ly/1gs5n3q 
• System must be robust first! 
15/10/2014 @danielbryantuk
Design for Failure 
• Distributed Computing Principles 
– ‘For young bloods’ (bit.ly/1pKVepz) 
– Netflix (bit.ly/1h5GMid) 
• Design patterns 
– Timeouts / retries 
– Bulkheads / circuit-breakers 
15/10/2014 @danielbryantuk
Retries 
15/10/2014 @danielbryantuk 
github.com/rholder/guava-retrying
Circuit-breaker 
15/10/2014 @danielbryantuk 
github.com/Netflix/Hystrix 
github.com/Netflix/Hystrix/tree/master/hystrix-contrib/hystrix-javanica 
java.dzone.com/articles/hystrix-and-spring-boot 
projects.spring.io/spring-cloud/
Antifragile Patterns: Async FTW 
Asynchronous Communication - queues, pub/sub 
Command Query Responsibility Segregation (CQRS) 
Event Sourcing (ES) 
martinfowler.com/bliki/CQRS.html 
15/10/2014 @danielbryantuk
Antifragile Patterns: Respect the CAP 
Eventual consistency (ACID vs BASE) 
Clever caching (soft-state) 
en.wikipedia.org/wiki/CAP_theorem 
cloudshankar.blogspot.co.uk/2013/05/eventual-consistency.html 
www.dataversity.net/acid-vs-base-the-shifting-ph-of-database-transaction-processing/ 
15/10/2014 @danielbryantuk
Antifragile Patterns: Elastic Scaling 
Stateless components 
Distributed data stores / caches 
15/10/2014 @danielbryantuk
So, Cloud Apps are ‘done’ when… 
Documented (just enough) 
Highly cohesive/loosely coupled (all the way down) 
Automated from commit to Cloud 
Resource aware 
Monitored thoroughly 
Antifragile 
15/10/2014 @danielbryantuk
Thanks For Listening 
• Massive thanks to all the OpenCredo team! 
• Questions / comments? 
– daniel.bryant@opencredo.com 
– @danielbryantuk 
15/10/2014 @danielbryantuk

More Related Content

What's hot

What's hot (10)

Collaborating on GitHub for Open Source Documentation
Collaborating on GitHub for Open Source DocumentationCollaborating on GitHub for Open Source Documentation
Collaborating on GitHub for Open Source Documentation
 
Storage for containers and cloud-native deployments - Rancher Online Meetup -...
Storage for containers and cloud-native deployments - Rancher Online Meetup -...Storage for containers and cloud-native deployments - Rancher Online Meetup -...
Storage for containers and cloud-native deployments - Rancher Online Meetup -...
 
muCon 2016: "Seven (More) Deadly Sins of Microservices"
muCon 2016: "Seven (More) Deadly Sins of Microservices"muCon 2016: "Seven (More) Deadly Sins of Microservices"
muCon 2016: "Seven (More) Deadly Sins of Microservices"
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7
 
Dear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes ClusterDear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes Cluster
 
A Personal Journey
A Personal JourneyA Personal Journey
A Personal Journey
 
Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0
Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0
Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0
 
DevOps Fest 2020. Alexey Golub. GitHub Actions in action
DevOps Fest 2020. Alexey Golub. GitHub Actions in actionDevOps Fest 2020. Alexey Golub. GitHub Actions in action
DevOps Fest 2020. Alexey Golub. GitHub Actions in action
 
Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36
 
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Introducing Apache Mesos environments in Rancher - June 2016 Online MeetupIntroducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
 

Viewers also liked

End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
andrejusb
 

Viewers also liked (9)

Running your Java EE 6 applications in the Cloud (FISL 12)
Running your Java EE 6 applications in the Cloud (FISL 12)Running your Java EE 6 applications in the Cloud (FISL 12)
Running your Java EE 6 applications in the Cloud (FISL 12)
 
NoSQL - Vital Open Source Ingredient for Modern Success
NoSQL - Vital Open Source Ingredient for Modern SuccessNoSQL - Vital Open Source Ingredient for Modern Success
NoSQL - Vital Open Source Ingredient for Modern Success
 
Migrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to ContainersMigrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to Containers
 
Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014
 
Thanks Managers!
Thanks Managers!Thanks Managers!
Thanks Managers!
 
Docker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersDocker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developers
 
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftJava EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShift
 
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
 

Similar to JAX London 2014 "Building Java Applications for the Cloud: The DHARMA principles"

LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
Daniel Bryant
 

Similar to JAX London 2014 "Building Java Applications for the Cloud: The DHARMA principles" (20)

JavaOne 2014: Cloud Developer's DHARMA: Redefining 'done' for Cloud applications
JavaOne 2014: Cloud Developer's DHARMA: Redefining 'done' for Cloud applicationsJavaOne 2014: Cloud Developer's DHARMA: Redefining 'done' for Cloud applications
JavaOne 2014: Cloud Developer's DHARMA: Redefining 'done' for Cloud applications
 
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
 
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
 
Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...
Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...
Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...
 
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
 
Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...
Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...
Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...
 
SATURN 2018 "Continuous Delivery with Containers" Extended 90 version
SATURN 2018 "Continuous Delivery with Containers" Extended 90 versionSATURN 2018 "Continuous Delivery with Containers" Extended 90 version
SATURN 2018 "Continuous Delivery with Containers" Extended 90 version
 
OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"
OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"
OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"
 
OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"
OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"
OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"
 
O'Reilly SACON "Continuous Delivery Patterns for Contemporary Architecture"
O'Reilly SACON "Continuous Delivery Patterns for Contemporary Architecture"O'Reilly SACON "Continuous Delivery Patterns for Contemporary Architecture"
O'Reilly SACON "Continuous Delivery Patterns for Contemporary Architecture"
 
vJUG24 2016 "Seven (More) Deadly Sins of Microservice"
vJUG24 2016 "Seven (More) Deadly Sins of Microservice"vJUG24 2016 "Seven (More) Deadly Sins of Microservice"
vJUG24 2016 "Seven (More) Deadly Sins of Microservice"
 
vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...
vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...
vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...
 
LJC 2015 "The Crafty Consultants Guide to DevOps"
LJC 2015 "The Crafty Consultants Guide to DevOps"LJC 2015 "The Crafty Consultants Guide to DevOps"
LJC 2015 "The Crafty Consultants Guide to DevOps"
 
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
 
Jax London 2018: "Testing Microservices from Development to Production"
Jax London 2018: "Testing Microservices from Development to Production"Jax London 2018: "Testing Microservices from Development to Production"
Jax London 2018: "Testing Microservices from Development to Production"
 
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
 
Joomla Continuous Delivery with Docker
Joomla Continuous Delivery with DockerJoomla Continuous Delivery with Docker
Joomla Continuous Delivery with Docker
 
jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"
jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"
jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"
 
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
 
Building a microservice ecosystem
Building a microservice ecosystemBuilding a microservice ecosystem
Building a microservice ecosystem
 

More from Daniel Bryant

More from Daniel Bryant (20)

ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
ITKonekt 2023: The Busy Platform Engineers Guide to API GatewaysITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
 
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
 
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
 
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
 
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
 
Fall 22: "From Kubernetes to PaaS to... err, what's next"
Fall 22: "From Kubernetes to PaaS to... err, what's next"Fall 22: "From Kubernetes to PaaS to... err, what's next"
Fall 22: "From Kubernetes to PaaS to... err, what's next"
 
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
 
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
 
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
 
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
 
KubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
KubeCon EU 2022: From Kubernetes to PaaS to Err What's NextKubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
KubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
 
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
 
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
 
JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...
JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...
JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...
 
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
 
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
 
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
 
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
 
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
 
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 

JAX London 2014 "Building Java Applications for the Cloud: The DHARMA principles"

  • 1. Building Java applications for the Cloud: The DHARMA principles Daniel Bryant Principal Consultant, Open Credo daniel.bryant@opencredo.com @danielbryantuk @OpenCredo
  • 2. What to expect • Problems when developing for the Cloud – “Lift and shift” – Smashing the monolith – Greenfield (“Cloud native”) • Some suggestions on where to focus efforts – Not specific platform/framework reviews • Tools and techniques • Lots of information… (slides will be available) 15/10/2014 @danielbryantuk
  • 3. Who Am I? • Principal Consultant at OpenCredo • LJC Associate  Agile transformations  DevOps  Microservices and Cloud • Adopt OpenJDK and JSR 15/10/2014 @danielbryantuk
  • 4. The Current Industry Wish List… • Service-Oriented Architecture • Cloud-based deployments • DevOps Culture 15/10/2014 @danielbryantuk
  • 5. The Current Industry Wish List… • Service-Oriented Architecture – Twitter’s Story (bit.ly/1j1WbmI) • Cloud-based deployments – Today! • DevOps Culture – Devoxx UK talk (bit.ly/1BylnZb) – Previous LJC Event (bit.ly/1elVPJz) 15/10/2014 @danielbryantuk
  • 6. Common Cloud Problems TL;DR… 15/10/2014 @danielbryantuk
  • 7. Not respecting the underlying environment 15/10/2014 @danielbryantuk
  • 8. Lack of application/platform monitoring… 15/10/2014 @danielbryantuk
  • 9. Bizarre failure modes… 15/10/2014 @danielbryantuk
  • 10. Difficulty in understanding the new architecture 15/10/2014 @danielbryantuk
  • 11. Confusion over environment provisioning and config 15/10/2014 @danielbryantuk
  • 12. Not testing in the Cloud… (hint: here be dragons!) 15/10/2014 @danielbryantuk
  • 13. We’ve created the “Cloud DHARMA Principles” to act as a checklist when building Cloud apps 15/10/2014 @danielbryantuk
  • 14. dharma /ˈdɑːmə,ˈdəːmə/ noun 1. Signifies behaviors that are considered to be in accord with order that makes life and universe possible (Hinduism) 2. "cosmic law and order”, but is also applied to the teachings of the Buddha (Buddhism) 15/10/2014 @danielbryantuk
  • 15. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 15/10/2014 @danielbryantuk
  • 16. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 15/10/2014 @danielbryantuk
  • 18. Documentation (just enough) • Provide a map for developers • Component purpose (and contract) • Initialisation instructions (mocks/stubs) • Highlights areas of operational risk 15/10/2014 @danielbryantuk
  • 19. Simon Brown’s C4 Model 15/10/2014 @danielbryantuk www.codingthearchitecture.com
  • 22. API Docs with Swagger 15/10/2014 @danielbryantuk helloreverb.com/developers/swagger
  • 23. Create a PACT 15/10/2014 @danielbryantuk github.com/DiUS/pact-jvm
  • 24. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 15/10/2014 @danielbryantuk
  • 25. High Cohesion / Loose Coupling (all the way down…) • Code • Architecture – Components – Services • Public API – PayPal (bit.ly/1hnZNly) 15/10/2014 @danielbryantuk
  • 26. Smashing the Monolith… • Business functionality -“Cart Service” • Technology chunk - “Email Service” • Vertical Slice – “Registration” (Groupon: vimeo.com/105880150) • Horizontal Slice – “User Repo” (Microservices: oreil.ly/1pp6qmx) 15/10/2014 @danielbryantuk
  • 27. Microservices • Probably won’t catch on… ;-) 15/10/2014 @danielbryantuk
  • 28. Twelve Factor Apps 15/10/2014 @danielbryantuk http://12factor.net/
  • 29. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 15/10/2014 @danielbryantuk
  • 30. Automated from Commit to Cloud • Continuous Integration • Continuous Deployment • Continuous Delivery 15/10/2014 @danielbryantuk
  • 31. Our Build Pipeline Jenkins, with plugins… • Build Pipeline – wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin • Parameterized build – wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build • Promoted Builds Plugin – wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin 15/10/2014 @danielbryantuk
  • 32. Our Build Pipeline • Component Build – Compile – Unit Tests (surefire) – Integration Tests (failsafe) • Deployment onto QA Cloud – Python Scripts + Chef to provision – Verify success using Python – Serverspec serverspec.org 15/10/2014 @danielbryantuk
  • 33. Our Build Pipeline • Acceptance Tests – Cucumber (and Selenium) • Performance Tests – Jmeter + Jenkins performance plugin – Make sure environment is realistic!! • Live Deployment? 15/10/2014 @danielbryantuk
  • 34. Automating QA • Intra-component integration testing – Utilise embedded datastore/middleware – “Scassandra” (github.com/scassandra) – Service virtualisation (www.mbtest.org) • Inter-component integration testing – The hardest part of SOA… – Consider ‘synthetic txns’ (active monitoring) 15/10/2014 @danielbryantuk
  • 35. Infrastructure: Say No To Snowflakes! • Automate all provisioning (store in SCM) • Fry... – Chef, Puppet, SaltStack, Ansible – Bash, Python (Fabric) – Vendor APIs • …or bake? – Packer.io – Netflix Aminator 15/10/2014 @danielbryantuk
  • 36. Infrastructure: Say No To Snowflakes! • Doing “Proper Development” – Gareth Rushgrove at Craft Conf (bit.ly/1njuc49) – Chef Conf (www.youtube.com/user/getchef) • Local tooling/testing – Vagrant (www.vagrantup.com) – Docker (www.docker.io) 15/10/2014 @danielbryantuk
  • 37. Configuring the Cloud • Bundle config with app – Upload new config file – Re-deploy entire app (easier with Docker?) • Store externally – Zookeeper & Curator curator.apache.org – Netflix Archaius github.com/Netflix/archaius – etcd github.com/coreos/etcd – Consul.io www.consul.io 15/10/2014 @danielbryantuk
  • 38. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 15/10/2014 @danielbryantuk
  • 39. Deployment Platform: What you’ve got… 15/10/2014 @danielbryantuk
  • 40. What you think you want… 15/10/2014 @danielbryantuk
  • 41. What you actually get… Fact: 9 out of 10 cheetahs prefer the taste of an Ops team over tinned food 15/10/2014 @danielbryantuk
  • 42. Thou Shalt Know thy Cloud… • AWS “Magnetic” EBS 100 IOPS – New SSD EBS 3K IOPS (burst, PIOPS available) – My Mac SSD does 49K IOPS • 1000Mbps network max transfer ~125MB/s – My Mac does 400+ MB/s Sequential Write to SSD Reference for Mac statistics: bit.ly/1ftJZH8 15/10/2014 @danielbryantuk
  • 43. Thou Shalt Know they Cloud… “Everything fails all the time [in the cloud]” Werner Vogels, CTO, Amazon.com • Everything is ephemeral • Volatility • Noisy (virtual) neighbours – bit.ly/1w1HQy7 15/10/2014 @danielbryantuk
  • 44. Thinking/Acting Operationally • Cultivate “Mechanical Sympathy” • Virtualisation – Tech Target (bit.ly/1kDVqyG) • Networking – ‘Unix and Linux System Administration Handbook’ – aws.amazon.com/documentation 15/10/2014 @danielbryantuk
  • 45. Thinking/Acting Operationally • Learn Linux fundamentals • Diagnostic skills – top, netstat, vmstat, tcpdump – Java utils: jps, jstat, jmap, jhat – “DevOps Troubleshooting” by K. Rankin 15/10/2014 @danielbryantuk
  • 46. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 15/10/2014 @danielbryantuk
  • 47. Monitor All The Things! • Infrastructure monitoring – Nagios / Zabbix – AppDynamics • Distributed Tracing – twitter.github.io/zipkin • Centralised Logging – logstash.net 15/10/2014 @danielbryantuk
  • 48. Component Metrics • Dropwizard’s Metrics – metrics.codahale.com – Spring Boot (bit.ly/1rGo76V) • Netflix’s Servo – github.com/Netflix/servo • Etsy’s StatsD – github.com/etsy/statsd/wiki 15/10/2014 @danielbryantuk
  • 49. Health Checks 15/10/2014 @danielbryantuk
  • 50. Gauges, Counters, Meters, Timers… 15/10/2014 @danielbryantuk
  • 51. Graph It! 15/10/2014 @danielbryantuk dashing.io
  • 52. 15/10/2014 @danielbryantuk Phrase borrowed from Etsy!
  • 54. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 15/10/2014 @danielbryantuk
  • 55. Antifragile • The opposite of fragile? – Robust… – Antifragile… • Netflix are best-in-class – bit.ly/1gs5n3q • System must be robust first! 15/10/2014 @danielbryantuk
  • 56. Design for Failure • Distributed Computing Principles – ‘For young bloods’ (bit.ly/1pKVepz) – Netflix (bit.ly/1h5GMid) • Design patterns – Timeouts / retries – Bulkheads / circuit-breakers 15/10/2014 @danielbryantuk
  • 57. Retries 15/10/2014 @danielbryantuk github.com/rholder/guava-retrying
  • 58. Circuit-breaker 15/10/2014 @danielbryantuk github.com/Netflix/Hystrix github.com/Netflix/Hystrix/tree/master/hystrix-contrib/hystrix-javanica java.dzone.com/articles/hystrix-and-spring-boot projects.spring.io/spring-cloud/
  • 59. Antifragile Patterns: Async FTW Asynchronous Communication - queues, pub/sub Command Query Responsibility Segregation (CQRS) Event Sourcing (ES) martinfowler.com/bliki/CQRS.html 15/10/2014 @danielbryantuk
  • 60. Antifragile Patterns: Respect the CAP Eventual consistency (ACID vs BASE) Clever caching (soft-state) en.wikipedia.org/wiki/CAP_theorem cloudshankar.blogspot.co.uk/2013/05/eventual-consistency.html www.dataversity.net/acid-vs-base-the-shifting-ph-of-database-transaction-processing/ 15/10/2014 @danielbryantuk
  • 61. Antifragile Patterns: Elastic Scaling Stateless components Distributed data stores / caches 15/10/2014 @danielbryantuk
  • 62. So, Cloud Apps are ‘done’ when… Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 15/10/2014 @danielbryantuk
  • 63. Thanks For Listening • Massive thanks to all the OpenCredo team! • Questions / comments? – daniel.bryant@opencredo.com – @danielbryantuk 15/10/2014 @danielbryantuk

Editor's Notes

  1. James Gough’s “The benefits are more than just the tests” Mash Badar’s “TDD at Scale” (slidesha.re/19P7kzS)