SlideShare a Scribd company logo
Java, Microservices, Cloud and Containers:
Migrating without the Tiers (or Tears)
Daniel Bryant @danielbryantuk
Steve Poole @spoole167
22/09/2016 @danielbryantuk | @spoole167 1
The pitch
• Moving to the cloud requires a fundamental change in mindset
• Technology
• Skills (architectural, operational, QA)
• Organisational design
• DevOps, container technology and microservices are complementary
• Migrating in non-trivial
• Learn from some of our successes (and mistakes)…
22/09/2016 @danielbryantuk | @spoole167 2
Who are we?
22/09/2016 @danielbryantuk | @spoole167 3
Steve Poole
IBM
Developer
@spoole167
Daniel Bryant
Chief Scientist,
OpenCredo
CTO SpectoLabs
@danielbryantuk
Making Java Real Since Version 0.9
Open Source Advocate
DevOps Practitioner (whatever that means!)
Driving Change
“Biz-dev-QA-ops”
Leading change in organisations
Experience of Docker, k8s, Go, Java
InfoQ, DZone, Voxxed contributor
Introduction
22/09/2016 @danielbryantuk | @spoole167 4
What ‘Cloud’ promises
a virtual, dynamic environment which
maximizes use, is infinitely scalable, always
available and needs minimal upfront
investment or commitment
Take your code – host it on someone else's
machine pay only for the resource you use for the
time you use it AND be able to do that very quickly
and repeatedly in parallel
https://www.flickr.com/photos/skohlmann/
The ability to have ‘cloud burst’ capacity is
changing the way software is being designed,
developed and supported
We’re moving to a more industrial scale:
Why buy one computer for a year when you
can hire 365 computers for a day..
https://www.flickr.com/photos/vuhung/
“Compute on demand” – it’s what we always
wanted
Cloud computing:
compute == money
Money changes everything
With a measureable and direct relationship
between $£€¥ and CPU/RAM, disk etc the
financial success or failure of a project is
even easier to see
And that means…
Even more focus on value for money.
American Society of Civil Engineers
Someone
will be
looking at
your leaky
app
Loosing unnecessary baggage - (you have loads)
Java applications have to get lighter.
Java 9 modularity will help but you have to consider
footprint across the board.
Choose your dependencies wisely
Your choice of OS & distribution is important.
The aim is ‘carry on only’
Your application isn’t going on a long trip
https://www.flickr.com/photos/armydre2008/
Startup times
How long do you want to wait?
How long do you have to wait?
Do you need to preemptively start instances ‘just in case’ due
to start up time? To bad – that costs
If the unit of deployment and scaling is an instance of a service
it needs to start FAST
https://www.flickr.com/photos/91295117@N08/
https://www.flickr.com/photos/isherwoodchris/
• Q: How much RAM does
your application use?
• A: Too much
Runtime costs
Most cloud providers will charge you for your RAM usage over time:
$GB/hr. (Sometimes the charge is $0)
Increasing –Xmx directly effects cost. Something businesses can
understand
Net effect : you’ll be tuning your application to fit into specific RAM sizes.
Smaller than you use today.
You need to measure where the storage goes.
You’ll be picking some components based on memory usage
Note that increasing the amount of memory for 1 service increases the bill
by the number of concurrent instances
https://www.flickr.com/photos/erix/
Simply
Java applications are going to be running
in a remote, constrained and metered
environment
There will be precise limits on how much
disk, CPU, RAM, Bandwidth an application
can use and for how long
Whether your application is large or small,
granular or monolithic. Someone will be
paying for each unit used
That person will want to get the most out
of that investment
https://www.flickr.com/photos/rvoegtli/
Where you code runs day-to-day and moment-to-
moment will be driven by economics, legal
requirements and how much risk your business
wants to take.
Your code has to scale better, be more efficient,
resilient, secure and work in constrained
environments
You will have to design, code, deliver, support and
debug code in new ways
It’s going to be scary
How scary?
design, coding, deployment ,
startup, execution, scaling
debugging, security, resilience …
Almost everything
about your
application is
effected
https://www.flickr.com/photos/mjtmail/
Resilient
applications
Design for short term failure: something fails all the time. Expect data and service outages regularly
Fail and recover: don’t diagnose problems in running systems. Kill it and move on
Every IO operation you perform may fail – do as few as possible
Every IO operation may stall – costing you GB/hrs and resources– timeout everything quickly
Every piece of data you receive may be badly formed – check everything
Retry, compensation, backout strategies– these are your new friends
“Everything in the cloud
fails all the time” : Werner
Vogels
Debugging
Remote support for your family?
Fancy having to do that for your own apps?
You have to assume:
You will never be able to log into a remote server.
You will never be able to attach a remote debugger to
a failing app
Ever.
All problems must be resolved by local reproduction
or logs and dumps (discuss)
https://www.flickr.com/photos/carbonnyc/
Debugging
It gets more challenging.
Failures during deployment
or initial startup can be difficult or impossible to
diagnose.
If your service instance didn’t start there is is little
chance of logs being kept!
Learn to love logs, dumps and traces.
Remote log stores and tools are going to be your best
friend
BTW: they’ll cost too
https://www.flickr.com/photos/hinkelstone/
Security
When you deploy to public cloud your system will be
attacked in minutes.
Certainly in < 1hr
Your systems will always be under threat
https://www.flickr.com/photos/ahmadhammoudphotography/
It’s all change
How you design, code, deploy, debug,
support etc will be effected by the metrics
and limits imposed on you.
Financial metrics and limits always
change behavior. It also creates
opportunity
Java applications have to get leaner and
meaner
You have to learn new techniques and
tools
https://www.flickr.com/photos/beigephotos/
Case studies
22/09/2016 @danielbryantuk | @spoole167 22
“Just make it do what the old one does (but better)”
• Case studies
• ‘Teflon shouldered’ product owner
• Rebuilding a service three times
• Problem
• Performing migration without a
clear definition of ‘done’
• Accepting feature creep
22/09/2016 @danielbryantuk | @spoole167 23
“Just make it do what the old one does (but better)”
• Attempt to retrofit BDD/regression tests around application
• Serenity BDD, Cucumber, Jbehave
• Work incrementally with QA team
• Manually test everything
• Create tests for new functionality
• Compare input/output
• Traffic: Twitter’s Diffy
• Datastores: Reconsiliator pattern
22/09/2016 @danielbryantuk | @spoole167 24
Twitter’s Diffy and mysqldbcompare
22/09/2016 @danielbryantuk | @spoole167 25
blog.twitter.com/2015/diffy-testing-services-without-writing-tests dev.mysql.com/doc/mysql-utilities/1.5/en/mysqldbcompare.html
www.infoq.com/news/2015/04/raffi-krikorian-rearchitecting
My ‘re-architecting’ bible…
22/09/2016 @danielbryantuk | @spoole167 26
“Bounding the context”
• Case studies
• Large business software provider
thought they knew their domain
• Small CRM company had let
domain model entropy
• Problem
• Development team lost sight of
the application big picture
• Lack of architectural awareness
and ‘broken windows’
22/09/2016 @danielbryantuk | @spoole167 27
Context mapping (static) & event storming (dynamic)
22/09/2016 @danielbryantuk | @spoole167 28
www.infoq.com/articles/ddd-contextmapping
ziobrando.blogspot.co.uk/2013/11/introducing-event-storming.html
“Bounding the context”
• Create ‘seams’ within codebase
• Natural domain boundaries
• Single responsibility principle
• Look for points of ‘friction’
• Extreme ownership
• Seize (identify)
• Clear (refactor logic / data)
• Hold (metrics and rachets)
• Build (move code to service)
22/09/2016 @danielbryantuk | @spoole167 29
“How small is micro?”
• Case studies
• UK retailer looking to migrate to
cloud and microservices
• Keen to minimise risk
• Problem
• Previous attempts of gradual
migration had failed
• Integration issues - services either
too big or too small
• Spent a long time building a
‘microservice platform’
22/09/2016 @danielbryantuk | @spoole167 30
“How small is micro?”
• Understand microservice principles and Self-Contained Systems (SCS)
• Utilise the strangler pattern
• ‘Service Virtualisation’ is valuable for testing
• Don’t underestimate the value of PaaS
22/09/2016 @danielbryantuk | @spoole167 31
22/09/2016 @danielbryantuk | @spoole167 32
zeroturnaround.com/rebellabs/microservices-for-the-enterprise/
Self-contained systems (SCS)
22/09/2016 @danielbryantuk | @spoole167 33
http://scs-architecture.org/
UI / Biz / Repo
Monolith
Domains
Modules, components,
frameworks, libraries
Self-contained systems (SCS)
22/09/2016 @danielbryantuk | @spoole167 34
SCS
Microservices
Strangling your software (not your manager!)
22/09/2016 @danielbryantuk | @spoole167 35
paulhammant.com/2013/07/14/legacy-application-strangulation-case-studies/
www.nginx.com/blog/refactoring-a-monolith-into-microservices/
Service Virtualisation (for Dev and Test)
• Existing tooling
• Hoverfly
• Wiremock
• VCR/Betamax
• Mountebank
• mirage
22/09/2016 @danielbryantuk | @spoole167 36
Hoverfly
• Lightweight Service virtualisation
• Open source (Apache 2.0)
• Go-based / single binary
• Written by @Spectolabs
• Flexible API simulation
• HTTP / HTTPS
• More Protocols to follow?
22/09/2016 @danielbryantuk | @spoole167 37
22/09/2016 @danielbryantuk | @spoole167 38
• Middleware
• Remove PII
• Rate limit
• Add headers
• Middleware
• Fault injection
• Chaos monkey
The value of PaaS…
22/09/2016 @danielbryantuk | @spoole167 39
The value of PaaS…
22/09/2016 @danielbryantuk | @spoole167 40
“Cloud native or ‘lift and shift’”
• Case studies
• Price comparison website
performance dipped upon a
migration to the cloud
• Problems
• Not coding for distributed or
ephemeral nature of cloud
• No reliable creation of cloud
environment
• Not testing in the cloud
22/09/2016 @danielbryantuk | @spoole167 41
“Cloud native or ‘lift and shift’”
• Push apps through to production as early as possible (CI/CD)
• Build POCs appropriately
• Include building infrastructure in the pipeline
• Include NFR testing in the build pipeline
• Dev, QA and Ops must cultivate ‘mechanical sympathy’
• Everything in the cloud is networked
• Configure local development environments as appropriate
22/09/2016 @danielbryantuk | @spoole167 42
NFR testing in the (cloud) pipeline
22/09/2016 @danielbryantuk | @spoole167 43
NFRs testing in the (container) pipeline
22/09/2016 @danielbryantuk | @spoole167 44
NFR testing resources
• Performance
• JMeter
• Gatling
• Fault-tolerance
• Hoverfly
• Wiremock/Saboteur
• Security
• bdd-security (OWASP ZAP)
• OWASP Dependency-Check
• Docker Bench for Security
22/09/2016 @danielbryantuk | @spoole167 45
Security is vital (but often ignored)
22/09/2016 @danielbryantuk | @spoole167 46
www.youtube.com/watch?v=c9uvV4ChIXw
www.infoq.com/news/2016/08/secure-docker-microservices
Shameless plugs…
22/09/2016 @danielbryantuk | @spoole167 47
www.youtube.com/watch?v=A1982GdXXSA
“Containerise all the things”
• Problem
• JVM respecting resource limits
• OOM: Unable to create thread
• Random application stalling
• Case studies
• www.notonthehighstreet.com
22/09/2016 @danielbryantuk | @spoole167 48
“Containerise all the things”
• Set container memory appropriately
• docker - - memory=”Xg”
• JVM requirements = Heap size (Xmx) + Metaspace + JVM overhead
• Account for native thread requirements e.g. thread stack size (Xss)
• Watch out for ulimits
• Entropy
• Host entropy can soon be exhausted by crypto operations
• –Djava.security.egd=file:/dev/urandom
• Be aware of security ramifications
22/09/2016 @danielbryantuk | @spoole167 49
Containerising our knowledge
22/09/2016 @danielbryantuk | @spoole167 50
Key lessons learned
22/09/2016 @danielbryantuk | @spoole167 51
Lessons learned from the trenches
• Specify goals and targets of migration (and retrospect)
• Undertake just enough up front design (contexts, APIs, integration)
• Understand distributed systems (12 factors etc)
• Start pushing to production ASAP
• There is nothing wrong with PaaS
• Programmable infrastructure is a key enabler
• Don’t forget the NFRs
• Containers and microservices are complementary to cloud
22/09/2016 @danielbryantuk | @spoole167 52
Recommended reading
22/09/2016 @danielbryantuk | @spoole167 53
Thanks for listening
• Any questions?
• Daniel Bryant (@danielbryantuk )
• Steve Pool (@spoole167)
22/09/2016 @danielbryantuk | @spoole167 54

