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

Similar documents
Microservices Implementations not only with Java. Eberhard Wolff Fellow

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

SPRING CLOUD AGIM EMRULI - MIMACOM

Service Mesh with Istio on Kubernetes. Dmitry Burlea Software FlixCharter

CADEC 2016 MICROSERVICES AND DOCKER CONTAINERS MAGNUS LARSSON

What is Spring Cloud

Java Architectures A New Hope. Eberhard Wolff

Spring Cloud, Spring Boot and Netflix OSS

Zero to Microservices in 5 minutes using Docker Containers. Mathew Lodge Weaveworks

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

Microservices. Are your Frameworks ready? Martin Eigenbrodt Alexander Heusingfeld

Anti-fragile Cloud Architectures. Agim Emruli - mimacom

Microservices. Chaos Kontrolle mit Kubernetes. Robert Kubis - Developer Advocate,

Cloud Native Java with Kubernetes

Hands-On: Hystrix. Best practices & pitfalls

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

Implementing Microservices Tracing with Spring Cloud and Zipkin

To Microservices and Beyond!

SERVERLESS APL. For now this is just research in Cloud technologies in SimCorp A/S.

SAMPLE CHAPTER. John Carnell MANNING

Wrapp. Powered by AWS EC2 Container Service. Jude D Souza Solutions Wrapp Phone:

Microservices stress-free and without increased heart-attack risk

Resilience, Service- Discovery and Z- D Deployment. Bodo Junglas, York Xylander

Using the SDACK Architecture to Build a Big Data Product. Yu-hsin Yeh (Evans Ye) Apache Big Data NA 2016 Vancouver

Reactive Microservices Architecture on AWS

Architekturen für die Cloud

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

Enabling Multi-Cloud with Istio Stretching an Istio service mesh between Public & Private Clouds. John Joyce Robert Li

Send me up to 5 good questions in your opinion, I ll use top ones Via direct message at slack. Can be a group effort. Try to add some explanation.

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

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

Kubernetes The Path to Cloud Native

Managing your microservices with Kubernetes and Istio. Craig Box

NGINX: From North/South to East/West

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

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

Developer Experience with. Spencer Gibb, Dave Syer, Spring Cloud

Istio. A modern service mesh. Louis Ryan Principal

Ingress Kubernetes Tutorial

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

Ray Tsang Developer Advocate Google Cloud Platform

Developing Microsoft Azure Solutions (70-532) Syllabus

Transformation-free Data Pipelines by combining the Power of Apache Kafka and the Flexibility of the ESB's

Kubernetes introduction. Container orchestration

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

SBB. Java User Group 27.9 & Tobias Denzler, Philipp Oser

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

Creating a Multi-Container Pod

Designing MQ deployments for the cloud generation

Apache Kafka a system optimized for writing. Bernhard Hopfenmüller. 23. Oktober 2018

Continuous delivery while migrating to Kubernetes

Cloud Computing design patterns blueprints

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

How we scaled push messaging for millions of Netflix devices. Susheel Aroskar Cloud Gateway

Comet and WebSocket Web Applications How to Scale Server-Side Event-Driven Scenarios

Nevin Dong 董乃文 Principle Technical Evangelist Microsoft Cooperation

LEAN & MEAN - GO MICROSERVICES WITH DOCKER SWARM AND SPRING CLOUD

Running MarkLogic in Containers (Both Docker and Kubernetes)

Building Microservices with the 12 Factor App Pattern

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

How to Re-Architect without Breaking Stuff (too much) Owen Garrett March 2018

Developing Microsoft Azure Solutions (70-532) Syllabus

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

BUILDING MICROSERVICES ON AZURE. ~ Vaibhav

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

Microservice Bus Tutorial. Huabing Zhao, PTL of MSB Project, ZTE

Processing of big data with Apache Spark

Open Cloud Engine - An Open Source Cloud Native Transformer

Distributed Architectures & Microservices. CS 475, Spring 2018 Concurrent & Distributed Systems

Cloud I - Introduction

