Slide 1

Slide 1 text

Microservices or Functions? Use both with Red Hat OpenShift Marius Bogoevici Principal Specialist Solution Architect May 8, 2019

Slide 2

Slide 2 text

Marius Bogoevici ● Principal Specialist Solutions Architect at Red Hat ○ Specialize in Integration/Messaging/Data Streaming ● OSS contributor since 2008 ○ Spring Integration ○ JBoss ecosystem ○ Spring XD, Spring Integration Kafka ○ Former Spring Cloud Stream project lead ● Co-author “Spring Integration in Action”, Manning, 2012

Slide 3

Slide 3 text

Unfortunately, we cannot predict the future. As an organization, we must be able to observe and experiment in our environments and react accordingly. We need to be agile.

Slide 4

Slide 4 text

On the other hand we must be mindful of our resources; We want to eliminate waste, reduce time to experiment, and make it cheap so we can increase our returns.

Slide 5

Slide 5 text

We cannot build complex systems from complex parts. We must keep our components as simple and understandable as possible.

Slide 6

Slide 6 text

WHY MICROSERVICES? WHY FUNCTIONS Monolith Microservices Operational efficiency Fast value delivery

Slide 7

Slide 7 text

MICROSERVICES AND CONTAINERS

Slide 8

Slide 8 text

● Reduce the responsibility of a service to a specific business functionality ● Allow parallelization of development work ● Independently deployable (infra) and independently releasable (business) ● Can optimize for increased utilization (separating out parts of the code base that exhibit different i/o, throughput, latency needs) ● Re-use services where applicable Microservices

Slide 9

Slide 9 text

● Microservices great at enabling agility from existing systems ● Well understood business, well understood boundaries ● Don’t optimize for microservices unless you have problems with your application architecture ● Don’t complicate experimentation/value discovery with complex architecture What’s your use case?

Slide 10

Slide 10 text

Containers and microservices

Slide 11

Slide 11 text

● Use a platform that makes running apps reliable, transparent and boring ● In-built resource management ○ Memory, CPU, disk ● Elastic scaling ● Monitoring and failover ○ Health, logging, metrics ● Routing and load balancing ● Rolling upgrades and CI/CD ● Namespacing Orchestrating containers on cloud native platforms

Slide 12

Slide 12 text

WHAT ABOUT FUNCTIONS?

Slide 13

Slide 13 text

● Usually when logic not well understood ● MVPs are throwaway ● Usage patterns unknown ● Adoption unpredictable Exploratory use cases

Slide 14

Slide 14 text

● Low number of hours/minutes of use ● Event-driven, spikey utilization ● Lots of compute for very short period of time Under-utilization use cases

Slide 15

Slide 15 text

● Webhook callbacks ● Scheduled tasks ● File processing ● Reacting to database changes ● Limited stream processing Limited integration use cases

Slide 16

Slide 16 text

● Use a platform that makes running apps reliable, transparent and boring ● In-built resource management ○ Memory, CPU, disk ● Elastic scaling ● Monitoring and failover ○ Health, logging, metrics ● Routing and load balancing ● Rolling upgrades and CI/CD ● Namespacing Orchestrating containers on cloud native platforms

Slide 17

Slide 17 text

● Pay only for usage without regard for topology (Serverless) ● Event driven by nature ● On demand ● Write only code, heavy lifting is handled for you ● High parallelization ● High utilization Functions as a Service (FaaS)

Slide 18

Slide 18 text

The meaning of serverless: FaaS vs autoscaling?

Slide 19

Slide 19 text

● Microservices: request-reply and event-driven ● Containers (on prem, in the cloud) ● Functions ● Serverless (databases, message queues, caches, etc) As you move to cloud native, you have options

Slide 20

Slide 20 text

Container orchestration creates a level playing field for these options at different levels of abstraction

Slide 21

Slide 21 text

DEMO

Slide 22

Slide 22 text

What’s the business use case?

Slide 23

Slide 23 text

Utilization?

Slide 24

Slide 24 text

Two deployment strategies

Slide 25

Slide 25 text

Container orchestration creates a level playing field for these options at different levels of abstraction

Slide 26

Slide 26 text

Your technology radar ● Service Mesh (e.g. Istio): ○ Provide microservice interconnectivity ● Serverless platforms (e.g. Knative) ○ Container build and on-demand scheduling ● Container-native frameworks (e.g. Quarkus) ○ Optimize Java workloads for containerized apps ● FaaS frameworks (e.g. Camel-K) ○ Schedule integration code directly on platform

Slide 27

Slide 27 text

No content