49
Microservices: key factor in integration, containers and APIs @christianposta

Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Microservices: key factor in integration, containers and APIs

@christianposta

Page 2: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Christian Posta Chief Architect, cloud application development

Twitter: @christianposta

Blog: http://blog.christianposta.com

Email: [email protected]

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 about DevOps, integration,

and microservices

Page 3: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Microserivces: What, Why, When

@christianposta

Page 4: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

“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

Page 5: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

•  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

Page 6: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

•  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

Page 7: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Why would one implement a system as microservices?

@christianposta

Page 8: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

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

Page 9: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@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…

Page 10: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Microservices is about optimizing for speed.

@christianposta

Page 11: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

So do we microservices all the way down?

@christianposta

Page 12: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

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

Page 13: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta

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

Page 14: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta

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

Product development, initial scale (co-locate perfectly okay!! Microserices? 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

Page 15: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

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

Page 16: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Making “high performance” economical

@christianposta

Page 17: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

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

Page 18: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

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/)

Page 19: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

High performing IT teams need these IT capabilities and practices

@christianposta

•  Continuous Integration (build from master) •  Continuous Delivery (automated pipelines) •  Safe, reliable delivery mechanisms •  Modern, scalable, resilient application architectures •  Self-service, on-demand infrastructure •  Automated testing •  Metrics, logs, traces, observability •  Feedback loops •  Security as part of the pipeline

Page 20: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@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 learn and reduce uncertainty.

Page 21: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

•  Distributed configuration

•  Service Discovery

•  Loadbalancing

•  Circuit Breakers

•  Bulkheading

•  Versioning/Routing

•  Based on AWS

“Microservices” platform

What about non-java?

@christianposta

Page 22: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Cluster management

•  Distributed configuration

•  Service Discovery

•  Loadbalancing

•  Versioning/Routing

•  Deployments

•  Scaling/Autoscaling

•  Liveness/Health checking

•  Self healing

•  Logging, Metrics, Tracing

@christianposta

Page 23: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta

Page 24: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

•  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

Page 25: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Balancing speed and reliability: resilience, control, observability

@christianposta

Page 26: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta

Integration, containers, APIs == distributed systems

Page 27: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta

Page 28: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta http://bit.ly/application-networking

Page 29: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta http://bit.ly/application-networking

Page 30: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta http://bit.ly/application-networking

Page 31: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta http://bit.ly/application-networking

Page 32: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta http://bit.ly/application-networking

Page 33: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta http://bit.ly/application-networking

Page 34: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

•  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

Page 35: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta http://bit.ly/application-networking

Page 36: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

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

Page 37: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

But I’m using Vert.x!

•  vertx-circuit-breaker

•  vertx-service-discovery

•  vertx-dropwizard-metrics

•  vertx-zipkin?

•  …..

•  ......

Page 38: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

ButI’musingNodeJS!

ButI’musingGo!

ButI’musingPython!

Page 39: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Getthepoint?

Page 40: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

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

•  Internal releases / dark

launches

•  Fault injection

•  Stats, metric, collection

•  Observability

Page 41: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

@christianposta https://lyft.github.io/envoy/

Meet Envoy Proxy

Page 42: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Sidecarpattern

Page 43: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,
Page 44: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Meet Istio Service Mesh

https://istio.io

Page 45: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Demo Architecture

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

Page 46: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

•  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

Page 47: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

•  Number of features accepted •  % of features completed •  User satisfaction •  Feature Cycle time •  defects discovered after deployment •  customer lifetime value (future profit as a result of relationship with the

customer) https://en.wikipedia.org/wiki/Customer_lifetime_value •  revenue per feature •  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!

Focus on going fast and learning

Page 48: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

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

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

part-i-circuit-breaking/

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

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

More material

@christianposta

Page 49: Microservices: key factor in integration, containers and APIs · • You’re building a Minimum Viable Product (MVP), testing a hypothesis ... "Cloud native” describes applications,

Quick demo?

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

Twitter: @christianposta

Blog: http://blog.christianposta.com

Email: [email protected]

Slides: http://slideshare.net/ceposta

Follow 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