81
A Microservices Journey @christianposta

Microservices Journey NYC

  • Upload
    ceposta

  • View
    1.088

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Microservices Journey NYC

A Microservices Journey @christianposta

Page 2: Microservices Journey NYC

Christian Posta Principal Middleware Specialist/Architect

Twitter: @christianposta

Blog: http://blog.christianposta.com

Email: [email protected]

•  Author “Microservices for Java developers” •  Committer on Apache Camel, Apache

ActiveMQ, Fabric8, others •  Worked with large Microservices, web-scale,

unicorn company •  Blogger, speaker about DevOps, integration,

and microservices

Page 3: Microservices Journey NYC
Page 4: Microservices Journey NYC

Microservices Journey

•  Why?

•  Microservices Architectures

•  Cloud platforms with Kubernetes/OpenShift

•  Demos!

•  Concurrency, Transactions and Data! (time

permitting)

Q & A throughout!

Page 5: Microservices Journey NYC

If change is happening on the outside faster than on the inside the end is in sight.

Jack Welch, former CEO, GE

S&P company life expectancy

Page 6: Microservices Journey NYC

Fortune 500 firms in 1955 vs. 2014; 88% are gone

Page 7: Microservices Journey NYC
Page 8: Microservices Journey NYC

We need to innovate, not just keep up.

(Red Queen’s Race)

Page 9: Microservices Journey NYC

Source: Dave Gray, The Connected Company

Page 10: Microservices Journey NYC

Source: Dave Gray, The Connected Company

Page 11: Microservices Journey NYC

Post industrialism: Value delivered through services, not mass production of product.

Page 12: Microservices Journey NYC
Page 13: Microservices Journey NYC

To deliver services which provide value, we need to listen and react. We need to deal with variety.

Page 14: Microservices Journey NYC

Software is eating the world. Marc Andreesen

Page 15: Microservices Journey NYC

IT as a core competency; a driver of business value

Page 16: Microservices Journey NYC

How to drive innovation and deliver value:

•  Admit you don’t have all the answers; figure out how

to ask the right questions!

•  Feed back driven adaptation

•  Decentralized decision making

•  Purpose driven

Page 17: Microservices Journey NYC
Page 18: Microservices Journey NYC
Page 19: Microservices Journey NYC

Characteristics of complex, agile, systems

•  Small teams

•  Autonomy

•  Own their existence

•  Freedom + Responsibility

•  Purpose driven

•  Feedback/data driven

•  Simple rules, emergent results

Page 20: Microservices Journey NYC

PeopletrytocopyNet,lix,buttheycanonlycopywhattheysee.Theycopytheresults,nottheprocess.

Adrian Cockcroft, former Chief Cloud Architect, Netflix

Page 21: Microservices Journey NYC

“Let there be no more talk about DevOps unicorns or horses but only thoroughbreds and horses heading to the glue factory”

Dr. Branden Williams – business security specialist

Page 22: Microservices Journey NYC

Microservices Architectures

Page 23: Microservices Journey NYC

organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations

Melvin Conway

Page 24: Microservices Journey NYC

“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.”

Martin Fowler’s definition

Page 25: Microservices Journey NYC

“Microservices is an architectural approach, that emphasizes the decomposition of applications into single-purpose, loosely coupled services managed by cross-functional teams, for delivering and maintaining complex software systems with the velocity and quality required by today’s digital business”

Red Hat’s definition

Page 26: Microservices Journey NYC

Break things down (organizations, teams,

IT systems, etc) down into smaller pieces for

greater parallelization and autonomy and

focus on reducing time to value.

Page 27: Microservices Journey NYC

•  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

What benefits of breaking this down?

Page 28: Microservices Journey NYC

Microservices is about optimizing … for speed.

Page 29: Microservices Journey NYC

Quick example

Page 30: Microservices Journey NYC

http://www.jboss.org/ticket-monster/

Page 31: Microservices Journey NYC
Page 32: Microservices Journey NYC
Page 33: Microservices Journey NYC

@christianposta

blog.christianposta.com

github.com/christian-posta

Page 34: Microservices Journey NYC

Microservices is about optimizing … for speed.

Page 35: Microservices Journey NYC

Howdoyougofast?

Page 36: Microservices Journey NYC

Manythingstoconsider:contracts,versioning,

forward/backwardcompatibility,continuous

integration,continuousdelivery,self-service

automation,monitoring,feedbackloops,

logging,chaostesting,self-healing

infrastructure,A/Btesting,data,

andmanyothers….

Page 37: Microservices Journey NYC

Sheddependencies!

Page 38: Microservices Journey NYC

Howtosheddependencies?

Page 39: Microservices Journey NYC

Shedding dependencies

•  Team self service

•  Organize teams around a service

•  Teams own entire lifecycle (build, test, deploy, debug,

operate, maintain; you build it you run it)

•  Teams communicate via APIs (or you’re fired!)

•  Services own their own data

•  Boundaries establish a “bounded context”

