A Microservices Journey
@christianposta
Christian Posta
Chief 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 on Apache Camel, Apache
ActiveMQ, Fabric8, others
• Worked with large Microservices, web-scale,
unicorn company
• Blogger, speaker about DevOps, integration,
and microservices
Stay with me here…
• Why? What is this all about
• Microservices architectures
• Platform
• Boundaries
• Distributed systems
• APIs
• Microservices patterns
@christianposta
@christianposta
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
@christianposta
Fortune 500 firms in 1955 vs. 2014;
88% are gone
@christianposta
“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
@christianposta
Keeping up is not enough anymore.
@christianposta
What does it mean to innovate?
@christianposta
“Innovation is admitting we don’t
have all the answers”
Mark Schwartz – CIO USCIS
@christianposta
have a purpose
figure out the right questions to ask
learn from the answers
iteratively repeat, toward the purpose
@christianposta
“If I invest $5-$10M in your company and
you fail, I have 30 other investments.
It’s just a footnote in my investment history.”
https://medium.com/@mattklein123/optimizing-impact-why-i-will-not-start-an-envoy-platform-company-8904286658cb
https://barryoreilly.com/2017/04/06/optimize-to-be-wrong-not-right/
We need to build a learning
organization.
@christianposta
organizations which design systems ...
are constrained to produce designs which
are copies of the communication structures
of these organizations
Melvin Conway
Not so fast…
@christianposta
Source: Dave Gray, The Connected Company
@christianposta
Source: Dave Gray, The Connected Company
@christianposta
Meanwhile…
@christianposta
Software has eaten the world…
https://venturebeat.com/2017/04/03/technology-has-eaten-the-world/@christianposta
@christianposta
IT as a core competency;
a driver of business value
@christianposta
We need to build a learning organization
capable of using software as a differentiator
@christianposta
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
@christianposta
Microservices architectures
• 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?
@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
Purpose: building a learning
organization with microservices
• Organize teams around aligned concerns
• Teams own entire lifecycle (build, test, deploy,
debug, operate, maintain; you build it you run it)
• Platform teams for Service teams
• Small, more frequent service releases
• Mature delivery capabilities
• Mature observability capabilities
• Reduce the cost of running experiments so you
can run more of them!
@christianposta
Microservices is how we learn to split our
work into parallelizable units to
run more experiments and ultimately
reduce our time to deliver value.
@christianposta
Microservices is about optimizing… for speed.
@christianposta
Should you break up your monolith?
@christianposta
How do you go fast?
@christianposta
@christianposta
Platform
Applications run in Linux
Containers
@christianposta
Kubernetes
@christianposta
Cluster management
• Distributed configuration
• Service Discovery
• Loadbalancing
• Versioning/Routing
• Deployments
• Scaling/Autoscaling
• Liveness/Health checking
• Self healing
• Logging, Metrics, Tracing
@christianposta
• 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
@christianposta
@christianposta
@christianposta
@christianposta
Boundaries
(aka, “how big is a microservice”)
@christianposta
Book checkout / purchase Title Search
Recommendations
Weekly reporting
@christianposta
@christianposta
• 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
Focus on domain models, not data models
@christianposta
@christianposta
@christianposta
@christianposta
We’re building a distributed system
(a developer’s perspective)
@christianposta
• Security
• Integration of services
• System Resilience
• Making changes
• Data consistency
• Monolith evolution
• Reliable delivery of services to production
The hardest parts of microservices
@christianposta
@christianposta
• Simple configuration
• Curated dependencies and transitive
dependencies
• Built in metrics, monitoring
• Slim profile for deployment
• Strong communities (spring, vert.x,
microprofile.io)
OpenShift Application Runtimes
@christianposta
OpenShift Application Runtimes
Service Integration
@christianposta
Do we need integration?
• REST, RPC
• Streams/Events(ActiveMQ, JMS, AMQP, STOMP, Kafka,
etc)
• Legacy (SOAP, mainframe, file processing, proprietary)
• Routing, Aggregation, Splitting, Transactions,
Compensations, Filtering, etc.
@christianposta
Real developers ride camels!
@christianposta
• Small Java library
• 200+ components for integrating systems (bring along only
the ones you use)
• Powerful EIPs (routing, transformation, error handling)
• Distributed-systems swiss-army knife!
• Declarative DSL
• Embeddable into any JVM (EAP, Karaf, Tomcat, Spring
Boot, Dropwizard, Wildfly Swarm, no container, etc)
Apache Camel
@christianposta
@christianposta
public class OrderProcessorRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
rest().post(“/order/socks”)
.description(“New Order for pair of socks”)
.consumes(“application/json”)
.route()
.to(“activemq:topic:newOrder”)
.log(“received new order ${body.orderId}”)
.to(“ibatis:storeOrder?statementType=Insert”);
}
Camel REST DSL
@christianposta
What about our services APIs?
• Publish APIs externally and between organizations
• Documentation portal
• Rate limiting and policies
• Security and authentication
• Lifecycle management
• Provisioning & alerting
• Metering and billing
• Testing
Scaling with APIs…
@christianposta
Mono+Micro with API Gateway
@christianposta
@christianposta
@christianposta
Microservices patterns
• Distributed configuration
• Service Discovery
• Loadbalancing
• Circuit Breakers
• Bulkheading
• Versioning/Routing
• Based on AWS
“Microservices” patterns
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
What if you’re already using
things like Spring Cloud and/or
Netflix OSS?!
@christianposta
spring-cloud-kubernetes
• DiscoveryClient
• Ribbon integration
• Actuator/Health integrations
• Hystrix/Turbine Dashboard integrations
(kubeflix)
• Zipkin Tracing
• Configuration via ConfigMaps
• Archaius Bridge for dynamic configs
https://github.com/spring-cloud-incubator/spring-cloud-kubernetes
What’s next!?
http://blog.christianposta.com
http://blog.openshift.com
http://developers.redhat.com/blog
@christianposta
What’s next!?
http://blog.christianposta.com
http://blog.openshift.com
http://developers.redhat.com/blog
@christianposta
• 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
Are you doing microservices?
@christianposta
• 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!
• CI/CD
• Event-driven architectures
• Automated testing (integration, system, contract)
• Service architecture observability
• Intra-service routing, policy control
• Security
• Developer tooling
• Chaos engineering
Things we should dig into deeper
next time we meet!
@christianposta
Thanks!
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/ceposta

