microservices runtimes

51
munz & more Microservices Runtimes OTN LatAm Tour / August 2017 Dr. Frank Munz

Upload: frank-munz

Post on 24-Jan-2018

223 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Microservices Runtimes

munz & more

Microservices RuntimesOTN LatAm Tour / August 2017 Dr. Frank Munz

Page 2: Microservices Runtimes

2

Frank Munz

• Founded munz & more in 2007

• 17 years Oracle Middleware,Cloud, and Distributed Computing

• Consulting and High-End Training

• Wrote two Oracle WLS andone Cloud book

Page 3: Microservices Runtimes

Microservices

Page 4: Microservices Runtimes

Microservices

Developing a single application as

• a suite of small services• each running in its own process / owns it‘s data• communicating with lightweight mechanisms

(Definition: M. Fowler / J. Lewis)

https://martinfowler.com/articles/microservices.html

Page 5: Microservices Runtimes

Frank Munz / OTN Latam 2016 #5

Service owns its data

Less enterprise, more application centric

Continuous Unlocking

Page 6: Microservices Runtimes

How to Model?

munz & more #6

Page 7: Microservices Runtimes

„… consider starting monolithic first …”

munz & more #7

Sam Newman:

Page 8: Microservices Runtimes

Eric Evans describes “bounded contexts” in his DDD book.

munz & more #8

published 2003

Page 9: Microservices Runtimes

How Big is Micro?

4950 Calories

munz & more #9

Page 10: Microservices Runtimes

How Big is Micro?

munz & more #10

Martin Fowler (quotes Amazon):

Page 11: Microservices Runtimes

We understand efficient teams

munz & more #11

Page 12: Microservices Runtimes

Picture this …

String encrypt (String input)

10 Mio USD3 people

or 30 people?

munz & more #12

Page 13: Microservices Runtimes

Communication

DB1

μ1

DB2

μ2direct call ?

REST?/Kafka

Process

{apiGW}

Page 14: Microservices Runtimes

Communication Overhead

Rough approximation:

network call / local call

munz & more #14

Page 15: Microservices Runtimes

Communication Overhead

Rough approximation:

0,003 s / 10^-9 s

munz & more #15

Page 16: Microservices Runtimes

Communication Overhead

3.000.000 x

munz & more #16

Page 17: Microservices Runtimes

What the Experts say (A. Cockroft)

munz & more #17

https://read.acloud.guru/evolution-of-business-logic-from-monoliths-through-microservices-to-functions-ff464b95a44d

Recommended read:

Page 18: Microservices Runtimes

Successful Microservices!

• Uber, Netflix etc.

• Fully automated CI / CD

• Automated testing

• Sometimes polyglot

• Top notch devops teams

• Large scale, single purpose apps

• Extensive monitoring

munz & more #18

Page 19: Microservices Runtimes

MicroservicesRuntimes

Page 20: Microservices Runtimes

Application Container Cloud Service

Page 21: Microservices Runtimes
Page 22: Microservices Runtimes

ACCS

• Polyglot: Java, node.js, PHP, Python and Ruby

• Java: Upload compiled zipped Java classes + JSON file with start command

• Easy to deploy and operate

• Lightweight: deployments run in containers

Polyglot,easytousemicroservicesruntime

Page 23: Microservices Runtimes

Java CS

Page 24: Microservices Runtimes

Create JCS

munz & more #24

Page 25: Microservices Runtimes

Java CS

• Multi-module deployment is not a microservice architecture.

• WebLogic Partitions: – share same JVM…

– Dependancy on admin server

• Standalone Multi-server topologies could serve as microservices runtime– Full Java EE -> heavy infrastructure / footprint

– Licensing

munz & more #25

WLS

a.war b.war

a.war

WLSP1 P2

a.war

WLS WLS

b.wara.war

Multimoduledeployment

WebLogicPartitions

Multi-servertopology

Notreallyamicroservicesruntime

Page 26: Microservices Runtimes

WebLogic Microservice Edition?

It should be

• Single instance

• No domain

• No cluster

• Lightweight

Stay tuned …

munz & more #26

Page 27: Microservices Runtimes

Docker based Runtimes

Page 28: Microservices Runtimes

Welcome Mini J

Artesania Raspi cluster runs• Docker• Docker Swarm• Kubernetes

Live hacking session at Oracle CODE 2017 CDMX

Page 29: Microservices Runtimes

DIY Raspi Docker Cluster

munz & more #29

Component Price

Raspi 4x38€

MicroSD 4x11€

Power 28€

Wifi 22€

Case 30€

Wires 10€

