microservices with spring · § monolith looks suddenly easy positives. thanks! @robonovotny....

32
Microservices with Spring @RoboNovotny

Upload: others

Post on 26-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

Microservices with Spring

@RoboNovotny

Page 2: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

monolith§ default development

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

Page 3: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

monolith?

Page 4: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

§ easily deploy changes?§ modularization?§ scalability?

Page 5: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

monolith?

Page 6: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

“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 · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

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

component

Page 8: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

SOA?

Page 9: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

SOA?unix utilities?

Page 10: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

microservices!

Page 11: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

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

microservice on slide

Page 12: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

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

real-life Spring microservice

Page 13: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

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 · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

DEMO

Page 15: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

640 GB RAM ought to be enough for everybody

running

Page 16: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

integration testsintegration testsintegration tests

testing

Page 17: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

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

3) prone to failure

communication

Page 18: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

HTTP | lightweight messaging#rabbitmq #kafka

“dumb pipes, smart endpoints”

Page 19: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

use transparent payloads#json

“dumb pipes, smart endpoints”

Page 20: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

your components will fail

epic fial

Page 21: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

establish monitoring very early

monitoring

Page 22: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

log cross-component communication#graylog #logstash

centralized logging

Page 23: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

which service will containthe functionality?

responsibility fights

Page 24: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

large-scale deployment requires centralized configuration

#consul #heureka

configuration

Page 25: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

continuous integration is a must#jenkins #travis

deployment

Page 26: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

one-line deployment#docker#ansible

large scale-deployment

Page 27: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

treat it like a binary dependencyuse proper repos

#nexus

shared libraries

Page 28: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

establish a versioning scheme#graylog #logstash

versioning

Page 29: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

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

time

experiences

Page 30: Microservices with Spring · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

§ 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 · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

§ 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 · § monolith looks suddenly easy positives. Thanks! @RoboNovotny. Title: eastcode-microservices Created Date: 11/24/2016 10:33:09 AM

Thanks!

@RoboNovotny