More Related Content

What's hot (20)

PDF
DevoxxUK 2015 "The Seven Deadly Sins of Microservices (Full Version)"
Daniel Bryant
 
PDF
Haufe #msaday: "Building a Microservice Ecosystem"
Daniel Bryant
 
PPTX
J1 2015 "Thinking Fast and Slow with Software Development"
Daniel Bryant
 
PDF
Microservices: The Organizational and People Impact
Ambassador Labs
 
PDF
BCS 2016 "Intro to Microservices (and the Seven Deadly Sins)"
Daniel Bryant
 
PDF
ACCU16 "Let's Not Repeat the Mistakes of SOA: 'Micro' Services, Macro Organis...
Daniel Bryant
 
PDF
OOP/MM 2017: "Seven (More) Deadly Sins of Microservices"
Daniel Bryant
 
PPTX
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
Daniel Bryant
 
PPTX
LJCConf 2013 "Chuck Norris Doesn't Need DevOps"
Daniel Bryant
 
PPTX
LJC 2015 "The Crafty Consultants Guide to DevOps"
Daniel Bryant
 
PDF
ZTLive 2016 "Introduction to Microservices"
Daniel Bryant
 
PPTX
LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"
Daniel Bryant
 
PPTX
JavaOne 2014: Cloud Developer's DHARMA: Redefining 'done' for Cloud applications
Daniel Bryant
 
