What monolith can learn from microservices?

40
@alexsotob #Voxxed What Monolith Can Learn From Microservices Alex Soto Red Hat

Transcript of What monolith can learn from microservices?

@alexsotob#Voxxed

What Monolith Can Learn From Microservices

Alex Soto Red Hat

@alexsotob2

Alex Soto

Red Hat Engineer www.lordofthejars.com @alexsotob

Who Am I?

@alexsotob3

https://www.manning.com/books/testing-java-microservices

ctwvdv18 40% discount

@alexsotob4

Questions

@alexsotob5

@alexsotob6

Frontend

API Gateway

GameMicroservice

ReviewMicroservice

DetailMicroservice

@alexsotob7

Frontend

GameMicroservice

ReviewMicroservice

DetailMicroservice

JVM

@alexsotob8

@alexsotob9

Isolation of Code

@alexsotob10

Isolation of Code

review

api

impl

detail

api

impl

game

api

impl

publicexposes only what is requiredfavour low-coupling

privatehighly cohesivereduces our memory footprint

IMPL

API

pmd, code-assert, checkstyle, maven enforcer

@alexsotob11

Isolation of Data

@alexsotob12

Isolation of Data

game schema

Game

Detaildetail schema

Reviewreview schema

Module == Schema

Joins inside Schema

Referential Integrity across Schemas

Global transactions

flyway, liquibase

@alexsotob13

Reactive Extensions

@alexsotob14

Reactive Java

Where to Run

Combiner

How to CombineFinal Run

@alexsotob15

Network

@alexsotob16

Circuit Breaker Pattern

@alexsotob17

Circuit Breaker

Defines CB

Wrapped function

Recovery

@alexsotob18

DEMO

@alexsotob19

Front-End

@alexsotob20

MicroFrontends

Code to embed

Custom name

https://micro-frontends.org/https://developers.google.com/web/fundamentals/web-components/customelements

@alexsotob21

@alexsotob22

Your Stack Matters

Server Hardware

Operating System

Application Server

your.war

Java Virtual Machine

Custom Configuration

Linux Kernel Version & Distribution

Java 1.7.0_67

Tomcat, Wildfly, Jetty

JDBC driver, users

@alexsotob23

Infrastructure

@alexsotob24

Deploying in Cluster

Always two instances of the image

Docker image to run

Port

@alexsotob25

Deploying in Cluster

Reverse Proxy Router

Number of instances LB

@alexsotob26

Cloud Native Application

@alexsotob27

Infrastructure

sticky session

Shopping Cart User A

@alexsotob28

In-Memory Data Grid

In-Memory DataGridShopping Cart User A Shopping Cart User A

@alexsotob29

Release as Unicorns

@alexsotob30

Release as Unicorns

Build Dockerfile DeployBuild Container Testing in Production Release

s2i, OpenShift, Fabric8 Teiid, Debezium (Test Prod)

@alexsotob31

Let’s Wind Down

@alexsotob32

Advantages of monolith

> Local Calls

> All parts always up

> Easy to debug

> Easy to test

> Refactor without running surprises

> You see the real world every time

> Easy to deploy (coordination)

> Polyglot Languages, DB

@alexsotob33

Digital Darwinism

Self-Service, On-Demand,

Elastic, Infrastructure

as Code

(Cloud)

Re-Org to DevOps

Automation Puppet, Chef,

Ansibleand/or

Kubernetes

CI & CD Deployment

Pipeline

Advanced Deployment Techniques

Microservices

@alexsotob34

https://www.slideshare.net/dbryant_uk/oreilly-sacon-ny-2018-continuous-delivery-patterns-for-contemporary-architecture/2

You In The Near Future

@alexsotob35

@alexsotob36

Stats serviceUser Service

Awards Service

Question Service

Advertise Service

Question Service

@alexsotob37

NO, it is a monolithhttps://www.infoq.com/news/2015/06/scaling-stack-overflow

@alexsotob38

“Long Live and Prosper to Monolith.”

—SPOCK

https://developers.redhat.com/

@alexsotob

[email protected]