Microservices stress-free and without increased heart-attack risk

Similar documents
Patterns of Resilience How to build robust, scalable & responsive systems

Cloud Native Architecture 300. Copyright 2014 Pivotal. All rights reserved.

Four times Microservices: REST, Kubernetes, UI Integration, Async. Eberhard Fellow

Architectural Code Analysis. Using it in building Microservices NYC Cloud Expo 2017 (June 6-8)

Cloud-Native Applications. Copyright 2017 Pivotal Software, Inc. All rights Reserved. Version 1.0

BUILDING MICROSERVICES ON AZURE. ~ Vaibhav

CADEC 2016 MICROSERVICES AND DOCKER CONTAINERS MAGNUS LARSSON

Developing Resilient Apps on SAP Cloud Platform

Spring Cloud, Spring Boot and Netflix OSS

Cloud Computing design patterns blueprints

Microservices at Netflix Scale. First Principles, Tradeoffs, Lessons Learned Ruslan

The Idiot s Guide to Quashing MicroServices. Hani Suleiman

The Evolution of Microservices. Adrian Technology Fellow - Battery Ventures June 2016

Anti-fragile Cloud Architectures. Agim Emruli - mimacom

API, DEVOPS & MICROSERVICES

Microservices Implementations not only with Java. Eberhard Wolff Fellow

WHITEPAPER. Embracing Containers & Microservices for future-proof application modernization

Nevin Dong 董乃文 Principle Technical Evangelist Microsoft Cooperation

Reactive Systems. Dave Farley.

Self-healing Data Step by Step

MSB to Support for Carrier Grade ONAP Microservice Architecture. Huabing Zhao, PTL of MSB Project, ZTE

Microservices mit Java, Spring Boot & Spring Cloud. Eberhard Wolff

Using AWS to Build a Large Scale Dockerized Microservices Architecture. Dr. Oliver Wahlen moovel Group GmbH Frankfurt, 30.

MICROSERVICES I PRAKTIKEN från tröga monoliter till en arkitektur för kortare ledtider, högre skalbarhet och ökad feltolerans

Distributed CI: Scaling Jenkins on Mesos and Marathon. Roger Ignazio Puppet Labs, Inc. MesosCon 2015 Seattle, WA

High Availability Distributed (Micro-)services. Clemens Vasters Microsoft

The Road to Istio: How IBM, Google and Lyft Joined Forces to Simplify Microservices

AN EVENTFUL TOUR FROM ENTERPRISE INTEGRATION TO SERVERLESS. Marius Bogoevici Christian Posta 9 May, 2018

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

Building Microservices with the 12 Factor App Pattern

Microservices Beyond the Hype. SATURN San Diego May 3, 2016 Paulo Merson

Managing Data at Scale: Microservices and Events. Randy linkedin.com/in/randyshoup

Introduction to reactive programming. Jonas Chapuis, Ph.D.

To Microservices and Beyond!

RED HAT OPENSHIFT A FOUNDATION FOR SUCCESSFUL DIGITAL TRANSFORMATION

@joerg_schad Nightmares of a Container Orchestration System

ISTIO 1.0 INTRODUCTION & OVERVIEW OpenShift Commons Briefing Brian redbeard Harrington Product Manager, Istio

How to write Cynical software

Service Mesh with Istio on Kubernetes. Dmitry Burlea Software FlixCharter

Service Mesh and Microservices Networking

Which compute option is designed for the above scenario? A. OpenWhisk B. Containers C. Virtual Servers D. Cloud Foundry

SPRING CLOUD AGIM EMRULI - MIMACOM

There is no such thing as a microservice!

Handling Microservices with Kubernetes - Basic Info

@unterstein #bedcon. Operating microservices with Apache Mesos and DC/OS

Container 2.0. Container: check! But what about persistent data, big data or fast data?!

A developer s guide to load testing

Reaktive Anwendungen mit RxJava. Dr. Michael Menzel

CLUSTERING HIVEMQ. Building highly available, horizontally scalable MQTT Broker Clusters

The SMACK Stack: Spark*, Mesos*, Akka, Cassandra*, Kafka* Elizabeth K. Dublin Apache Kafka Meetup, 30 August 2017.

Think Small to Scale Big

Lessons Learned: Deploying Microservices Software Product in Customer Environments Mark Galpin, Solution Architect, JFrog, Inc.

Spark and Flink running scalable in Kubernetes Frank Conrad

Apache ZooKeeper and orchestration in distributed systems. Andrew Kondratovich

Freeing the Whale How to Fail at Scale

Transforming the Internal IT Landscape with APIs. Scott Cranton Director, Application Platform SAs April 2018

Microprofile Fault Tolerance. Emily Jiang 1.0,

Think Small: API Architecture For The Enterprise

Microservices What, Why? ( 마이크로서비스를꼭써야하나 )