PDF
ContainerSched 2015 "Our journey to world (gifting) domination - how notonthe...
Daniel Bryant
 
PPTX
LSCC 2014 "Crafting DevOps: Applying Software Craftsmanship to DevOps"
Daniel Bryant
 
PPTX
LJC 05/14 "Cloud Developer's DHARMA"
Daniel Bryant
 
PPTX
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
Daniel Bryant
 
PDF
GOTO Chicago/CraftConf 2017 "The Seven (More) Deadly Sins of Microservices"
Daniel Bryant
 
PDF
CraftConf 2017 "Microservices: The Organisational and People Impact"
Daniel Bryant
 
PDF
Microservices - Scaling Development and Service
Paulo Gaspar
 
DevoxxUK 2015 "The Seven Deadly Sins of Microservices (Full Version)"
Daniel Bryant
 
Haufe #msaday: "Building a Microservice Ecosystem"
Daniel Bryant
 
J1 2015 "Thinking Fast and Slow with Software Development"
Daniel Bryant
 
Microservices: The Organizational and People Impact
Ambassador Labs
 
BCS 2016 "Intro to Microservices (and the Seven Deadly Sins)"
Daniel Bryant
 
ACCU16 "Let's Not Repeat the Mistakes of SOA: 'Micro' Services, Macro Organis...
Daniel Bryant
 