Page 30: Microservices Runtimes

Kubernetes

Page 31: Microservices Runtimes

Google Kubernetes

munz & more #31

Page 32: Microservices Runtimes

Docker Swarm

Page 33: Microservices Runtimes

Docker Swarm

munz & more #33

Page 34: Microservices Runtimes

Swarm vs. Kubernetes

Swarm …• Wasn’t impressive when released,

but this has changed• Is easier to understand

and to operate• Covers a lot of what K8s does• Only secure mode

– automatic TLS certs

• Is built-in and tightly linked to Docker API

munz & more #34DockerSwarm&K8s: flexiblemicroservicesRT,butbringoperationalcomplexity

Page 35: Microservices Runtimes

Oracle Container Cloud Service

(OCCS)

Page 36: Microservices Runtimes

OCCS

munz & more #36

Page 37: Microservices Runtimes

OCCS

• OCCS = Oracle’s container cloud service

• Abstracts away complexity of Kubernetes or Docker Swarm– Neither based on Swarm nor Kubernetes

• Uses service concept like in Swarm

• Integrates with Docker Hub, Wercker, Developer CS

• Allows deployment of stacks

• PaaS: Very easy to use (e.g. docker run …)

munz & more #37Dockerbasedmicroservicesruntime.EasiertooperatethanSwarmorKubernetes.

Page 38: Microservices Runtimes

Function asa Service

AWSExampleusedhere.FaaS wasannouncedatOOW2016.

Page 39: Microservices Runtimes

Edit Code / Upload

munz & more #39

event: event passed to function

context: runtime contextcallback: optional return

(or null)

Page 40: Microservices Runtimes

Definition: Function as a Service

• Auto scaling• True pay per use• Stateless• Event based

munz & more #40

Definition

• Choose memory -> compute power

• Using container techCharacteristics

Page 41: Microservices Runtimes

FaaS vs. K8s Microservices

FaaS fulfills M. Fowler’s microservices definition

munz & more #41

AWS Lambda compared to Docker with Kubernetes

BenefitsofFaaS- serverless- zeroconfig autoscaling- truepayperuse

->higherabstraction

LimitsofFaaS- language/frameworkchoice- resourcelimits- executiontime/size- vendorlock-in->reducedflexibility

Page 42: Microservices Runtimes

munz & more #42

Is𝛌 thenewμ ?

FaaS:Fullfill microservicescriteria.Lowprice,automaticscaling.Vendorlock-in?

Page 43: Microservices Runtimes

There is more neededto succed with

microservices ...

Page 44: Microservices Runtimes

1.) Your Organization

Conway’s Law

Page 45: Microservices Runtimes

2.) Automation and Monitoring

• Developer Cloud Service

– Builds and runs deployments for ACCS, JCS

• Wercker (free!)

– Provisions software in Docker Containers

munz & more #45

Page 46: Microservices Runtimes

Wercker

• Recently acquired by Oracle• Pipelines execute steps on code

– Pipelines == series of steps– Execute inside Docker container

• Workflows– chained and branched pipelines– Represented as wercker.yaml in github

• Quickly provision ready to run container infrastructure– Connects to github for source– Push images to Docker hub (or any registry) – Restart OCCS via webhooks

munz & more #46

Page 47: Microservices Runtimes

https://app.wercker.com

munz & more #47

Page 48: Microservices Runtimes

Microservices RuntimesOracleJCS

OracleACCS

Swarm Kubernetes OracleOCCS

FaaS

DockerPolyglot No Yes Yes Yes Yes Yes

Sizeinfrastructure

L/XL S S S S XS

Complexity L S M XL S XS

Elasticity auto(complex)

easyscale scale scale easyscale auto

Stateless No(SLSB)

(Yes) Yes Yes Yes Yes

Event based No(JMS)

No No No No Yes

Page 49: Microservices Runtimes

TL;DR #microservices #runtimesTradeoff: flexibility vs simplicity / ACCS is easy, lightweight & polyglot /Docker: Swarm vs Kubernetes vs OCCS / FaaS: true pay per use & automatic scale & stateless/ 𝛌 could be the new µ!

@frankmunz

Page 50: Microservices Runtimes

www.linkedin.com/in/frankmunz/ www.munzandmore.com/blog

facebook.com/cloudcomputingbookfacebook.com/weblogicbook

@frankmunz

youtube.com/weblogicbook

-> more than 50 web casts

Don’t be

shy J

Page 51: Microservices Runtimes

• Graphics on title page by M. Fowlerhttps://martinfowler.com/articles/microservices/images/sketch.png