SlideShare a Scribd company logo
1 of 49
Download to read offline
Creating a Microservice?
Answer These 10 Questions First.
Brian Kelly, VP Engineering, Datawire
DevOpsDays Austin, May 2nd 2016
@brikelly
bkelly@datawire.io
datawire.io
Hi!
Me
* Working in distributed systems most of my career
* Built a number of middleware and messaging products
* Strangled a SaaS monolith with microservices
Datawire
* Based in Boston and San Francisco
* We provide technology for companies adopting microservices
* We’ve spent a lot of time with the master microservices practitioners
from high-growth technology companies
datawire.io
Microservices increase development velocity
DevOps increases release velocity
For organizations scaling rapidly, doing one without the
other is…“suboptimal”
Microservices and DevOps:
A Perfect Match
datawire.io 4
A microservice is deliberately simple on the inside
It’s what’s outside that’s hard
datawire.io 5
“There are only two hard problems in distributed systems:
1. Exactly-once delivery
2. Guaranteed order of messages
1. Exactly-once delivery”
@mathiasverraes
datawire.io
Force awareness in your teams of latent concerns
* For example, potential future issues with scalability and reliability
It’s OK to not have sophisticated answers for each question
* But asking them is important!
Why Ask These 10 Questions?
datawire.io 7
Organization
DevelopmentArchitecture
Categories
datawire.io 8
Organization
1. Have you invested enough in developer infrastructure?
datawire.io 9
Developer Infrastructure Teams
The dev infrastructure team focuses on
developer education, core infrastructure, and
driving standards through a great DX.
datawire.io 10
Investing in the core infrastructure necessary for
independent iteration is key
Continuous
delivery workflow
Loosely coupled
services
Application
resilience
datawire.io 11
2. How will your new service be deployed and upgraded?
Organization
datawire.io
Bake
Docker
Packer
Deploy
AWS
Cloud Foundry
Docker
GCP
Kubernetes
Mesos
Microso! Azure
Build
Circle CI
Go.cd
JFrog
Jenkins
Travis
Define
DatawireQuark
Finagle/Thri!
HTTP/JSON
gRPC/Protobuf
Monitor
AppDynamics
DataDog
InfluxData
Nagios
New Relic
SignalFX
Sysdig
Wavefront
Zipkin
Connect
Datawire Connect
Homegrown
Hystrix / RIbbon
SmartStack
DevOps
Development
Build
andpackagethecode/
contractintoasource
artifact
GitHub /
Source
JAR, Gem,
npm
AMI,
Container,
VM
Microservice
Define
thecontract(API,data
format,protocol)
thebusinesslogic
Code
Connect
themicroservicetoother
microservices
Monitor
thehealthofthedeployed
microservice
Deploy
theartifacttorunonthe
appropriatecompute
resources
theapplication&
dependenciesintodeploy-
ableartifact
Bake Automated DevOps workflow: Spinnaker
12
Our Model
datawire.io 13
Continuous
delivery workflow
1. Workflow needs to be defined but
does not need to be fully automated.
Increase automation as the number of
microservices grows.
2. Need to have service running in
production in order to fully test.
Quickly move from commit to customer
datawire.io 14
Each upgrade is an opportunity to break the contract between your new
service and any other dependent services
Plenty of techniques exist for mitigating the chance of failure:
* Well-specified structural and behavioral service contracts
* Dark launching for examining the effect of prod traffic without risk
* Response diff’ing for ensuring contract compliance
* Canary testing for progressive rollout
* Blue/Green deployment for fast rollback
Upgrading your Service
datawire.io 15
3. How will it be monitored and measured?
Organization
datawire.io 16
Ways of monitoring your service’s health:
OK:
* Health check from monitor to service (GET /health from an ELB)
Better:
* “Call Home” health check from service to monitor (APM approach)
Best:
* The client’s experience calling real APIs on the service
Monitoring and Measuring your Service
datawire.io 17
Which service is introducing the
maximum latency into a request?
Which service is the root cause of a
cascade failure?
Monitor the traffic, not just the services
Diagnosis
datawire.io 18
4. How will it be tested?
Development
datawire.io 19
Unit testing a single service is the easy part
What’s harder: testing the entire system
How will a developer verify that their changes to a single microservice
will not break other parts of the system?
Staging environments bring a little comfort, but add significant cost,
complexity, and distractions
Testing
datawire.io 20
Test before launch
Mock services
Sophisticated deployment
workflows
Automated regression tests
Test after launch
Dark launch
Canary testing
Blue / green deployment
Microservice Testing Is Required on Both Sides of Deployment
Reduce probability of failure Reduce impact of failure
datawire.io 21
5. How will it be secured?
Development
datawire.io 22
Most likely type of attack vectors:
* Exploitation of OWASP Top 10 vulnerabilities in your web application
* Internal staff with existing access
* Social engineering
Less likely type of attack vector:
* Attacker gains access behind your perimeter, logs on to your containers,
reverse-engineers your internal service APIs, sends fake requests to and from
each microservice
Prioritize Potential Attack Vectors
datawire.io 23
6. How will it be configured?
Development
datawire.io 24
“Configuration” can be categorized:
• Static configuration (log file locations, ports to listen on, …)
• Runtime configuration (thread pool sizes, JVM heap size, …)
• Behavioral configuration (feature flags, request routing rules, …)
Configuration
datawire.io 25
Prevent arbitrary static configuration changes to production systems
* Instead, deploy those changes into new immutable, copy-on-write
containers
Strive for adaptive, elastic services that require zero dynamic configuration
changes at runtime to stay healthy
Reserve behavioral configuration for progressive rollouts, dark launching,
routing
Configuration
datawire.io 26
7. How will it be consumed by the rest of the system?
Architecture
datawire.io 27
Your new microservice will provide new value to the rest of the system
But will it offer an SLA for its latency, uptime, and reliability?
Those who consume it will appreciate it:
• They can specify timeouts and trip circuit breakers when response latency is high
• They will know which operations are idempotent
• They could cache some responses for large queries
• They can spot uptime SLA discrepancies
Datawire’s Quark is an IDL that captures both structure and behavior
Your microservice needs a contract
datawire.io 28
Structural vs. Behavioral Contracts
Structural:
Intended for Tools
datawire.io 29
Structural vs. Behavioral Contracts
Behavioral:
Intended for Humans
Structural:
Intended for Tools
datawire.io 30
8. How will it be discovered?
Architecture
datawire.io 31
The simpler your discovery system, the less flexibility it offers.
DNS schemes: very simple, but don’t take into account availability, also
makes the developer experience difficult
Strongly consistent datastores (e.g. Zookeeper): more flexible, but don’t
handle network partitions at all
Eventually consistent datastores with pub/sub (e.g. Datawire Connect):
very flexible, handles partitions well, clients and services unaffected even
when they can’t reach the discovery system
Service Discovery
datawire.io 32
9. How will it scale?
Architecture
datawire.io 33
9. How will it scale?
Architecture
datawire.io 34
9. How will it fail to scale?
Architecture
datawire.io
Node
NodeNode
35
What will be the sequence of failures in the
event of a large increase in traffic?
* Example sequence: First the database maxes out, then RAM,
then CPU, then file descriptors, then ELBs, then NICs
Awareness of the likely failure sequence will
help you be aware of your headroom and help
build a plan for capacity growth
Knowing your Chokepoint Sequence
NodeNode
NodeCassandra Cassandra Cassandra
NodeHAProxy HAProxy
NodeNode
datawire.io
Node
NodeNode
36
What will be the sequence of failures in the
event of a large increase in traffic?
* Example sequence: First the database maxes out, then RAM,
then CPU, then file descriptors, then ELBs, then NICs
Awareness of the likely failure sequence will
help you be aware of your headroom and help
build a plan for capacity growth
Knowing your Chokepoint Sequence
NodeNode
NodeCassandra Cassandra Cassandra
NodeHAProxy HAProxy
NodeNode
datawire.io
NodeNode
Node
37
What will be the sequence of failures in the
event of a large increase in traffic?
* Example sequence: First the database maxes out, then RAM,
then CPU, then file descriptors, then ELBs, then NICs
Awareness of the likely failure sequence will
help you be aware of your headroom and help
build a plan for capacity growth
Knowing your Chokepoint Sequence
NodeNode
NodeCassandra Cassandra Cassandra
NodeHAProxy HAProxy
NodeNode
datawire.io
NodeNode
Node
38
What will be the sequence of failures in the
event of a large increase in traffic?
* Example sequence: First the database maxes out, then RAM,
then CPU, then file descriptors, then ELBs, then NICs
Awareness of the likely failure sequence will
help you be aware of your headroom and help
build a plan for capacity growth
Knowing your Chokepoint Sequence
NodeNode
NodeCassandra Cassandra Cassandra
NodeHAProxy HAProxy
NodeNode
datawire.io
NodeNode
Node
39
What will be the sequence of failures in the
event of a large increase in traffic?
* Example sequence: First the database maxes out, then RAM,
then CPU, then file descriptors, then ELBs, then NICs
Awareness of the likely failure sequence will
help you be aware of your headroom and help
build a plan for capacity growth
Knowing your Chokepoint Sequence
NodeNode
NodeCassandra Cassandra Cassandra
NodeHAProxy HAProxy
NodeNode NodeNode NodeNode
datawire.io
NodeNode
Node
40
What will be the sequence of failures in the
event of a large increase in traffic?
* Example sequence: First the database maxes out, then RAM,
then CPU, then file descriptors, then ELBs, then NICs
Awareness of the likely failure sequence will
help you be aware of your headroom and help
build a plan for capacity growth
Knowing your Chokepoint Sequence
NodeNode
NodeCassandra Cassandra Cassandra
NodeHAProxy HAProxy
NodeNode NodeNode NodeNode
datawire.io 41
10. How will dependency failures be handled?
Architecture
datawire.io 42
datawire.io 43
Microservice architectures are a highly distributed system
by their nature
That means failures will occur, and on a frequent basis
Dependency Failures
datawire.io 44
Upstream and Downstream Dependencies
Downstream Microservices
Upstream Microservices
Request
Response
Request
Response
datawire.io 45
Any microservice calling another must handle downstream failure, with:
* Timeouts
* Circuit breakers to prevent cascading failure
* Backpressure
* Default response values
* Caching prior responses
* Retries
* Fallback to alternative endpoints
Don’t assume that downstream failures manifest as dead endpoints
* Services get sick more often than they die!
Downstream Dependency Failure
datawire.io 46
Understand what it means for the rest of the system when (not if) your
service fails
A non-critical service (e.g. a logging service invoked asynchronously over
UDP) can fail without causing upstream disruption, at the expense of log
data loss
A critical synchronous service (e.g. a credit card payment service invoked
over RPC) will require careful use by upstream components if transactions
fail mid-stream
Failing to Serve Upstream Dependencies
datawire.io 47
Demo:
Resilient services with
Datawire Connect
datawire.io
It’s free and OSS!
https://github.com/datawire/datawire-connect
We work in a public Slack channel - feel free to join to ask questions about microservices in
general, or about our tech (link on the GitHub page)
Watch the talks from our recent Microservices Practitioner Summit (speakers from
Facebook, Netflix, Uber, Google, Yelp, New Relic…) on microservices.com
And like every other organization in here, we’re hiring!
48
Trying Datawire Connect
datawire.io 49
Thank you!
Any questions?
@brikelly
bkelly@datawire.io