Cloud Service Engine. Product Description. Issue 01 Date

Kuber-what?! Learn about Kubernetes

Code: Slides:

An Introduction to Kubernetes

A Cloud Gateway - A Large Scale Company s First Line of Defense. Mikey Cohen Manager - Edge Gateway Netflix

Connecting your Microservices and Cloud Services with Oracle Integration CON7348

Indirect Communication

Microservices and Container Development

Designing Services for Resilience Experiments: Lessons from Netflix. Nora Jones, Senior Chaos

API, DEVOPS & MICROSERVICES

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

/ Cloud Computing. Recitation 5 February 14th, 2017

Qualys Cloud Platform

Exercise for OAuth2 security. Andreas Falk

A Comparision of Service Mesh Options

Deep Dive Amazon Kinesis. Ian Meyers, Principal Solution Architect - Amazon Web Services

JFOKUS 2017 EXPERIENCES FROM USING DISCOVERY SERVICES IN A MICROSERVICE LANDSCAPE

Tapestry. Code less, deliver more. Rayland Jeans

MODERN APPLICATION ARCHITECTURE DEMO. Wanja Pernath EMEA Partner Enablement Manager, Middleware & OpenShift

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

Microservices, Messaging and Science Gateways. Review microservices for science gateways and then discuss messaging systems.

OPENSHIFT 3.7 and beyond

So, I have all these containers! Now what?

Accenture Cloud Platform Serverless Journey

Eclipse MicroProfile with Thorntail (formerly WildFly Swarm)

Containers OpenStack. Murano brings Docker & Kubernetes to OpenStack. Serg Melikyan. software.mirantis.com. January 27, 2015

MuleSoft Certified Platform Architect Level 1 Certification Exam

Load Balancing Nginx Web Servers with OWASP Top 10 WAF in AWS

Microservices on AWS. Matthias Jung, Solutions Architect AWS

Mesosphere and Percona Server for MongoDB. Jeff Sandstrom, Product Manager (Percona) Ravi Yadav, Tech. Partnerships Lead (Mesosphere)

Transcription:

Four times Microservices: REST, Kubernetes, UI Integration, Async Eberhard Wolff @ewolff http://ewolff.com Fellow

http://continuous-delivery-buch.de/ http://continuous-delivery-book.com/

http://microservices-buch.de/ http://microservices-book.com/

FREE!!!! http://microservices-book.com/ primer.html http://microservices-buch.de/ ueberblick.html

What are Microservices? > Modules providing interfaces > Processes, Containers, virtual machines

What are Microservices? > Independent Continuous Delivery Pipeline including tests > Standardized Operations (configuration, log analysis, tracing, monitoring, deployment) > Resilient (compensate failure, crashes ) therefore separate processes, VM, Docker containers

Microservices = Extreme Decoupling

Operational Complexity Extreme Decoupling

Link Micro Service Sync Async Micro Service

Synchronous REST Microservices

external HTTP internal REST Customer Order Catalog

Synchronous Microservices > Service Discovery: IP / port? > Load Balancing: Resilience and independent scaling > Routing: Route external request to microservices > Resilience

Synchronous Microservices with Java, Spring Boot / Cloud & the Netflix Stack

https://github.com/ ewolff/microservice

Service Discovery Eureka

Why Eureka for Service Discovery? > REST based service registry > Supports replication > Caches on the client > Resilient > Fast > Foundation for other services

Eureka Client > @EnableDiscoveryClient: generic > @EnableEurekaClient: specific > Dependency on spring-cloud-starter-eureka > Automatically registers application

Eureka Server @EnableEurekaServer @EnableAutoConfiguration public class EurekaApplication { public static void main(string[] args) { SpringApplication.run(EurekaApplication.class, args); } } Add dependency to spring-cloud-starter-eureka-server

Load Balancing Ribbon

Ribbon: Client Side Load Balancing Client Load Balancer Server > Decentralized Load Balancing > No bottle neck > Resilient

