32
Microservices with Spring @RoboNovotny

Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

Microservices with Spring

@RoboNovotny

Page 2: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

monolith§ default development

mode§ easy to run§ easy to deploy§ easy to understand

Page 3: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

monolith?

Page 4: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

§ easily deploy changes?§ modularization?§ scalability?

Page 5: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

monolith?

Page 6: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

“routines are constructed on rational principles so that families fit together as building blocks. [you can] safely regard components as black boxes”-- M. D. McIlroy (1968)

Page 7: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

§ around business functionality§ easily replaceable§ easily maintainable§ explicit API

component

Page 8: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

SOA?

Page 9: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

SOA?unix utilities?

Page 10: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

microservices!

Page 11: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

§ low overhead§ replaceable§ maintainable§ explicit API§ designed for failure§ maintained by a single team§ …

microservice on slide

Page 12: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

“small executable Spring-Boot based JAR with REST API”

real-life Spring microservice

Page 13: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

versioning | repositories | deployment | continuous integration | integration testing | configuration management |

monitoring | expensive cross-component communication | failed

components | lots of RAM | API versioning | centralized logging |

responsibility fights

challenges

Page 14: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

DEMO

Page 15: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

640 GB RAM ought to be enough for everybody

running

Page 16: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

integration testsintegration testsintegration tests

testing

Page 17: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

cross-component communication 1) is expensive2) hard to test

3) prone to failure

communication

Page 18: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

HTTP | lightweight messaging#rabbitmq #kafka

“dumb pipes, smart endpoints”

Page 19: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

use transparent payloads#json

“dumb pipes, smart endpoints”

Page 20: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

your components will fail

epic fial

Page 21: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

establish monitoring very early

monitoring

Page 22: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

log cross-component communication#graylog #logstash

centralized logging

Page 23: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

which service will containthe functionality?

responsibility fights

Page 24: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

large-scale deployment requires centralized configuration

#consul #heureka

configuration

Page 25: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

continuous integration is a must#jenkins #travis

deployment

Page 26: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

one-line deployment#docker#ansible

large scale-deployment

Page 27: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

treat it like a binary dependencyuse proper repos

#nexus

shared libraries

Page 28: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

establish a versioning scheme#graylog #logstash

versioning

Page 29: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

§ expect high mental step to “micro”§ hellgate of tools opens§ juggle lots of challenges at the same

time

experiences

Page 30: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

§ enforces best practices§ allows scaling§ rewrite over maintain wins in long-

term§ makes you devops§ makes you polyglot§ monolith looks suddenly easy

positives

Page 31: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

§ enforces best practices§ allows scaling§ rewrite over maintain wins in long-

term§ makes you devops§ makes you polyglot§ monolith looks suddenly easy

positives

Page 32: Microservices with Spring - Ústav informatiky PF UPJŠnovotnyr/home/prezentacie/...Microservices with Spring @RoboNovotny monolith default development mode easy to run easy to deploy

Thanks!

@RoboNovotny