Microservices Journey Summer 2017

  • 1.
  • 3.
    Christian Posta Chief 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 on Apache Camel, Apache ActiveMQ, Fabric8, others • Worked with large Microservices, web-scale, unicorn company • Blogger, speaker about DevOps, integration, and microservices
  • 5.
    Stay with mehere… • Why? What is this all about • Microservices architectures • Platform • Boundaries • Distributed systems • APIs • Microservices patterns @christianposta
  • 6.
  • 7.
    If change ishappening on the outside faster than on the inside the end is in sight. Jack Welch, former CEO, GE S&P company life expectancy @christianposta
  • 8.
    Fortune 500 firmsin 1955 vs. 2014; 88% are gone @christianposta
  • 10.
    “Let there beno more talk about DevOps unicorns or horses but only thoroughbreds and horses heading to the glue factory” Dr. Branden Williams – business security specialist @christianposta
  • 11.
    Keeping up isnot enough anymore. @christianposta
  • 12.
    What does itmean to innovate? @christianposta
  • 13.
    “Innovation is admittingwe don’t have all the answers” Mark Schwartz – CIO USCIS @christianposta
  • 14.
    have a purpose figureout the right questions to ask learn from the answers iteratively repeat, toward the purpose @christianposta
  • 15.
    “If I invest$5-$10M in your company and you fail, I have 30 other investments. It’s just a footnote in my investment history.” https://medium.com/@mattklein123/optimizing-impact-why-i-will-not-start-an-envoy-platform-company-8904286658cb https://barryoreilly.com/2017/04/06/optimize-to-be-wrong-not-right/
  • 16.
    We need tobuild a learning organization. @christianposta
  • 17.
    organizations which designsystems ... are constrained to produce designs which are copies of the communication structures of these organizations Melvin Conway Not so fast… @christianposta
  • 18.
    Source: Dave Gray,The Connected Company @christianposta
  • 19.
    Source: Dave Gray,The Connected Company @christianposta
  • 20.
  • 21.
    Software has eatenthe world… https://venturebeat.com/2017/04/03/technology-has-eaten-the-world/@christianposta
  • 22.
  • 23.
    IT as acore competency; a driver of business value @christianposta
  • 24.
    We need tobuild a learning organization capable of using software as a differentiator @christianposta
  • 25.
    People try tocopy Netflix, but they can only copy what they see. They copy the results, not the process. Adrian Cockcroft, former Chief Cloud Architect, Netflix @christianposta
  • 26.
  • 27.
    • 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? @christianposta
  • 28.
    • 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
  • 29.
    Purpose: building alearning organization with microservices • Organize teams around aligned concerns • Teams own entire lifecycle (build, test, deploy, debug, operate, maintain; you build it you run it) • Platform teams for Service teams • Small, more frequent service releases • Mature delivery capabilities • Mature observability capabilities • Reduce the cost of running experiments so you can run more of them! @christianposta
  • 30.
    Microservices is howwe learn to split our work into parallelizable units to run more experiments and ultimately reduce our time to deliver value. @christianposta
  • 31.
    Microservices is aboutoptimizing… for speed. @christianposta
  • 32.
    Should you breakup your monolith? @christianposta
  • 34.
    How do yougo fast? @christianposta
  • 35.
  • 36.
  • 37.
    Applications run inLinux Containers @christianposta
  • 38.
  • 39.
    Cluster management • Distributedconfiguration • Service Discovery • Loadbalancing • Versioning/Routing • Deployments • Scaling/Autoscaling • Liveness/Health checking • Self healing • Logging, Metrics, Tracing @christianposta
  • 40.
    • Team selfservice 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 @christianposta
  • 41.
  • 42.
  • 43.
  • 44.
    Boundaries (aka, “how bigis a microservice”)
  • 46.
  • 47.
    Book checkout /purchase Title Search Recommendations Weekly reporting @christianposta
  • 48.
  • 49.
    • Break thingsinto 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 Focus on domain models, not data models @christianposta
  • 50.
  • 51.
  • 52.
  • 53.
    We’re building adistributed system (a developer’s perspective)
  • 54.
  • 55.
    • Security • Integrationof services • System Resilience • Making changes • Data consistency • Monolith evolution • Reliable delivery of services to production The hardest parts of microservices @christianposta
  • 56.
    @christianposta • Simple configuration •Curated dependencies and transitive dependencies • Built in metrics, monitoring • Slim profile for deployment • Strong communities (spring, vert.x, microprofile.io) OpenShift Application Runtimes
  • 57.
  • 58.
  • 59.
    Do we needintegration? • REST, RPC • Streams/Events(ActiveMQ, JMS, AMQP, STOMP, Kafka, etc) • Legacy (SOAP, mainframe, file processing, proprietary) • Routing, Aggregation, Splitting, Transactions, Compensations, Filtering, etc. @christianposta
  • 60.
    Real developers ridecamels! @christianposta
  • 61.
    • Small Javalibrary • 200+ components for integrating systems (bring along only the ones you use) • Powerful EIPs (routing, transformation, error handling) • Distributed-systems swiss-army knife! • Declarative DSL • Embeddable into any JVM (EAP, Karaf, Tomcat, Spring Boot, Dropwizard, Wildfly Swarm, no container, etc) Apache Camel @christianposta
  • 62.
  • 63.
    public class OrderProcessorRouteBuilderextends RouteBuilder { @Override public void configure() throws Exception { rest().post(“/order/socks”) .description(“New Order for pair of socks”) .consumes(“application/json”) .route() .to(“activemq:topic:newOrder”) .log(“received new order ${body.orderId}”) .to(“ibatis:storeOrder?statementType=Insert”); } Camel REST DSL @christianposta
  • 64.
    What about ourservices APIs?
  • 65.
    • Publish APIsexternally and between organizations • Documentation portal • Rate limiting and policies • Security and authentication • Lifecycle management • Provisioning & alerting • Metering and billing • Testing Scaling with APIs… @christianposta
  • 66.
    Mono+Micro with APIGateway @christianposta
  • 67.
  • 68.
  • 69.
  • 70.
    • Distributed configuration •Service Discovery • Loadbalancing • Circuit Breakers • Bulkheading • Versioning/Routing • Based on AWS “Microservices” patterns What about non-java? @christianposta
  • 71.
    Cluster management • Distributedconfiguration • Service Discovery • Loadbalancing • Versioning/Routing • Deployments • Scaling/Autoscaling • Liveness/Health checking • Self healing • Logging, Metrics, Tracing @christianposta
  • 72.
    What if you’realready using things like Spring Cloud and/or Netflix OSS?! @christianposta
  • 73.
    spring-cloud-kubernetes • DiscoveryClient • Ribbonintegration • Actuator/Health integrations • Hystrix/Turbine Dashboard integrations (kubeflix) • Zipkin Tracing • Configuration via ConfigMaps • Archaius Bridge for dynamic configs https://github.com/spring-cloud-incubator/spring-cloud-kubernetes
  • 74.
  • 75.
  • 76.
    • Have self-serviceinfrastructure 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 Are you doing microservices? @christianposta
  • 77.
    • Number offeatures 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!
  • 78.
    • CI/CD • Event-drivenarchitectures • Automated testing (integration, system, contract) • Service architecture observability • Intra-service routing, policy control • Security • Developer tooling • Chaos engineering Things we should dig into deeper next time we meet! @christianposta
  • 79.
    Thanks! BTW: Hand drawndiagrams made with Paper by FiftyThree.com @christianposta Twitter: @christianposta Blog: http://blog.christianposta.com Email: christian@redhat.com Slides: http://slideshare.net/ceposta