Ribbon Example Via Dependency Injection private LoadBalancerClient loadbalancer; Eureka name ServiceInstance instance = loadbalancer.choose("catalog"); String url = "http://" + instance.gethost() + ": + instance.getport() + "/catalog/"; Need dependency to spring-cloud-starter-ribbon

Resilience

Timeout > Do call in other thread pool > Won t block request handler > Can implement timeout

Circuit Breaker > Called system fails -> open > Open -> do not forward call > Forward calls after a time window

Hystrix & Spring Cloud > Annotation based approach > Annotations of javanica libraries > Simplifies Hystrix > No commands

Enable Hystrix @SpringBootApplication @EnableDiscoveryClient @EnableCircuitBreaker public class OrderApp { public static void main(string[] args) { SpringApplication.run(OrderApp.class, args); } } Need spring-cloud-starter-hystrix

@HystrixCommand(fallbackMethod = "getitemscache", commandproperties = { @HystrixProperty(name = "circuitbreaker.requestvolumethreshold", value = "2") } ) public Collection<Item> findall() { } this.itemscache = pagedresources.getcontent(); return itemscache; Fallback private Collection<Item> getitemscache() { } return itemscache;

Zuul Routing

Routing > One URL to the outside > Internal: Many Microservices > REST > Or HTML GUI > Hides internal structure (sort of) > Might add filters

