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

What monolith can learn from microservices?

Mar 17, 2018

Download

Software

Alex Soto
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: What monolith can learn from microservices?

@alexsotob#Voxxed

What Monolith Can Learn From Microservices

Alex Soto Red Hat

Page 2: What monolith can learn from microservices?

@alexsotob2

Alex Soto

Red Hat Engineer www.lordofthejars.com @alexsotob

Who Am I?

Page 3: What monolith can learn from microservices?

@alexsotob3

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

ctwvdv18 40% discount

Page 4: What monolith can learn from microservices?

@alexsotob4

Questions

Page 5: What monolith can learn from microservices?

@alexsotob5

Page 6: What monolith can learn from microservices?

@alexsotob6

Frontend

API Gateway

GameMicroservice

ReviewMicroservice

DetailMicroservice

Page 7: What monolith can learn from microservices?

@alexsotob7

Frontend

GameMicroservice

ReviewMicroservice

DetailMicroservice

JVM

Page 8: What monolith can learn from microservices?

@alexsotob8

Page 9: What monolith can learn from microservices?

@alexsotob9

Isolation of Code

Page 10: What monolith can learn from microservices?

@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

Page 11: What monolith can learn from microservices?

@alexsotob11

Isolation of Data

Page 12: What monolith can learn from microservices?

@alexsotob12

Isolation of Data

game schema

Game

Detaildetail schema

Reviewreview schema

Module == Schema

Joins inside Schema

Referential Integrity across Schemas

Global transactions

flyway, liquibase

Page 13: What monolith can learn from microservices?

@alexsotob13

Reactive Extensions

Page 14: What monolith can learn from microservices?

@alexsotob14

Reactive Java

Where to Run

Combiner

How to CombineFinal Run

Page 15: What monolith can learn from microservices?

@alexsotob15

Network

Page 16: What monolith can learn from microservices?

@alexsotob16

Circuit Breaker Pattern

Page 17: What monolith can learn from microservices?

@alexsotob17

Circuit Breaker

Defines CB

Wrapped function

Recovery

Page 18: What monolith can learn from microservices?

@alexsotob18

DEMO

Page 19: What monolith can learn from microservices?

@alexsotob19

Front-End

Page 20: What monolith can learn from microservices?

@alexsotob20

MicroFrontends

Code to embed

Custom name

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

Page 21: What monolith can learn from microservices?

@alexsotob21

Page 22: What monolith can learn from microservices?

@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

Page 23: What monolith can learn from microservices?

@alexsotob23

Infrastructure

Page 24: What monolith can learn from microservices?

@alexsotob24

Deploying in Cluster

Always two instances of the image

Docker image to run

Port

Page 25: What monolith can learn from microservices?

@alexsotob25

Deploying in Cluster

Reverse Proxy Router

Number of instances LB

Page 26: What monolith can learn from microservices?

@alexsotob26

Cloud Native Application

Page 27: What monolith can learn from microservices?

@alexsotob27

Infrastructure

sticky session

Shopping Cart User A

Page 28: What monolith can learn from microservices?

@alexsotob28

In-Memory Data Grid

In-Memory DataGridShopping Cart User A Shopping Cart User A

Page 29: What monolith can learn from microservices?

@alexsotob29

Release as Unicorns

Page 30: What monolith can learn from microservices?

@alexsotob30

Release as Unicorns

Build Dockerfile DeployBuild Container Testing in Production Release

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

Page 31: What monolith can learn from microservices?

@alexsotob31

Let’s Wind Down

Page 32: What monolith can learn from microservices?

@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

Page 33: What monolith can learn from microservices?

@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

Page 34: What monolith can learn from microservices?

@alexsotob34

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

You In The Near Future

Page 35: What monolith can learn from microservices?

@alexsotob35

Page 36: What monolith can learn from microservices?

@alexsotob36

Stats serviceUser Service

Awards Service

Question Service

Advertise Service

Question Service

Page 37: What monolith can learn from microservices?

@alexsotob37

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

Page 38: What monolith can learn from microservices?

@alexsotob38

Page 39: What monolith can learn from microservices?

“Long Live and Prosper to Monolith.”

—SPOCK

Page 40: What monolith can learn from microservices?

https://developers.redhat.com/

@alexsotob

[email protected]