Microservices Runtimes

Post on 24-Jan-2018

221 views 0 download

Transcript of Microservices Runtimes

munz & more

Microservices RuntimesOTN LatAm Tour / August 2017 Dr. Frank Munz

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

Microservices

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

Frank Munz / OTN Latam 2016 #5

Service owns its data

Less enterprise, more application centric

Continuous Unlocking

How to Model?

munz & more #6

„… consider starting monolithic first …”

munz & more #7

Sam Newman:

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

munz & more #8

published 2003

How Big is Micro?

4950 Calories

munz & more #9

How Big is Micro?

munz & more #10

Martin Fowler (quotes Amazon):

We understand efficient teams

munz & more #11

Picture this …

String encrypt (String input)

10 Mio USD3 people

or 30 people?

munz & more #12

Communication

DB1

μ1

DB2

μ2direct call ?

REST?/Kafka

Process

{apiGW}

Communication Overhead

Rough approximation:

network call / local call

munz & more #14

Communication Overhead

Rough approximation:

0,003 s / 10^-9 s

munz & more #15

Communication Overhead

3.000.000 x

munz & more #16

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:

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

MicroservicesRuntimes

Application Container Cloud Service

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

Java CS

Create JCS

munz & more #24

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

WebLogic Microservice Edition?

It should be

• Single instance

• No domain

• No cluster

• Lightweight

Stay tuned …

munz & more #26

Docker based Runtimes

Welcome Mini J

Artesania Raspi cluster runs• Docker• Docker Swarm• Kubernetes

Live hacking session at Oracle CODE 2017 CDMX

DIY Raspi Docker Cluster

munz & more #29

Component Price

Raspi 4x38€

MicroSD 4x11€

Power 28€

Wifi 22€

Case 30€

Wires 10€

Kubernetes

Google Kubernetes

munz & more #31

Docker Swarm

Docker Swarm

munz & more #33

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

Oracle Container Cloud Service

(OCCS)

OCCS

munz & more #36

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.

Function asa Service

AWSExampleusedhere.FaaS wasannouncedatOOW2016.

Edit Code / Upload

munz & more #39

event: event passed to function

context: runtime contextcallback: optional return

(or null)

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

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

munz & more #42

Is𝛌 thenewμ ?

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

There is more neededto succed with

microservices ...

1.) Your Organization

Conway’s Law

2.) Automation and Monitoring

• Developer Cloud Service

– Builds and runs deployments for ACCS, JCS

• Wercker (free!)

– Provisions software in Docker Containers

munz & more #45

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

https://app.wercker.com

munz & more #47

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

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

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

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