ACID Is So Yesterday: Maintaining Data Consistency with Sagas

BARCELONA. 2015, Amazon Web Services, Inc. or its affiliates. All rights reserved

Achieving Digital Transformation: FOUR MUST-HAVES FOR A MODERN VIRTUALIZATION PLATFORM WHITE PAPER

How to Keep UP Through Digital Transformation with Next-Generation App Development

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

Stream and Batch Processing in the Cloud with Data Microservices. Marius Bogoevici and Mark Fisher, Pivotal

When the Servlet Model Doesn't Serve. Gary Murphy Hilbert Computing, Inc.

Mobile Cloud Computing Challenges and Solutions

Building Microservices Free Ebook From Oreilly And Nginx

The 12-Factor app and IBM Bluemix IBM Corporation

RA-GRS, 130 replication support, ZRS, 130

Microservice Splitting the Monolith. Software Engineering II Sharif University of Technology MohammadAmin Fazli

Application Centric Microservices Ken Owens, CTO Cisco Intercloud Services. Redhat Summit 2015

Service Computation 2018 February 18 22, Keynote Speech on Microservices A modern, agile approach to SOA

Sunil Shah SECURE, FLEXIBLE CONTINUOUS DELIVERY PIPELINES WITH GITLAB AND DC/OS Mesosphere, Inc. All Rights Reserved.

API Best Practices. Managing APIs holistically across the enterprise

Building a Data-Friendly Platform for a Data- Driven Future

SCALING LIKE TWITTER WITH APACHE MESOS

Open Cloud Engine - An Open Source Cloud Native Transformer

Microservices Architekturen aufbauen, aber wie?

Hands-On: Hystrix. Best practices & pitfalls

The four forces of Cloud Native

Microservices Meets Citizen Developers

Zabbix on a Clouds. Another approach to a building a fault-resilient, scalable monitoring platform

Container-Native Storage

Adapting JDT to the Cloud. Alex Boyko Pivotal Jay Arthanareeswaran - IBM John Arthorne - IBM

Europeana Core Service Platform

Vblock Infrastructure Packages: Accelerating Deployment of the Private Cloud

Carrier SDN for Multilayer Control

Hi! NET Developer Group Braunschweig!

Going Reactive. Reactive Microservices based on Vert.x. JavaLand Kristian Kottke

A T O O L K I T T O B U I L D D I S T R I B U T E D R E A C T I V E S Y S T E M S

WEBMETHODS AGILITY FOR THE DIGITAL ENTERPRISE WEBMETHODS. What you can expect from webmethods

Microservices Lessons Learned From a Startup Perspective

Sentinet for BizTalk Server SENTINET

Top five Docker performance tips

Disclaimer This presentation may contain product features that are currently under development. This overview of new technology represents no commitme

Topic : Object Oriented Design Principles

Microservices on AWS. Matthias Jung, Solutions Architect AWS

AGILE DEVELOPMENT AND PAAS USING THE MESOSPHERE DCOS

Service Mesh and Related Microservice Technologies in ONAP

Transcription:

Microservices stress-free and without increased heart-attack risk Uwe Friedrichsen (codecentric AG) microxchg Berlin, 12. February 2015

@ufried Uwe Friedrichsen uwe.friedrichsen@codecentric.de http://slideshare.net/ufried http://ufried.tumblr.com