•  Services communicate via promises

•  Make contracts explicit: contract evolution as a first-

class citizen

Page 40: Microservices Journey NYC
Page 41: Microservices Journey NYC

Butwestillhavedependenciesonotherservices!

Page 42: Microservices Journey NYC

Weneedboundaries

Page 43: Microservices Journey NYC

Book checkout / purchase Title Search

Recommendations

Weekly reporting

Page 44: Microservices Journey NYC

Domain Complexity

•  Break things into smaller, understandable models

•  Surround a model and its “context” with a boundary

•  Implement the model in code or get a new model

•  Explicitly map between different contexts

•  Model transactional boundaries as aggregates

Page 45: Microservices Journey NYC
Page 46: Microservices Journey NYC

Servicesandteamsmakepromises

Page 47: Microservices Journey NYC

Services make promises

•  Health checking

•  Autoscaling

•  Self healing

•  Circuit breakers

•  Bulkheading

•  Throttling/rate limiting

•  Fallbacks

•  Apologies

Page 48: Microservices Journey NYC

Services make promises

Page 49: Microservices Journey NYC

Consumercontracts?

Page 50: Microservices Journey NYC

Consumercontracts?

Page 51: Microservices Journey NYC

Consumercontracts?

{ "request" : { "url" : "/user/ceposta", "method" : ”GET” }, "response" : { "status" : 200, "body" : ([

“first”: “christian” “last”: 'posta' “twitter”: '@christianposta' ]),

"headers" : { "X-Application-Context" : "application:-1", "Content-Type" : "text/plain" } } }

Page 52: Microservices Journey NYC

Consumerdrivencontracts!

Page 53: Microservices Journey NYC
Page 54: Microservices Journey NYC

Do we need integration?

•  REST, RPC

•  Streams/Events(ActiveMQ, JMS, AMQP, STOMP, Kafka, etc)

•  Legacy (SOAP, mainframe, file processing, proprietary)

•  Managed file processing

•  Streaming

•  Message transformation

•  EIPs

Page 55: Microservices Journey NYC

•  Automatic retries, back-off algorithms

•  Dynamic routing

•  Powerful testing/mocking framework

•  Circuit breakers, fallbacks

•  Idempotent consumers

•  Backpressure mechanisms

•  Beautiful REST DSL with built in Swagger support

Apache Camel for resilient Microservices

Page 56: Microservices Journey NYC
Page 57: Microservices Journey NYC

•  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?

Page 58: Microservices Journey NYC

•  Maybe it doesn’t matter so much… What we really care about is speed, reduced time to value, and business outcomes.

•  Maybe a data-driven approach is a better way to answer this question...

Are you doing microservices?

Page 59: Microservices Journey NYC

•  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!

Are you doing microservices?

Page 60: Microservices Journey NYC

Are there any drawbacks?

Page 61: Microservices Journey NYC

•  System complexity

•  Operational complexity

•  Testing is harder across services

•  Security

•  Hard to get boundaries right (transactions, etc)

•  Resource overhead

•  Network overhead

•  Lack of tooling

Drawbacks to microservices

Page 62: Microservices Journey NYC

Microservices for Java Developers

Page 63: Microservices Journey NYC
Page 64: Microservices Journey NYC

•  Simple configuration

•  Curated dependencies and

transitive dependencies

•  Built in metrics, monitoring

•  Slim profile for deployment

(…micro even?)

#microprofile

Page 65: Microservices Journey NYC

Docker

Page 66: Microservices Journey NYC

•  Distributed configuration

•  Service Discovery

•  Loadbalancing

•  Circuit Breakers

•  Bulkheading

•  Versioning/Routing

•  Based on AWS

Page 67: Microservices Journey NYC

What about non-java?

Page 68: Microservices Journey NYC

Kubernetes

Page 69: Microservices Journey NYC

Container cluster management

•  Distributed configuration

•  Service Discovery

•  Loadbalancing

•  Versioning/Routing

•  Deployments

•  Scaling/Autoscaling

•  Liveness/Health checking

•  Self healing

Page 70: Microservices Journey NYC

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

OpenShift is Kubernetes

Page 71: Microservices Journey NYC

Kubernetes is declarative microservices infrastructure.

Page 72: Microservices Journey NYC

Elasticity, resiliency, self healing

Page 73: Microservices Journey NYC

Service discovery

Page 74: Microservices Journey NYC
Page 75: Microservices Journey NYC
Page 76: Microservices Journey NYC
Page 77: Microservices Journey NYC
Page 78: Microservices Journey NYC

What about client-side load balancing? Eg, Ribbon, Zuul, etc

Page 79: Microservices Journey NYC
Page 80: Microservices Journey NYC
Page 81: Microservices Journey NYC

Twitter: @christianposta

Blog: http://blog.christianposta.com

Email: [email protected]

Thanks!

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

http://openshift.com http://kubernetes.io http://fabric8.io http://events.linuxfoundation.org/events/kubecon http://camel.apache.org