containers and APIs: what’s next? Microservices with ... · DON’T optimize for microservices...

Post on 27-May-2020

6 views 0 download

Transcript of containers and APIs: what’s next? Microservices with ... · DON’T optimize for microservices...

Microservices with integration, containers and APIs: what’s next?

@christianposta

Christian PostaChief Architect, cloud application development

Twitter: @christianposta

Blog: http://blog.christianposta.com

Email: christian@redhat.com

Slides: http://slideshare.net/ceposta• Author “Microservices for Java developers”

• Committer/contributor lots of open-source projects

• Worked with large Microservices, web-scale, unicorn

company

• Blogger, speaker

Microservices:What, Why, When

@christianposta

“The microservice architectural style is an

approach to developing a single application as a

suite of small services, each running in its own process and communicating with lightweight

mechanisms, often an HTTP resource API. These

services are built around business capabilities and independently deployable by fully automated deployment machinery.”

A microservices definition

• Single, self-contained, autonomous

• Isolated and Resilient to faults

• Faster software delivery

• Own their own data

• Easier to understand individually

• Scalability

• Right technology for the problem

• Test individual services

• Individual deployments

Microservices: a re-org around APIs as product

@christianposta

• System complexity• Operational complexity• Testing is harder across services• Security • Hard to get boundaries right (transactions, APIs,

etc)• Resource overhead• Network overhead• Lack of tooling

Drawbacks to microservices?

@christianposta

Why would one implement a systemas microservices?

@christianposta

Pain we may feel…

@christianposta

• Making changes in one place negatively affects unrelated

areas

• Low confidence making changes that don’t break things

• Spend lots of time trying to coordinate work between

team members

• Structure in the application has eroded or is non-existant

• We have no way to quantify how long code merges will

take

@christianposta

• Development time is slow simply because the project is so

big (IDE bogs down, running tests is slow, slow bootstrap

time, etc)

• Changes to one module force changes across other

modules

• Difficult to sunset outdated technology

• We’ve built our new applications around old premises like

batch processing

• Application steps on itself at runtime managing resources,

allocations, computations

Pain we may feel…

Microservices is about optimizing for speed.

@christianposta

So do we microservices all the way down?

@christianposta

@christianposta http://blog.gardeviance.org/2012/06/pioneers-settlers-and-town-planners.html

@christianposta

Lean Enterprise: http://shop.oreilly.com/product/0636920030355.do

@christianposta

MVP tests, experiments, small apps(co-locate if you have to write an app)

Product development, initial scale(co-locate perfectly okay!!

Microservices? possibly…)

Starting to feel the weight of maintenance, need to shoot for efficiencies, integrate new approaches to increase revenue(microservices land)

http://blog.gardeviance.org/2012/06/pioneers-settlers-and-town-planners.html

DON’T optimize for microservices if…

@christianposta

• You’re building a Minimum Viable Product (MVP), testing a

hypothesis

• You’re building a CRUD application

• Your application is simple

• Your system doesn’t have > 10 people all trying to coordinate to

work on it

• Your application doesn’t need to scale

• You deliver packaged software

• You’re building HPC systems

Making “high performance” economical

@christianposta

We can now assert with confidence that high IT performance correlates with strong business performance, helping to boost productivity, profitability and market share.

@christianposta

https://puppet.com/resources/whitepaper/2014-state-devops-report

High performing IT teams

@christianposta

• …are encouraged to experiment

• …learn from failure

• …work in small batches

• …deliver to production many times a week

• ...have a lower change failure rate

• …focus on getting continuous feedback

• …are held to outcomes, not output

• …continuously prioritize and reprioritize based on cost