OOP/MM 2017: "Seven (More) Deadly Sins of Microservices"
Daniel Bryant
 
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
Daniel Bryant
 
LJCConf 2013 "Chuck Norris Doesn't Need DevOps"
Daniel Bryant
 
LJC 2015 "The Crafty Consultants Guide to DevOps"
Daniel Bryant
 
ZTLive 2016 "Introduction to Microservices"
Daniel Bryant
 
LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"
Daniel Bryant
 
JavaOne 2014: Cloud Developer's DHARMA: Redefining 'done' for Cloud applications
Daniel Bryant
 
ContainerSched 2015 "Our journey to world (gifting) domination - how notonthe...
Daniel Bryant
 
LSCC 2014 "Crafting DevOps: Applying Software Craftsmanship to DevOps"
Daniel Bryant
 
LJC 05/14 "Cloud Developer's DHARMA"
Daniel Bryant
 
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
Daniel Bryant
 
GOTO Chicago/CraftConf 2017 "The Seven (More) Deadly Sins of Microservices"
Daniel Bryant
 
CraftConf 2017 "Microservices: The Organisational and People Impact"
Daniel Bryant
 
Microservices - Scaling Development and Service
Paulo Gaspar
 

Viewers also liked (13)

PDF
MicroManchester 2016 "A Brief Guide to Microservices"
Daniel Bryant
 
PDF
Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"
Daniel Bryant
 
PDF
MicroManchester 2016 "Microservices from 30000ft: Organisation, Architecture ...
Daniel Bryant
 
PDF
CTOs in London "The Challenges of Evaluating Development Technology Within th...
Daniel Bryant
 
PDF
CraftConf [Preview] "Empathy - The Hidden Ingredient of Good Software Develop...
Daniel Bryant
 
PPTX
The London Web "Empathy - The Hidden Ingredient of Good Software Development"
Daniel Bryant
 
PPTX
The Java memory model made easy
Rafael Winterhalter
 
