Top Banner
Microservices w/ Spring Boot Mesut Can Gürle
27

Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

Oct 26, 2019

Download

Documents

dariahiddleston
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: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

Microservices w/ Spring Boot

Mesut Can Gürle

Page 2: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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

Coders● #793 @LKD● @mesutcang ● Jedi

Page 3: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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

Page 4: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

Burj Khalifa 828 m

Page 5: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 6: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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

Page 7: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

Advantages● Single codebase● Easy to develop / debug /

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

handle

Page 8: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 9: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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 w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 11: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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 w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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 w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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 w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 15: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 16: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

Problems● Service Discovery● Operational Overhead ● Distributed Systems are

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

Page 17: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 18: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 19: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 20: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 21: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 22: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 23: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 24: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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 w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages
Page 26: Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

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 w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large Codebase Many Components, no clear ownership Long deployment cycles . Advantages

Questions