Automatically maps route to server registered on Eureka i.e. /customer/** to CUSTOMER No configuration Zuul Proxy Customer Order Catalog

Netflix Stack > Service Discovery: Eureka > Load Balancing: Ribbon > Routing: Zuul > Resilience: Hystrix > Non-Java microservice: specific clients or sidecar

Consul > Service Discovery by Hashicorp > DNS interface > Platform independent > Consul Template can fill out config file templates > e.g. for load balancer > unaware of service discovery

https://github.com/ ewolff/microservice-consul

Kubernetes

https://github.com/ ewolff/microservicekubernetes

Kubernetes > Docker container on a single machine: Not resilient enough > Kubernetes: Run Docker container in cluster > and much more!

Pods > Kubernetes runs Pods > Pods = 1..n Docker containers > Shared volumes > and ports

Replica Sets > Deployment creates replica set > Replica sets ensure that a certain number of Pods run >...for load balancing / fail over

Services > Services ensure access to the Pods > DNS entry > Cluster-wide unique IP address for internal access > Node port > or external load balancer for external access

Pod starts Service DNS Cluster IP address Load Balancer Pod Replica Set creates Deployment

Load Balancer Service 1 Load Balancer (e.g. Amazon Elastic Load Balancer) Service adds a load balancer Service 2 Kubernetes Cluster Server Service 1 Service 2 Kubernetes Cluster Server

Kubernetes > Service Discovery: DNS > Load Balancing: IP > Routing: Load Balancer or Node Port > Resilience: Hystrix? envoy proxy? > Can use any language

No code dependencies on Kubernetes!

UI Integration

UI Integration > Very powerful > Often overlooked > UI should be part of a microservices > Self-contained System emphasize UI > http://scs-architecture.org/

System 1 System 2 Hyperlinks to navigate between systems.

System 1 System 2 Transclusion of content served by another application

https://www.innoq.com/ en/blog/transclusion/

UI Integration > Extremely decoupled > Here is a link: http://ewolff.com > No need to know anything else about the system > What about more complex transclusion?

Server-side integration Browser UI 1 UI 2 Frontend Server Backend 1 Backend 2

Server-side Integration: Technologies > ESI (Edge Side Include) > E.g. Varnish cache > SSI (Server Side Include) > E.g. Apache httpd, Nginx

ESI (Edge Side Includes)... <header>... Logged in as: Ada Lovelace... </header>... <div>... a lot of static content and images... </div>... <div> some dynamic content </div>

ESI (Edge Side Includes)... <esi:include src="http://example.com/header" />... <div>... a lot of static content and images... </div>... <esi:include src="http://example.com/dynamic" /> http://www.w3.org/tr/esi-lang

https://github.com/ ewolff/scs-esi

Client-side integration Browser UI 1 Backend 1 UI 2 Backend 2

Client-side Integration: Code Replace <a href= " " class= "embeddable"> with content of document in a <div> (jquery) $("a.embeddable").each(function(i, link) { $("<div />").load(link.href, function(data, status, xhr) { }); $(link).replacewith(this); });

https://github.com/ ewolff/scs-jquery

https://github.com/ ewolff/crimsoninsurance-demo

Asynchronous Microservices

Asynchronous > Do not talk to other microservices >...and wait for a reply > while processing a request. > Either don t wait for a reply >...or don t communicate while processing a request.

Asynchronous: Benefits > Deals with unreliable systems > Can guarantee delivery > Good fit for events > and Bounded Context / DDD

Invoice Order Delivery

Kafka

https://github.com/ ewolff/microservice-kafka

Kafka API > Producer API > Consumer API > Streams API (transformation)

Kafka Records > Key > Value > Timestamp Record Key Value Timestamp > No headers > Stored forever (!)

Kafka Topics > Named > Topics have partitions > Order guaranteed per partition > Consumer commits offset per partition > Consumer group: One consumer per partition Record Record Record Partition Topic

Offset committed per consumer Offset Record Record Record Offset Record Record Record Record Record Record Partition Partition Partition Topic Producer

Log Compaction > Remove all but the latest record with a given key > Idea: Old events not relevant > if new events override > Efficient storage in the long run Record id=42 Record id=23 Record id=42 Partition

Kafka Replication > N Replicas (configurable) > In-sync replicas (configurable): write successful if all written

Asynchronous Microservices > Service Discovery: via topic > Load Balancing: via partitions / consumer groups > Routing:./. > Resilience service fails latency increases

Kafka Conclusion > Provides access to old events > Guaranteed order per key > (Log compaction also per key) > Consumer groups send records to one consumer > Additional (complex) infrastructure

REST & ATOM

https://github.com/ ewolff/microservice-atom

Atom > Data format > for feeds, blogs, podcasts etc > Access through HTTP > Idea: Provide a feeds of events / orders

<feed xmlns="http://www.w3.org/2005/atom"> <title>order</title> <link rel="self" href="http://localhost:8080/feed" /> <author><name>big Money Inc.</name> </author> <subtitle>list of all orders</subtitle> <id>https://github.com/ewolff/microserviceatom/order</id> <updated>2017-04-20t15:28:50z</updated> <entry>... </entry> </feed>

<entry> <title>order 1</title> <id>https://github.com/ewolff/microserviceatom/order/1</id> <updated>2017-04-20t15:27:58z</updated> <content type="application/json src="http://localhost:8080/order/1" /> <summary>this is the order 1</summary> </entry>

Atom Feed > Some unneeded information > but not a lot > Mostly links to details >...and timestamps > Can use content negotiation to provide different data formats or details

Subscribing to Feed > Poll the feed (HTTP GET) > Client decides when to process new events > but very inefficient > Lots of unchanged data

HTTP Caching > Client GETs feed > Server send data > + Last-Modified header > Client sends get > + If-Modified-Since header > Server: 304 (Not modified) > or new data

REST can be asynchronous.

Atom > Service Discovery: REST > Load Balancing: REST > Routing:./. > Resilience failures just increase latency

Atom Conclusion > Can provides access to old events if they are stored anyway. > One consumer: idempotency > No additional infrastructure

Conclusion

Operational Complexity Extreme Decoupling

Conclusion: Communication > Netflix: Java focus, code dependencies > Kubernetes: No code dependencies > UI Integration: more decoupling > Asynchronous deals with challenges in distributed systems

Links > List of microservices demos (sync, async, UI): http://ewolff.com/microservices-demos.html > REST vs. Messaging for Microservices https://www.slideshare.net/ewolff/rest-vsmessaging-for-microservices

EMail bedcon2017@ewolff.com to get: Slides + Microservices Primer + Sample Microservices Book + Sample of Continuous Delivery Book Powered by Amazon Lambda & Microservices