tl;dr Can I have stress-free µservices? <Hysterical laughter> Of course not!!! :-((( and now??? You have the choice between the hard way and the not so hard way Okay, let s try the not so hard way

Why aren t µservices easy?

A single µservice is easy but the complexity of the business functionality remains the same Complexity is shifted from single µservices to µservice collaboration ervices are usually self-contained i.e., µservices are independent runtime processes This results in a highly interconnected, distributed system landscape

Consequences Design is more challenging Implementation is more challenging Distributed systems are challenging Lookup Liveness Partitioning Latency Consistency New challenges for monolith developers à ervices are not easy

But then why are we doing µservices?

The pros of µservices Improved business responsiveness Improved business flexibility Team autonomy (Conway s law) Easy, isolated deployment Better scalability Replaceability (Lean Startup) if done right (no free lunch)

It s an architectural tradeoff ervice Monolith Responsiveness Cost-Efficiency Autonomy Standardization Many unknowns Well known

Then let s talk about the not so hard way

Disclaimer

Topic areas Design Interfaces User Interface Frameworks Datastores Developer Runtime Environment Deployment Production Resilience

"It seems as if teams are jumping on µservices because they're sexy, but the design thinking and decomposition strategy required to create a good µservices architecture are the same as those needed to create a well structured monolith. If teams find it hard to create a well structured monolith, I don't rate their chances of creating a well structured µservices architecture. - Simon Brown http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html

"In theory, programming languages give us all we need to encapsulate state and environment - we just need to use them well. Maybe we just don t have the discipline? Maybe we had to explicitly advocate the practice of writing services running in completely different environments using different languages to trigger the sort of encapsulation that we want? If that s the case, we can either see it as a clever self-hack or something we were forced into by the fact that we programmers are adept at overcoming any sort of self-discipline we try to impose on ourselves. Perhaps both are true. - Michael Feathers https://michaelfeathers.silvrback.com/microservices-and-the-failure-of-encapsulaton

Design Master modularization first Use bounded contexts as a modularization starting point Forget about layered architecture Rethink DRY avoid deployment dependencies

If every service needs to be updated at the same time it s not loosely coupled - Adrian Cockcroft http://de.slideshare.net/adriancockcroft/dockercon-state-of-the-art-in-microservices

Interfaces Use versioned interfaces (don t forget the interface data model) Remember Postel s law Consider API gateways Synchronous vs. asynchronous

Request/Response : Horizontal slicing Event-driven : Vertical slicing Flow / Process Flow / Process

User Interface The single UI application is history Separate UI and services Decouple via client centric API gateway Including UI in service can make sense in special cases

UI e.g., B2C-Portal UI e.g., Mobile App UI e.g., Clerk Desktop UI e.g., embedded in Partner-Portal API Gateway API Gateway API Gateway Bounded Context Bounded Context Bounded Context

Frameworks Not the most important issue of µservices Should support at least uniform interfaces, observability, resilience Nice if also support for uniform configuration and discoverability Spring Boot/Cloud, Dropwizard, Netflix Karyon,

Datastores Avoid the single, big database Avoid distributed transactions Try to relax temporal constraints (and make actions idempotent) Treat your storage as being ephemeral

Development Runtime Environment Developers should be able to run the application locally Provide automatically deployable development runtime environment Containers are your friend Make sure things build and deploy fast locally

Deployment Must be one click Unify deployment artifact format Use either IaC tool deployment or distributed infrastructure & scheduler

Production You need to solve at least the following issues Configuration, Orchestration, Discovery, Routing, Observability, Resilience No standard solution (yet) in sight Container management infrastructures may be of help

Configuration Netflix Archaius Orchestration Apache Aurora on Apache Mesos Marathon Kubernetes Fleet Discovery Netflix Eureka Apache ZooKeeper Kubernetes Etcd Routing Netflix Zuul & Ribbon Twitter Finagle Monitoring Hystrix Twitter Zipkin (Distributed Tracing) Measuring Dropwizard Metrics Logging ELK Graylog2 Splunk

A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable. Leslie Lamport

Failures in complex, distributed, interconnected systems are not an exceptional case They are the normal case They are not predictable They are not avoidable

ervice systems are complex, distributed, interconnected systems

Failures in µservice systems are not an exceptional case They are the normal case They are not predictable They are not avoidable

How can I maximize availability in µservice systems?

Availability MTTF MTTF + MTTR MTTF: Mean Time To Failure MTTR: Mean Time To Recovery

Traditional stability approach Availability MTTF MTTF + MTTR Maximize MTTF

Resilience approach Availability MTTF MTTF + MTTR Minimize MTTR

Do not try to avoid failures. Embrace them.

resilience (IT) the ability of a system to handle unexpected situations - without the user noticing it (best case) - with a graceful degradation of service (worst case)

Resilience Resilient software design is mandatory Start with isolation and latency control Add automated error recovery and mitigation Separate control and data flow

Error flow Control flow Event/data flow Event/data flow Isolation Resource access

Separation of control/error and data/event flow S S Escalation S S S W W W W W W W W Flow / Process

// Hystrix Hello world public class HelloCommand extends HystrixCommand<String> { private static final String COMMAND_GROUP = Hello ; // Not important here private final String name; // Request parameters are passed in as constructor parameters public HelloCommand(String name) { super(hystrixcommandgroupkey.factory.askey(command_group)); this.name = name; } } @Override protected String run() throws Exception { // Usually here would be the resource call that needs to be guarded return "Hello, " + name; } // Usage of a Hystrix command synchronous variant @Test public void shouldgreetworld() { String result = new HelloCommand("World").execute(); assertequals("hello, World", result); }

Source: https://github.com/netflix/hystrix/wiki/how-it-works

Idempotency Fan out & quickest reply Relaxed Temporal Constraints Self-Containment Shed Load Bounded Queues Latency Control Circuit Breaker Asynchronous Communication Loose Coupling Location Transparency Isolation Bulkheads Fail Fast Supervision Timeouts Event-Driven Stateless Complete Parameter Checking Monitor Error Handler Escalation

Wrap-up ervices are no free lunch Use if responsiveness is crucial Reduce stress by especially taking care of Good functional design Production readiness (incl. resilience) New challenges for developers (& ops)

@ufried Uwe Friedrichsen uwe.friedrichsen@codecentric.de http://slideshare.net/ufried http://ufried.tumblr.com