More Related Content

More from Ambassador Labs

[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...
[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...
[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...Ambassador Labs
 
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex GervaisAmbassador Labs
 
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
[QCon London 2020] The Future of Cloud Native API Gateways - Richard LiAmbassador Labs
 
What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0? What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0? Ambassador Labs
 
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes Ambassador Labs
 
Ambassador: Building a Control Plane for Envoy
Ambassador: Building a Control Plane for Envoy Ambassador: Building a Control Plane for Envoy
Ambassador: Building a Control Plane for Envoy Ambassador Labs
 
Telepresence - Fast Development Workflows for Kubernetes
Telepresence - Fast Development Workflows for KubernetesTelepresence - Fast Development Workflows for Kubernetes
Telepresence - Fast Development Workflows for KubernetesAmbassador Labs
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...Ambassador Labs
 
[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...
[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...
[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...Ambassador Labs
 
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...Ambassador Labs
 
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYCThe Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYCAmbassador Labs
 
Ambassador Kubernetes-Native API Gateway
Ambassador Kubernetes-Native API GatewayAmbassador Kubernetes-Native API Gateway
Ambassador Kubernetes-Native API GatewayAmbassador Labs
 
Micro xchg 2018 - What is a Service Mesh?
Micro xchg 2018 - What is a Service Mesh? Micro xchg 2018 - What is a Service Mesh?
Micro xchg 2018 - What is a Service Mesh? Ambassador Labs
 
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)Ambassador Labs
 
Webinar: Code Faster on Kubernetes
Webinar: Code Faster on KubernetesWebinar: Code Faster on Kubernetes
Webinar: Code Faster on KubernetesAmbassador Labs
 
QCon SF 2017 - Microservices: Service-Oriented Development
QCon SF 2017 - Microservices: Service-Oriented DevelopmentQCon SF 2017 - Microservices: Service-Oriented Development
QCon SF 2017 - Microservices: Service-Oriented DevelopmentAmbassador Labs
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Ambassador Labs
 
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...Ambassador Labs
 
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...Ambassador Labs
 
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOpsDevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOpsAmbassador Labs
 

More from Ambassador Labs (20)

[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...
[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...
[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...
 
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
 
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
 
What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0? What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0?
 
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes
 
Ambassador: Building a Control Plane for Envoy
Ambassador: Building a Control Plane for Envoy Ambassador: Building a Control Plane for Envoy
Ambassador: Building a Control Plane for Envoy
 
Telepresence - Fast Development Workflows for Kubernetes
Telepresence - Fast Development Workflows for KubernetesTelepresence - Fast Development Workflows for Kubernetes
Telepresence - Fast Development Workflows for Kubernetes
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
 
[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...
[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...
[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...
 
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
 
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYCThe Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
 
Ambassador Kubernetes-Native API Gateway
Ambassador Kubernetes-Native API GatewayAmbassador Kubernetes-Native API Gateway
Ambassador Kubernetes-Native API Gateway
 
Micro xchg 2018 - What is a Service Mesh?
Micro xchg 2018 - What is a Service Mesh? Micro xchg 2018 - What is a Service Mesh?
Micro xchg 2018 - What is a Service Mesh?
 
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
 
Webinar: Code Faster on Kubernetes
Webinar: Code Faster on KubernetesWebinar: Code Faster on Kubernetes
Webinar: Code Faster on Kubernetes
 
QCon SF 2017 - Microservices: Service-Oriented Development
QCon SF 2017 - Microservices: Service-Oriented DevelopmentQCon SF 2017 - Microservices: Service-Oriented Development
QCon SF 2017 - Microservices: Service-Oriented Development
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
 
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
 
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
 
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOpsDevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
 

Recently uploaded

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 

Recently uploaded (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 

Creating a Microservice? Answer These 10 Questions First.

  • 1. Creating a Microservice? Answer These 10 Questions First. Brian Kelly, VP Engineering, Datawire DevOpsDays Austin, May 2nd 2016 @brikelly bkelly@datawire.io
  • 2. datawire.io Hi! Me * Working in distributed systems most of my career * Built a number of middleware and messaging products * Strangled a SaaS monolith with microservices Datawire * Based in Boston and San Francisco * We provide technology for companies adopting microservices * We’ve spent a lot of time with the master microservices practitioners from high-growth technology companies
  • 3. datawire.io Microservices increase development velocity DevOps increases release velocity For organizations scaling rapidly, doing one without the other is…“suboptimal” Microservices and DevOps: A Perfect Match
  • 4. datawire.io 4 A microservice is deliberately simple on the inside It’s what’s outside that’s hard
  • 5. datawire.io 5 “There are only two hard problems in distributed systems: 1. Exactly-once delivery 2. Guaranteed order of messages 1. Exactly-once delivery” @mathiasverraes
  • 6. datawire.io Force awareness in your teams of latent concerns * For example, potential future issues with scalability and reliability It’s OK to not have sophisticated answers for each question * But asking them is important! Why Ask These 10 Questions?
  • 8. datawire.io 8 Organization 1. Have you invested enough in developer infrastructure?
  • 9. datawire.io 9 Developer Infrastructure Teams The dev infrastructure team focuses on developer education, core infrastructure, and driving standards through a great DX.
  • 10. datawire.io 10 Investing in the core infrastructure necessary for independent iteration is key Continuous delivery workflow Loosely coupled services Application resilience
  • 11. datawire.io 11 2. How will your new service be deployed and upgraded? Organization
  • 12. datawire.io Bake Docker Packer Deploy AWS Cloud Foundry Docker GCP Kubernetes Mesos Microso! Azure Build Circle CI Go.cd JFrog Jenkins Travis Define DatawireQuark Finagle/Thri! HTTP/JSON gRPC/Protobuf Monitor AppDynamics DataDog InfluxData Nagios New Relic SignalFX Sysdig Wavefront Zipkin Connect Datawire Connect Homegrown Hystrix / RIbbon SmartStack DevOps Development Build andpackagethecode/ contractintoasource artifact GitHub / Source JAR, Gem, npm AMI, Container, VM Microservice Define thecontract(API,data format,protocol) thebusinesslogic Code Connect themicroservicetoother microservices Monitor thehealthofthedeployed microservice Deploy theartifacttorunonthe appropriatecompute resources theapplication& dependenciesintodeploy- ableartifact Bake Automated DevOps workflow: Spinnaker 12 Our Model
  • 13. datawire.io 13 Continuous delivery workflow 1. Workflow needs to be defined but does not need to be fully automated. Increase automation as the number of microservices grows. 2. Need to have service running in production in order to fully test. Quickly move from commit to customer
  • 14. datawire.io 14 Each upgrade is an opportunity to break the contract between your new service and any other dependent services Plenty of techniques exist for mitigating the chance of failure: * Well-specified structural and behavioral service contracts * Dark launching for examining the effect of prod traffic without risk * Response diff’ing for ensuring contract compliance * Canary testing for progressive rollout * Blue/Green deployment for fast rollback Upgrading your Service
  • 15. datawire.io 15 3. How will it be monitored and measured? Organization
  • 16. datawire.io 16 Ways of monitoring your service’s health: OK: * Health check from monitor to service (GET /health from an ELB) Better: * “Call Home” health check from service to monitor (APM approach) Best: * The client’s experience calling real APIs on the service Monitoring and Measuring your Service
  • 17. datawire.io 17 Which service is introducing the maximum latency into a request? Which service is the root cause of a cascade failure? Monitor the traffic, not just the services Diagnosis
  • 18. datawire.io 18 4. How will it be tested? Development
  • 19. datawire.io 19 Unit testing a single service is the easy part What’s harder: testing the entire system How will a developer verify that their changes to a single microservice will not break other parts of the system? Staging environments bring a little comfort, but add significant cost, complexity, and distractions Testing
  • 20. datawire.io 20 Test before launch Mock services Sophisticated deployment workflows Automated regression tests Test after launch Dark launch Canary testing Blue / green deployment Microservice Testing Is Required on Both Sides of Deployment Reduce probability of failure Reduce impact of failure
  • 21. datawire.io 21 5. How will it be secured? Development
  • 22. datawire.io 22 Most likely type of attack vectors: * Exploitation of OWASP Top 10 vulnerabilities in your web application * Internal staff with existing access * Social engineering Less likely type of attack vector: * Attacker gains access behind your perimeter, logs on to your containers, reverse-engineers your internal service APIs, sends fake requests to and from each microservice Prioritize Potential Attack Vectors
  • 23. datawire.io 23 6. How will it be configured? Development
  • 24. datawire.io 24 “Configuration” can be categorized: • Static configuration (log file locations, ports to listen on, …) • Runtime configuration (thread pool sizes, JVM heap size, …) • Behavioral configuration (feature flags, request routing rules, …) Configuration
  • 25. datawire.io 25 Prevent arbitrary static configuration changes to production systems * Instead, deploy those changes into new immutable, copy-on-write containers Strive for adaptive, elastic services that require zero dynamic configuration changes at runtime to stay healthy Reserve behavioral configuration for progressive rollouts, dark launching, routing Configuration
  • 26. datawire.io 26 7. How will it be consumed by the rest of the system? Architecture
  • 27. datawire.io 27 Your new microservice will provide new value to the rest of the system But will it offer an SLA for its latency, uptime, and reliability? Those who consume it will appreciate it: • They can specify timeouts and trip circuit breakers when response latency is high • They will know which operations are idempotent • They could cache some responses for large queries • They can spot uptime SLA discrepancies Datawire’s Quark is an IDL that captures both structure and behavior Your microservice needs a contract
  • 28. datawire.io 28 Structural vs. Behavioral Contracts Structural: Intended for Tools
  • 29. datawire.io 29 Structural vs. Behavioral Contracts Behavioral: Intended for Humans Structural: Intended for Tools
  • 30. datawire.io 30 8. How will it be discovered? Architecture
  • 31. datawire.io 31 The simpler your discovery system, the less flexibility it offers. DNS schemes: very simple, but don’t take into account availability, also makes the developer experience difficult Strongly consistent datastores (e.g. Zookeeper): more flexible, but don’t handle network partitions at all Eventually consistent datastores with pub/sub (e.g. Datawire Connect): very flexible, handles partitions well, clients and services unaffected even when they can’t reach the discovery system Service Discovery
  • 32. datawire.io 32 9. How will it scale? Architecture
  • 33. datawire.io 33 9. How will it scale? Architecture
  • 34. datawire.io 34 9. How will it fail to scale? Architecture
  • 35. datawire.io Node NodeNode 35 What will be the sequence of failures in the event of a large increase in traffic? * Example sequence: First the database maxes out, then RAM, then CPU, then file descriptors, then ELBs, then NICs Awareness of the likely failure sequence will help you be aware of your headroom and help build a plan for capacity growth Knowing your Chokepoint Sequence NodeNode NodeCassandra Cassandra Cassandra NodeHAProxy HAProxy NodeNode
  • 36. datawire.io Node NodeNode 36 What will be the sequence of failures in the event of a large increase in traffic? * Example sequence: First the database maxes out, then RAM, then CPU, then file descriptors, then ELBs, then NICs Awareness of the likely failure sequence will help you be aware of your headroom and help build a plan for capacity growth Knowing your Chokepoint Sequence NodeNode NodeCassandra Cassandra Cassandra NodeHAProxy HAProxy NodeNode
  • 37. datawire.io NodeNode Node 37 What will be the sequence of failures in the event of a large increase in traffic? * Example sequence: First the database maxes out, then RAM, then CPU, then file descriptors, then ELBs, then NICs Awareness of the likely failure sequence will help you be aware of your headroom and help build a plan for capacity growth Knowing your Chokepoint Sequence NodeNode NodeCassandra Cassandra Cassandra NodeHAProxy HAProxy NodeNode
  • 38. datawire.io NodeNode Node 38 What will be the sequence of failures in the event of a large increase in traffic? * Example sequence: First the database maxes out, then RAM, then CPU, then file descriptors, then ELBs, then NICs Awareness of the likely failure sequence will help you be aware of your headroom and help build a plan for capacity growth Knowing your Chokepoint Sequence NodeNode NodeCassandra Cassandra Cassandra NodeHAProxy HAProxy NodeNode
  • 39. datawire.io NodeNode Node 39 What will be the sequence of failures in the event of a large increase in traffic? * Example sequence: First the database maxes out, then RAM, then CPU, then file descriptors, then ELBs, then NICs Awareness of the likely failure sequence will help you be aware of your headroom and help build a plan for capacity growth Knowing your Chokepoint Sequence NodeNode NodeCassandra Cassandra Cassandra NodeHAProxy HAProxy NodeNode NodeNode NodeNode
  • 40. datawire.io NodeNode Node 40 What will be the sequence of failures in the event of a large increase in traffic? * Example sequence: First the database maxes out, then RAM, then CPU, then file descriptors, then ELBs, then NICs Awareness of the likely failure sequence will help you be aware of your headroom and help build a plan for capacity growth Knowing your Chokepoint Sequence NodeNode NodeCassandra Cassandra Cassandra NodeHAProxy HAProxy NodeNode NodeNode NodeNode
  • 41. datawire.io 41 10. How will dependency failures be handled? Architecture
  • 43. datawire.io 43 Microservice architectures are a highly distributed system by their nature That means failures will occur, and on a frequent basis Dependency Failures
  • 44. datawire.io 44 Upstream and Downstream Dependencies Downstream Microservices Upstream Microservices Request Response Request Response
  • 45. datawire.io 45 Any microservice calling another must handle downstream failure, with: * Timeouts * Circuit breakers to prevent cascading failure * Backpressure * Default response values * Caching prior responses * Retries * Fallback to alternative endpoints Don’t assume that downstream failures manifest as dead endpoints * Services get sick more often than they die! Downstream Dependency Failure
  • 46. datawire.io 46 Understand what it means for the rest of the system when (not if) your service fails A non-critical service (e.g. a logging service invoked asynchronously over UDP) can fail without causing upstream disruption, at the expense of log data loss A critical synchronous service (e.g. a credit card payment service invoked over RPC) will require careful use by upstream components if transactions fail mid-stream Failing to Serve Upstream Dependencies
  • 48. datawire.io It’s free and OSS! https://github.com/datawire/datawire-connect We work in a public Slack channel - feel free to join to ask questions about microservices in general, or about our tech (link on the GitHub page) Watch the talks from our recent Microservices Practitioner Summit (speakers from Facebook, Netflix, Uber, Google, Yelp, New Relic…) on microservices.com And like every other organization in here, we’re hiring! 48 Trying Datawire Connect
  • 49. datawire.io 49 Thank you! Any questions? @brikelly bkelly@datawire.io