a microservice journey

71
A Microservices Journey @christianposta

Upload: ceposta

Post on 12-Jan-2017

653 views

Category:

Software


1 download

TRANSCRIPT

Page 1: A Microservice Journey

A Microservices Journey@christianposta

Page 2: A Microservice Journey
Page 3: A Microservice Journey

Christian PostaPrincipal Middleware Specialist/Architect

Twitter: @christianpostaBlog: http://blog.christianposta.comEmail: [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 4: A Microservice Journey
Page 5: A Microservice Journey

Microservices Journey• Why? • Microservices Architectures• Cloud platforms with Kubernetes/OpenShift• Q & A

Page 6: A Microservice Journey

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 7: A Microservice Journey

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

Page 8: A Microservice Journey

We need to innovate, not just keep up.(Red Queen’s Race)

Page 9: A Microservice Journey

Source: Dave Gray, The Connected Company

Page 10: A Microservice Journey

Source: Dave Gray, The Connected Company

Page 11: A Microservice Journey

Value delivered through services, not mass production of product.

Page 12: A Microservice Journey
Page 13: A Microservice Journey

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

Page 14: A Microservice Journey

Software is eating the world.Marc Andreesen

Page 15: A Microservice Journey

IT as a core competency; a driverof business value

Page 16: A Microservice Journey

How to drive innovation and delivervalue through IT:• Decentralized decision making• Purpose driven• Innovation: Admit you don’t have all the

answers; figure out how to ask the right questions!

Page 17: A Microservice Journey
Page 18: A Microservice Journey
Page 19: A Microservice Journey

Characteristics of agile systems

• Small teams• Autonomy• Own their existence• Freedom + Responsibility• Purpose driven• Feedback/data driven• Simple rules, emergent results

Page 20: A Microservice Journey

People try to copy Netflix, but they can only copy what they see. They copy the results, not the process.

Adrian Cockcroft, former Chief Cloud Architect, Netflix

Page 21: A Microservice Journey

“Let there be no more talk about DevOpsunicorns or horses but only thoroughbredsand horses heading to the glue factory”

Dr. Branden Williams – business security specialist

Page 22: A Microservice Journey

Microservices Architectures

Page 23: A Microservice Journey

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

Melvin Conway

Page 24: A Microservice Journey

“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: A Microservice Journey

“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: A Microservice Journey

Break things down (organizations, teams, IT systems, etc) down into smaller pieces for greater parallelization and focus on reducing time to value.

Page 27: A Microservice Journey

• 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: A Microservice Journey

Microservices is about optimizing… for speed.

Page 29: A Microservice Journey

Quick example

Page 30: A Microservice Journey

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

Page 31: A Microservice Journey
Page 32: A Microservice Journey
Page 33: A Microservice Journey

Microservices is about optimizing… for speed.

Page 34: A Microservice Journey

How do you go fast?

Page 35: A Microservice Journey

Shed dependencies!

Page 36: A Microservice Journey

How to shed dependencies?

Page 37: A Microservice Journey

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 38: A Microservice Journey
Page 39: A Microservice Journey

But we still have dependencies on other services!

Page 40: A Microservice Journey

We need boundaries

Page 41: A Microservice Journey
Page 42: A Microservice Journey

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 43: A Microservice Journey

Services and teams make promises

Page 44: A Microservice Journey

Services make promises

• Health checking

• Autoscaling

• Self healing

• Circuit breakers

• Bulkheading

• Throttling/rate limiting

• Fallbacks

• Apologies

Page 45: A Microservice Journey

Services make promises

Page 46: A Microservice Journey

Consumer contracts?

Page 47: A Microservice Journey

Consumer contracts?

Page 48: A Microservice Journey

Consumer contracts?

{ "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 49: A Microservice Journey
Page 50: A Microservice Journey

• 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 51: A Microservice Journey

• 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 52: A Microservice Journey

• 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 53: A Microservice Journey

Are there any drawbacks?

Page 54: A Microservice Journey

• 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 55: A Microservice Journey

Microservices for Java Developers

Page 56: A Microservice Journey
Page 57: A Microservice Journey

• Simple configuration

• Curated dependencies and

transitive dependencies

• Built in metrics, monitoring

• Slim profile for deployment

(…micro even?)

#microprofile

Page 58: A Microservice Journey

Docker

Page 59: A Microservice Journey

• Distributed configuration

• Service Discovery

• Loadbalancing

• Circuit Breakers

• Bulkheading

• Versioning/Routing

• Based on AWS

Page 60: A Microservice Journey

What about non-java?

Page 61: A Microservice Journey

Kubernetes

Page 62: A Microservice Journey

Container cluster management

• Distributed configuration

• Service Discovery

• Loadbalancing

• Versioning/Routing

• Deployments

• Scaling/Autoscaling

• Liveness/Health checking

• Self healing

Page 63: A Microservice Journey

• 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 64: A Microservice Journey

• Elasticity, resiliency, self-healing, autoscaling

• Service discovery, load balancing, failover

• Logging, monitoring, tracing• Configuration• Testing• Delivery

Declarative microservices

Page 65: A Microservice Journey
Page 66: A Microservice Journey
Page 67: A Microservice Journey
Page 68: A Microservice Journey
Page 69: A Microservice Journey
Page 70: A Microservice Journey
Page 71: A Microservice Journey

Twitter: @christianposta

Blog: http://blog.christianposta.com

Email: [email protected]

Thanks!

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

http://fabric8.iohttp://kubernetes.iohttp://openshift.comhttp://events.linuxfoundation.org/events/kubeconhttps://github.com/pact-foundationhttp://camel.apache.org