Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large...

27
Microservices w/ Spring Boot Mesut Can Gürle

Transcript of Microservices w/ Spring Boot - ozgurwebgunleri.org.tr · Burj Khalifa 828 m. Characteristics Large...

Microservices w/ Spring Boot

Mesut Can Gürle

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

Coders● #793 @LKD● @mesutcang ● Jedi

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

Burj Khalifa 828 m

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

Advantages● Single codebase● Easy to develop / debug /

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

handle

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

coupling” between components

● All components have to be coded in the same language

● Scaling is “undifferentiated”

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

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

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

Problems● Service Discovery● Operational Overhead ● Distributed Systems are

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

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

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).

Questions