PDF
Microservice Summit 2016 "Microservices: The Organisational and People Impact"
Daniel Bryant
 
PPTX
Devternity 2016 "Thinking Fast and Slow with Software Development"
Daniel Bryant
 
PDF
DevOpsNorth 2017 "Seven (More) Deadly Sins of Microservices"
Daniel Bryant
 
PDF
microXchg 2017: "Microservices: The People and Organisational Impact"
Daniel Bryant
 
PDF
Why You Should Care About ALS @slidecomet @itseugenec
HighSpark | Visual Storytelling Agency
 
PDF
How to Make Awesome SlideShares: Tips & Tricks
SlideShare
 
MicroManchester 2016 "A Brief Guide to Microservices"
Daniel Bryant
 
Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"
Daniel Bryant
 
MicroManchester 2016 "Microservices from 30000ft: Organisation, Architecture ...
Daniel Bryant
 
CTOs in London "The Challenges of Evaluating Development Technology Within th...
Daniel Bryant
 
CraftConf [Preview] "Empathy - The Hidden Ingredient of Good Software Develop...
Daniel Bryant
 
The London Web "Empathy - The Hidden Ingredient of Good Software Development"
Daniel Bryant
 
The Java memory model made easy
Rafael Winterhalter
 
Microservice Summit 2016 "Microservices: The Organisational and People Impact"
Daniel Bryant
 
Devternity 2016 "Thinking Fast and Slow with Software Development"
Daniel Bryant
 
DevOpsNorth 2017 "Seven (More) Deadly Sins of Microservices"
Daniel Bryant
 
microXchg 2017: "Microservices: The People and Organisational Impact"
Daniel Bryant
 
Why You Should Care About ALS @slidecomet @itseugenec
HighSpark | Visual Storytelling Agency
 
How to Make Awesome SlideShares: Tips & Tricks
SlideShare
 
Ad

Similar to JavaOne 2016 "Java, Microservices, Cloud and Containers" (20)

PDF
Evolving to Cloud-Native - Nate Schutta 2/2
VMware Tanzu
 
PDF
Evolving to Cloud-Native - Nate Schutta (2/2)
VMware Tanzu
 
PPT
Cloud Economics
Chris Bailey
 
PPTX
Cloud Economics for Java at Java2Days
Steve Poole
 
PPT
All Change! How the new economics of Cloud will make you think differently ab...
Steve Poole
 
PPT
All Change how the economics of Cloud will make you think differently about Java
Steve Poole
 
PPT
The economies of scaling software - Abdel Remani
jaxconf
 
PPT
The Economies of Scaling Software
Abdelmonaim Remani
 
PDF
From Monoliths to Services: Paying Your Technical Debt
TechWell
 
PPTX
A Microservice Journey
Christian Posta
 
PDF
JAXDevOps 2017 "The Seven (More) Deadly Sins of Microservices
Daniel Bryant
 
PDF
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
Redis Labs
 
PDF
Migrating to Public Cloud
Adrian Cockcroft
 
PPTX
1 App,
Antoine COETSIER
 
PPTX
JAXLondon 2015 "DevOps and the Cloud: All Hail the (Developer) King"
Daniel Bryant
 
PPT
All change! How the new Economics of Cloud will make you think differently ab...
JAXLondon_Conference
 
PPTX
DevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve Poole
JAXLondon_Conference
 
PPTX
muCon 2014 "Building Java Microservices for the Cloud"
Daniel Bryant
 
PPTX
7 steps to Enterprise PaaS
VMware vFabric
 
PDF
Designing and coding for cloud-native applications using Python, Harjinder Mi...
Pôle Systematic Paris-Region
 
Evolving to Cloud-Native - Nate Schutta 2/2
VMware Tanzu
 
Evolving to Cloud-Native - Nate Schutta (2/2)
VMware Tanzu
 
Cloud Economics
Chris Bailey
 
Cloud Economics for Java at Java2Days
Steve Poole
 
All Change! How the new economics of Cloud will make you think differently ab...
Steve Poole
 
All Change how the economics of Cloud will make you think differently about Java
Steve Poole
 
The economies of scaling software - Abdel Remani
jaxconf
 
The Economies of Scaling Software
Abdelmonaim Remani
 
From Monoliths to Services: Paying Your Technical Debt
TechWell
 
A Microservice Journey
Christian Posta
 
JAXDevOps 2017 "The Seven (More) Deadly Sins of Microservices
Daniel Bryant
 
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
Redis Labs
 