of delay (http://blackswanfarming.com/cost-of-delay/)

High performing IT teams need these IT capabilities and practices

@christianposta

• Continuous Integration/Delivery

• Safe, reliable delivery mechanisms

• Low-risk deployment vs release processes

• Modern, scalable, resilient application architectures

• Self-service, on-demand infrastructure

• Automated testing

• Metrics, logs, traces, observability

• Feedback loops

• Security as part of the pipeline

@christianposta

https://www.infoq.com/articles/cloud-native-panel

"Cloud native” describes applications, architectures, platforms/infrastructure, and processes, that together make it economical to work in small batches to learnand reduce uncertainty.

• Distributed configuration

• Service Discovery

• Loadbalancing

• Circuit Breakers

• Bulkheading

• Versioning/Routing

• Based on AWS

“Microservices” platform

What about non-java?

@christianposta

Cluster management• Distributed configuration

• Service Discovery

• Loadbalancing

• Versioning/Routing

• Deployments

• Scaling/Autoscaling

• Liveness/Health checking

• Self healing

• Logging, Metrics, Tracing@christianposta

@christianposta

• Team self service application deployment• Developer workflow• Enterprise focused (LDAP, RBAC, Oauth, etc)• Integrated Docker registry• Jenkins Pipeline (CI/CD) out of the box• Build/deployment triggers• Software Defined Networking (SDN)• Docker native format/packaging• CLI/IDE/Web based tooling

OpenShift is a Kubernetes distribution

@christianposta

Balancing speed and reliability:resilience, control, observability

@christianposta

@christianposta

Integration, containers, APIs == distributed systems

@christianposta

@christianpostahttp://bit.ly/application-networking

@christianpostahttp://bit.ly/application-networking

@christianpostahttp://bit.ly/application-networking

@christianpostahttp://bit.ly/application-networking

@christianpostahttp://bit.ly/application-networking

Integration sucks! Just do REST/HTTP?

@christianposta

@christianpostahttp://bit.ly/application-networking

• Netflix Hystrix (circuit breaking / bulk heading)

• Netflix Zuul (edge router)

• Netflix Ribbon (client-side service discovery / load balance)

• Netflix Eureka (service discovery registry)

• Brave / Zipkin (tracing)

• Netflix spectator / atlas (metrics)

“Microservices” patterns

@christianposta

@christianpostahttp://bit.ly/application-networking

But I’m using Spring! • spring-cloud-netflix-hystrix• spring-cloud-netflix-zuul• spring-cloud-netflix-eureka-client• spring-cloud-netflix-ribbon• spring-cloud-netflix-atlas• spring-cloud-netflix-spectator• spring-cloud-netflix-hystrix-stream• …..• ......• @Enable....150differentThings

But I’m using Vert.x!• vertx-circuit-breaker

• vertx-service-discovery

• vertx-dropwizard-metrics

• vertx-zipkin?

• …..

• ......

Things you must solve for because… distributed systems

• Service discovery

• Retries

• Timeouts

• Load balancing

• Rate limiting

• Thread bulk heading

• Circuit breaking

• adaptive routing

• Deadlines

• Back pressure

• Outlier detection

• Health checking

• Traffic shaping

• Request shadowing

• Edge/DMZ routing

• Surgical / fine /

per-request routing

• A/B rollout

• dark launches

• Fault injection

• Stats, metric, collection

• Observability

@christianpostahttps://lyft.github.io/envoy/

Meet Envoy Proxy

Meet Istio Service Mesh

https://istio.io

Demo Architecture

https://istio.io/docs/samples/bookinfo.html

• Have self-service infrastructure automation?

• Have self-service application automation?

• Have working CI/CD?

• Have health checking, monitoring, instrumentation?

• Have logging, distributed tracing?

• Able to release services independently?

• Honoring backward and forward compatibility?

Are you doing microservices?

@christianposta

• Number of features accepted

• % of features completed• User satisfaction• Feature Cycle time• defects discovered after

deployment• customer lifetime value • revenue per feature

Focus on going fast and learning• mean time to recovery• % improvement in SLA• number of changes• number of user complaints,

recommendations, suggestions• % favorable rating in surveys• % of users using which features• % reduction in error rates• avg number of tx / user• MANY MORE!

• The hardest part of microservices? Your datahttps://developers.redhat.com/blog/2016/08/02/the-hardest-part-about-microservices-your-data/

• Microservices patterns: circuit breaking with Envoy Proxyhttps://developers.redhat.com/blog/2017/05/31/microservices-patterns-with-envoy-sidecar-proxy-part-i-circuit-breaking/

• Monolith to microservices Part Ihttps://developers.redhat.com/blog/2017/09/26/low-risk-monolith-microservice-evolution-part/

• Monolith to microservices Part IIhttps://developers.redhat.com/blog/2017/10/23/low-risk-monolith-microservice-evolution-part-ii/

More material

@christianposta

Quick demo?

BTW: Hand drawn diagrams made with Paper by FiftyThree.com ☺@christianposta

Twitter: @christianposta

Blog: http://blog.christianposta.com

Email: christian@redhat.com

Slides: http://slideshare.net/cepostaFollow up links:• http://openshift.io• http://launch.openshift.io• http://blog.openshift.com• http://developers.redhat.com/blog• https://www.redhat.com/en/open-innovation-labs• https://www.redhat.com/en/technologies/jboss-middleware/3scale• https://www.redhat.com/en/technologies/jboss-middleware/fuse