27
Microservices w/ Spring Boot Mesut Can Gürle

Microservices with spring boot

Embed Size (px)

Citation preview

Page 1: Microservices  with spring boot

Microservices w/ Spring Boot

Mesut Can Gürle

Page 2: Microservices  with spring boot

● Extreme Programmer● Open Source Enthusiast● PhD Student● Devops Turkey, Istanbul

Coders● #793 @LKD● @mesutcang ● Jedi

Page 3: Microservices  with spring boot

Agenda ❏ Monolithic Architecture❏ Advantages & Disadvantages❏ Microservice Architecture❏ Advantages & Disadvantages ❏ Suggestions❏ Spring Boot Solution

Page 4: Microservices  with spring boot

Burj Khalifa 828 m

Page 5: Microservices  with spring boot
Page 6: Microservices  with spring boot

Characteristics● Large Codebase● Many Components, no clear ownership● Long deployment cycles

Page 7: Microservices  with spring boot

Advantages● Single codebase● Easy to develop / debug /

deploy● Good IDE support● Easy to scale horizontally ● Ops team can efficiently

handle

Page 8: Microservices  with spring boot
Page 9: Microservices  with spring boot

Problems● As codebase increases …● Tends to increase “tight

coupling” between components

● All components have to be coded in the same language

● Scaling is “undifferentiated”

Page 10: Microservices  with spring boot
Page 11: Microservices  with spring boot

Characteristics● Many smaller (fine grained), clearly scoped services● Single Responsibility Principle● Domain Driven Development● Bounded Context● Independently Managed● Clear ownership for each service● Typically need/adopt the “DevOps” model

Page 12: Microservices  with spring boot

Unix philosophy● Write programs that do one thing and do it well.● Write programs to work together.

$ du | sort -nr |head -n 2 | tail -n 1

Page 13: Microservices  with spring boot

Why● Faster and simpler deployments and rollbacks● Independent Speed of Delivery ● Right framework / tool / language for each domain● Recommendation component using Python?, Catalog Service in Java ..● Greater Resiliency● Fault Isolation● Better Availability

Page 14: Microservices  with spring boot
Page 15: Microservices  with spring boot
Page 16: Microservices  with spring boot

Problems● Service Discovery● Operational Overhead ● Distributed Systems are

inherently Complex● Service Versioning● Testing● Fan out of Requests

Page 17: Microservices  with spring boot
Page 18: Microservices  with spring boot
Page 19: Microservices  with spring boot
Page 20: Microservices  with spring boot
Page 21: Microservices  with spring boot
Page 22: Microservices  with spring boot
Page 23: Microservices  with spring boot
Page 24: Microservices  with spring boot

Why Spring Boot?● Stand-alone Spring applications ● Embedded Tomcat or Jetty ● Starter dependencies ● Automatic configuration ● Production-ready environment ● No code generation / no XML config

Page 25: Microservices  with spring boot
Page 26: Microservices  with spring boot

Actuator● Adds common non-functional features to your application and exposes

MVC endpoints to interact with them. ● Endpoints: /metrics, /health, /trace, /dump,

/shutdown, /beans Audit /info ● If embedded in a web app or web service can use the same port or a

different one (and a different network interface).

Page 27: Microservices  with spring boot

Questions