Migrating to Public Cloud
Adrian Cockcroft
 
JAXLondon 2015 "DevOps and the Cloud: All Hail the (Developer) King"
Daniel Bryant
 
All change! How the new Economics of Cloud will make you think differently ab...
JAXLondon_Conference
 
DevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve Poole
JAXLondon_Conference
 
muCon 2014 "Building Java Microservices for the Cloud"
Daniel Bryant
 
7 steps to Enterprise PaaS
VMware vFabric
 
Designing and coding for cloud-native applications using Python, Harjinder Mi...
Pôle Systematic Paris-Region
 
Ad

More from Daniel Bryant (20)

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

Recently uploaded (20)

PDF
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
July Patch Tuesday
Ivanti
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Top Managed Service Providers in Los Angeles
Captain IT
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 

JavaOne 2016 "Java, Microservices, Cloud and Containers"

  • 1. Java, Microservices, Cloud and Containers: Migrating without the Tiers (or Tears) Daniel Bryant @danielbryantuk Steve Poole @spoole167 22/09/2016 @danielbryantuk | @spoole167 1
  • 2. The pitch • Moving to the cloud requires a fundamental change in mindset • Technology • Skills (architectural, operational, QA) • Organisational design • DevOps, container technology and microservices are complementary • Migrating in non-trivial • Learn from some of our successes (and mistakes)… 22/09/2016 @danielbryantuk | @spoole167 2
  • 3. Who are we? 22/09/2016 @danielbryantuk | @spoole167 3 Steve Poole IBM Developer @spoole167 Daniel Bryant Chief Scientist, OpenCredo CTO SpectoLabs @danielbryantuk Making Java Real Since Version 0.9 Open Source Advocate DevOps Practitioner (whatever that means!) Driving Change “Biz-dev-QA-ops” Leading change in organisations Experience of Docker, k8s, Go, Java InfoQ, DZone, Voxxed contributor
  • 5. What ‘Cloud’ promises a virtual, dynamic environment which maximizes use, is infinitely scalable, always available and needs minimal upfront investment or commitment Take your code – host it on someone else's machine pay only for the resource you use for the time you use it AND be able to do that very quickly and repeatedly in parallel
  • 6. https://www.flickr.com/photos/skohlmann/ The ability to have ‘cloud burst’ capacity is changing the way software is being designed, developed and supported We’re moving to a more industrial scale: Why buy one computer for a year when you can hire 365 computers for a day..
  • 8. Cloud computing: compute == money Money changes everything With a measureable and direct relationship between $£€¥ and CPU/RAM, disk etc the financial success or failure of a project is even easier to see And that means… Even more focus on value for money.
  • 9. American Society of Civil Engineers Someone will be looking at your leaky app
  • 10. Loosing unnecessary baggage - (you have loads) Java applications have to get lighter. Java 9 modularity will help but you have to consider footprint across the board. Choose your dependencies wisely Your choice of OS & distribution is important. The aim is ‘carry on only’ Your application isn’t going on a long trip https://www.flickr.com/photos/armydre2008/
  • 11. Startup times How long do you want to wait? How long do you have to wait? Do you need to preemptively start instances ‘just in case’ due to start up time? To bad – that costs If the unit of deployment and scaling is an instance of a service it needs to start FAST https://www.flickr.com/photos/91295117@N08/
  • 13. Runtime costs Most cloud providers will charge you for your RAM usage over time: $GB/hr. (Sometimes the charge is $0) Increasing –Xmx directly effects cost. Something businesses can understand Net effect : you’ll be tuning your application to fit into specific RAM sizes. Smaller than you use today. You need to measure where the storage goes. You’ll be picking some components based on memory usage Note that increasing the amount of memory for 1 service increases the bill by the number of concurrent instances https://www.flickr.com/photos/erix/
  • 14. Simply Java applications are going to be running in a remote, constrained and metered environment There will be precise limits on how much disk, CPU, RAM, Bandwidth an application can use and for how long Whether your application is large or small, granular or monolithic. Someone will be paying for each unit used That person will want to get the most out of that investment https://www.flickr.com/photos/rvoegtli/
  • 15. Where you code runs day-to-day and moment-to- moment will be driven by economics, legal requirements and how much risk your business wants to take. Your code has to scale better, be more efficient, resilient, secure and work in constrained environments You will have to design, code, deliver, support and debug code in new ways It’s going to be scary
  • 16. How scary? design, coding, deployment , startup, execution, scaling debugging, security, resilience … Almost everything about your application is effected https://www.flickr.com/photos/mjtmail/
  • 17. Resilient applications Design for short term failure: something fails all the time. Expect data and service outages regularly Fail and recover: don’t diagnose problems in running systems. Kill it and move on Every IO operation you perform may fail – do as few as possible Every IO operation may stall – costing you GB/hrs and resources– timeout everything quickly Every piece of data you receive may be badly formed – check everything Retry, compensation, backout strategies– these are your new friends “Everything in the cloud fails all the time” : Werner Vogels
  • 18. Debugging Remote support for your family? Fancy having to do that for your own apps? You have to assume: You will never be able to log into a remote server. You will never be able to attach a remote debugger to a failing app Ever. All problems must be resolved by local reproduction or logs and dumps (discuss) https://www.flickr.com/photos/carbonnyc/
  • 19. Debugging It gets more challenging. Failures during deployment or initial startup can be difficult or impossible to diagnose. If your service instance didn’t start there is is little chance of logs being kept! Learn to love logs, dumps and traces. Remote log stores and tools are going to be your best friend BTW: they’ll cost too https://www.flickr.com/photos/hinkelstone/
  • 20. Security When you deploy to public cloud your system will be attacked in minutes. Certainly in < 1hr Your systems will always be under threat https://www.flickr.com/photos/ahmadhammoudphotography/
  • 21. It’s all change How you design, code, deploy, debug, support etc will be effected by the metrics and limits imposed on you. Financial metrics and limits always change behavior. It also creates opportunity Java applications have to get leaner and meaner You have to learn new techniques and tools https://www.flickr.com/photos/beigephotos/
  • 23. “Just make it do what the old one does (but better)” • Case studies • ‘Teflon shouldered’ product owner • Rebuilding a service three times • Problem • Performing migration without a clear definition of ‘done’ • Accepting feature creep 22/09/2016 @danielbryantuk | @spoole167 23
  • 24. “Just make it do what the old one does (but better)” • Attempt to retrofit BDD/regression tests around application • Serenity BDD, Cucumber, Jbehave • Work incrementally with QA team • Manually test everything • Create tests for new functionality • Compare input/output • Traffic: Twitter’s Diffy • Datastores: Reconsiliator pattern 22/09/2016 @danielbryantuk | @spoole167 24
  • 25. Twitter’s Diffy and mysqldbcompare 22/09/2016 @danielbryantuk | @spoole167 25 blog.twitter.com/2015/diffy-testing-services-without-writing-tests dev.mysql.com/doc/mysql-utilities/1.5/en/mysqldbcompare.html
  • 27. “Bounding the context” • Case studies • Large business software provider thought they knew their domain • Small CRM company had let domain model entropy • Problem • Development team lost sight of the application big picture • Lack of architectural awareness and ‘broken windows’ 22/09/2016 @danielbryantuk | @spoole167 27
  • 28. Context mapping (static) & event storming (dynamic) 22/09/2016 @danielbryantuk | @spoole167 28 www.infoq.com/articles/ddd-contextmapping ziobrando.blogspot.co.uk/2013/11/introducing-event-storming.html
  • 29. “Bounding the context” • Create ‘seams’ within codebase • Natural domain boundaries • Single responsibility principle • Look for points of ‘friction’ • Extreme ownership • Seize (identify) • Clear (refactor logic / data) • Hold (metrics and rachets) • Build (move code to service) 22/09/2016 @danielbryantuk | @spoole167 29
  • 30. “How small is micro?” • Case studies • UK retailer looking to migrate to cloud and microservices • Keen to minimise risk • Problem • Previous attempts of gradual migration had failed • Integration issues - services either too big or too small • Spent a long time building a ‘microservice platform’ 22/09/2016 @danielbryantuk | @spoole167 30
  • 31. “How small is micro?” • Understand microservice principles and Self-Contained Systems (SCS) • Utilise the strangler pattern • ‘Service Virtualisation’ is valuable for testing • Don’t underestimate the value of PaaS 22/09/2016 @danielbryantuk | @spoole167 31
  • 32. 22/09/2016 @danielbryantuk | @spoole167 32 zeroturnaround.com/rebellabs/microservices-for-the-enterprise/
  • 33. Self-contained systems (SCS) 22/09/2016 @danielbryantuk | @spoole167 33 http://scs-architecture.org/ UI / Biz / Repo Monolith Domains Modules, components, frameworks, libraries
  • 34. Self-contained systems (SCS) 22/09/2016 @danielbryantuk | @spoole167 34 SCS Microservices
  • 35. Strangling your software (not your manager!) 22/09/2016 @danielbryantuk | @spoole167 35 paulhammant.com/2013/07/14/legacy-application-strangulation-case-studies/ www.nginx.com/blog/refactoring-a-monolith-into-microservices/
  • 36. Service Virtualisation (for Dev and Test) • Existing tooling • Hoverfly • Wiremock • VCR/Betamax • Mountebank • mirage 22/09/2016 @danielbryantuk | @spoole167 36
  • 37. Hoverfly • Lightweight Service virtualisation • Open source (Apache 2.0) • Go-based / single binary • Written by @Spectolabs • Flexible API simulation • HTTP / HTTPS • More Protocols to follow? 22/09/2016 @danielbryantuk | @spoole167 37
  • 38. 22/09/2016 @danielbryantuk | @spoole167 38 • Middleware • Remove PII • Rate limit • Add headers • Middleware • Fault injection • Chaos monkey
  • 39. The value of PaaS… 22/09/2016 @danielbryantuk | @spoole167 39
  • 40. The value of PaaS… 22/09/2016 @danielbryantuk | @spoole167 40
  • 41. “Cloud native or ‘lift and shift’” • Case studies • Price comparison website performance dipped upon a migration to the cloud • Problems • Not coding for distributed or ephemeral nature of cloud • No reliable creation of cloud environment • Not testing in the cloud 22/09/2016 @danielbryantuk | @spoole167 41
  • 42. “Cloud native or ‘lift and shift’” • Push apps through to production as early as possible (CI/CD) • Build POCs appropriately • Include building infrastructure in the pipeline • Include NFR testing in the build pipeline • Dev, QA and Ops must cultivate ‘mechanical sympathy’ • Everything in the cloud is networked • Configure local development environments as appropriate 22/09/2016 @danielbryantuk | @spoole167 42
  • 43. NFR testing in the (cloud) pipeline 22/09/2016 @danielbryantuk | @spoole167 43
  • 44. NFRs testing in the (container) pipeline 22/09/2016 @danielbryantuk | @spoole167 44
  • 45. NFR testing resources • Performance • JMeter • Gatling • Fault-tolerance • Hoverfly • Wiremock/Saboteur • Security • bdd-security (OWASP ZAP) • OWASP Dependency-Check • Docker Bench for Security 22/09/2016 @danielbryantuk | @spoole167 45
  • 46. Security is vital (but often ignored) 22/09/2016 @danielbryantuk | @spoole167 46 www.youtube.com/watch?v=c9uvV4ChIXw www.infoq.com/news/2016/08/secure-docker-microservices
  • 47. Shameless plugs… 22/09/2016 @danielbryantuk | @spoole167 47 www.youtube.com/watch?v=A1982GdXXSA
  • 48. “Containerise all the things” • Problem • JVM respecting resource limits • OOM: Unable to create thread • Random application stalling • Case studies • www.notonthehighstreet.com 22/09/2016 @danielbryantuk | @spoole167 48
  • 49. “Containerise all the things” • Set container memory appropriately • docker - - memory=”Xg” • JVM requirements = Heap size (Xmx) + Metaspace + JVM overhead • Account for native thread requirements e.g. thread stack size (Xss) • Watch out for ulimits • Entropy • Host entropy can soon be exhausted by crypto operations • –Djava.security.egd=file:/dev/urandom • Be aware of security ramifications 22/09/2016 @danielbryantuk | @spoole167 49
  • 50. Containerising our knowledge 22/09/2016 @danielbryantuk | @spoole167 50
  • 51. Key lessons learned 22/09/2016 @danielbryantuk | @spoole167 51
  • 52. Lessons learned from the trenches • Specify goals and targets of migration (and retrospect) • Undertake just enough up front design (contexts, APIs, integration) • Understand distributed systems (12 factors etc) • Start pushing to production ASAP • There is nothing wrong with PaaS • Programmable infrastructure is a key enabler • Don’t forget the NFRs • Containers and microservices are complementary to cloud 22/09/2016 @danielbryantuk | @spoole167 52
  • 54. Thanks for listening • Any questions? • Daniel Bryant (@danielbryantuk ) • Steve Pool (@spoole167) 22/09/2016 @danielbryantuk | @spoole167 54