SlideShare a Scribd company logo
1 of 38
Download to read offline
Add Title
Subtitle
Building on spring
boot lastminute.com
microservices way
Michele Orsi and Luca Viola @Spring IO, 18-19 May 2017
The relevant and inspiring travel company
2
A tech company to the core
3
● tech department: 300+ people
● applications: ~150
● database: ~180 database schemas and ~50TB of data
● servers: 1400 VMs, 300 physical machines
● locations: Chiasso, Milan, Madrid, London, Bengaluru
At the beginning DEVs created the Monolith
4
credits https://www.flickr.com/photos/southtopia/5702790189
5
List of
flights
What’s the most critical part in the monolith?
Flight
selected
Checkout
page
6
1. identify a feature and a business opportunity
○ new UX on checkout page
2. extract and wrap into a service
3. measure improvements
(Agile procedure to prepare the new development)
The first process of extraction
7
● high coupling from
○ a functional point of view
○ an architectural point of view
● configuration hell
○ Tomcat
○ env variables, properties, etc ..
● dependency hell
○ different libraries/versions
Monolith: the micro-problems
8
● well known inside our company
● simplify development
● bounded configuration
○ application.yaml
○ java-opts.yaml
● self-contained deployability
○ tomcat now inside the jar
Spring boot at the core
9
… and it worked!
credits https://www.pexels.com/photo/hand-thumbs-up-thumb-black-and-white-8252/
Improvements
● conversion improved
● service is easier to
○ maintain
○ make experiment with
○ create
● developer friendly
11
.. ready to follow the micro-service way!
credits https://www.pexels.com/photo/women-standing-on-race-track-while-preparing-for-a-run-race-during-daytime-28554/
Issues (1): low-level
13
● LACK OF alignment across micro-service
○ solutions
○ libraries
○ logging/tracing
○ monitoring/alerting
● LACK OF awareness about OPS
● LACK OF alignment across environments
Issues (2): higher perspective
14
● reinventing the wheel
● different tools for same issues
● weak contribution model
○ many silos
Our objectives
15
● hexagonal architecture at the core
● software alignment
● centralized monitoring/logging, with alerts
● zero downtime deployment
● automation everywhere
A year-long endeavour
16
● build the first company framework
● build a new, modern infrastructure
● migrate the search (flight/hotel) product there
... without:
● impacting the business
Two new teams: platform and devops
17
credits https://www.pexels.com/photo/blue-lego-toy-beside-orange-and-white-lego-toy-standing-during-daytime-105822/
Team objectives
18
● Platform team
○ servant leadership (no ivory tower)
○ develop the framework and common services
○ support adoption
● Devops team
○ focus on automation
■ building pipelines (CI + CD)
Hexagonal Architecture (Port and Adapters)
19
● designed for testability
● independent from tech
(framework, DB, client for
external services)
● independent from UI
Tailored service template (cit. Thoughtworks)
20
[..] which can be used to quickly seed new services,
pre-configured to operate within that organization's
production environment [..] This is a very useful technique
for encouraging collaborative evolution while retaining
lightweight governance
Platform framework: a thin layer
21
● common logging format
● common metrics (monitoring/alerting)
● common tracing format
● centralized dependency management
● smart HTTP Client
● Kubernetes lifecycle (graceful startup/shutdown)
Platform framework: based on Spring Boot
22
● self-contained uber jar
● easier to debug
● configuration is now inside the artifact
● run from command line
● pragmatic test approach, also for integration tests
Complexity in the new infrastructure
23
NODE
1
NODE
70
...
APP3-PRODUCTION
APP2-PRODUCTION
cluster
pod pod
pod
BASE OS
JAVA SRE
START/STOP
JAR APP
Healthy use case: self-healing
24
"When a container is dead I will restart it"
"When a container is ready I will forward traffic to it"
A common solution for all the micro-services
25
/liveness
● when tomcat container is up
● when ratio active/max threads < threshold
/readiness
● all the startup jobs have run
.. ongoing never-ending research ..
Graceful startup: ONE implementation
26
@Autowired(required = false)
private CompletableFuture run(Collection<AsyncJob> jobs)
{
return allOf(jobs.stream().map(job -> runAsync(() -> job.execute()))
.toArray(CompletableFuture[]::new))
.thenAccept(this::raiseReadinessUp)
.exceptionally(this::shutdown);
}
JobsExecutor.java
Platform framework adoption
27
Platform framework adoption
credits https://www.pexels.com/photo/landscape-nature-holiday-vacation-92870/
Platform framework from a team perspective (1)
28
● focus on application domain
● focus on features to develop
● better understanding of what happens inside
Platform framework from a team perspective (2)
29
● always aligned with latest technologies
● lightweight governance
● a platform that encourages contribution
Platform framework from platform engineering perspective
30
● where do the problems lay?
○ not anymore in the smaller components
○ now at the border
● Check how different micro-services work together
○ (Only in case of centralised logging and monitoring)
Innovation: KeyValueStorage port example
31
public interface KeyValueStorageService
{
boolean put(ValueStored data);
ValueStored get(String key);
void delete(String key);
Date findLastUpdateById(String key);
}
KeyValueStorageService.java
Innovation
32
● KeyValueStorage
○ Mysql adapter
○ Google BigTable adapter (in the cloud)
● easy to change tech part, maintaining domain one
● PlatformFw
○ initializes application (main partition)
○ is the platform adapter
Evolution
33
● 1st step: align tech services
○ distributed cache
○ distributed session
● 2nd step: align business components
○ GIS library
○ money library
○ currency library
Platform framework contribution model
34
● initially perceived as a foreign body
○ .. but it really solved problems
● scale
○ on common efforts
○ sharing solutions across organisation
○ in a more structured way
● sandbox model before platform framework
Automate Everything: pipeline DSL
35
microservice = factory.newDeployRequest()
.withArtifact("com.lastminute.application1",2)
.fromGitRepo("git.lastminute.com/team/application")
lmn_deployCanaryStrategy(microservice,"qa")
lmn_deployCanaryStrategy(microservice,"preview")
lmn_deployCanaryStrategy(microservice,"production")
pipeline
Automate Everything: pipeline
36
pull
jar
build
docker
(gate)
QA
canary
(gate)
QA
stable
(gate)
PREV
canary
(gate)
PREV
stable
(gate)
PROD
canary
(gate)
PROD
stable
● git push
○ Continuous Integration
○ Continuous Delivery
Give me the numbers!
37
● app migration in 1/2 weeks, 1/2 people
● 40 micro-services migrated in 6 months
● 5K req/sec generates 1.5M metrics/minute flows
● whole pipeline runs in 16 minutes
Thanks!
michele.orsi@lastminute.com
luca.viola@lastminute.com

More Related Content

What's hot

Marble Virtual Globe for Developers - Factsheet
Marble Virtual Globe for Developers - FactsheetMarble Virtual Globe for Developers - Factsheet
Marble Virtual Globe for Developers - FactsheetMarble Virtual Globe
 
Building container images - Dockerfiles, Google/Kaniko, Projectatomic/buildah...
Building container images - Dockerfiles, Google/Kaniko, Projectatomic/buildah...Building container images - Dockerfiles, Google/Kaniko, Projectatomic/buildah...
Building container images - Dockerfiles, Google/Kaniko, Projectatomic/buildah...CloudYuga
 
Kolla Project Update (Vancouver 2018)
Kolla Project Update (Vancouver 2018)Kolla Project Update (Vancouver 2018)
Kolla Project Update (Vancouver 2018)Paul Bourke
 
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Giovanni Toraldo
 
Is WebAssembly the killer of JavaScript?
Is WebAssembly the killer of JavaScript?Is WebAssembly the killer of JavaScript?
Is WebAssembly the killer of JavaScript?Boyan Mihaylov
 
WKP 2.4 Delivers GitOps Anywhere
WKP 2.4 Delivers GitOps AnywhereWKP 2.4 Delivers GitOps Anywhere
WKP 2.4 Delivers GitOps AnywhereWeaveworks
 
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshotsEclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshotssimonscholz
 

What's hot (8)

The Other WatchKit
The Other WatchKitThe Other WatchKit
The Other WatchKit
 
Marble Virtual Globe for Developers - Factsheet
Marble Virtual Globe for Developers - FactsheetMarble Virtual Globe for Developers - Factsheet
Marble Virtual Globe for Developers - Factsheet
 
Building container images - Dockerfiles, Google/Kaniko, Projectatomic/buildah...
Building container images - Dockerfiles, Google/Kaniko, Projectatomic/buildah...Building container images - Dockerfiles, Google/Kaniko, Projectatomic/buildah...
Building container images - Dockerfiles, Google/Kaniko, Projectatomic/buildah...
 
Kolla Project Update (Vancouver 2018)
Kolla Project Update (Vancouver 2018)Kolla Project Update (Vancouver 2018)
Kolla Project Update (Vancouver 2018)
 
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
 
Is WebAssembly the killer of JavaScript?
Is WebAssembly the killer of JavaScript?Is WebAssembly the killer of JavaScript?
Is WebAssembly the killer of JavaScript?
 
WKP 2.4 Delivers GitOps Anywhere
WKP 2.4 Delivers GitOps AnywhereWKP 2.4 Delivers GitOps Anywhere
WKP 2.4 Delivers GitOps Anywhere
 
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshotsEclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
 

Similar to Building on spring boot lastminute.com microservices way (Spring IO Barcelona 2017)

SACON NY 19: "Creating an effective developer experience for cloud-native apps"
SACON NY 19: "Creating an effective developer experience for cloud-native apps"SACON NY 19: "Creating an effective developer experience for cloud-native apps"
SACON NY 19: "Creating an effective developer experience for cloud-native apps"Daniel Bryant
 
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"Daniel Bryant
 
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...Daniel Bryant
 
Velocity NY 2018 "The Cloud Native Developer Workflow"
Velocity NY 2018 "The Cloud Native Developer Workflow"Velocity NY 2018 "The Cloud Native Developer Workflow"
Velocity NY 2018 "The Cloud Native Developer Workflow"Daniel Bryant
 
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...Daniel Bryant
 
Anypoint Tools and MuleSoft Automation (DRAFT).pptx
Anypoint Tools and MuleSoft Automation (DRAFT).pptxAnypoint Tools and MuleSoft Automation (DRAFT).pptx
Anypoint Tools and MuleSoft Automation (DRAFT).pptxAkshata Sawant
 
MuleSoft Meetup #9 - Anypoint Tools and MuleSoft Automation (FINAL).pptx
MuleSoft Meetup #9 - Anypoint Tools and MuleSoft Automation (FINAL).pptxMuleSoft Meetup #9 - Anypoint Tools and MuleSoft Automation (FINAL).pptx
MuleSoft Meetup #9 - Anypoint Tools and MuleSoft Automation (FINAL).pptxSteve Clarke
 
JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...
JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...
JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...Daniel Bryant
 
Apache Airflow in Production
Apache Airflow in ProductionApache Airflow in Production
Apache Airflow in ProductionRobert Sanders
 
Sprint 50 review
Sprint 50 reviewSprint 50 review
Sprint 50 reviewManageIQ
 
FORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
FORWARD 5 Key Highlights and Product Updates - Philadelphia ChapterFORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
FORWARD 5 Key Highlights and Product Updates - Philadelphia ChapterDiana Gray, MBA
 
Transforming mission-critical applications on mainframes for innovation
Transforming mission-critical applications on mainframes for innovationTransforming mission-critical applications on mainframes for innovation
Transforming mission-critical applications on mainframes for innovationEranea
 
Journey to Containerized Application / Google Container Engine
Journey to Containerized Application / Google Container EngineJourney to Containerized Application / Google Container Engine
Journey to Containerized Application / Google Container EngineGoogle Cloud Platform - Japan
 

Similar to Building on spring boot lastminute.com microservices way (Spring IO Barcelona 2017) (20)

SACON NY 19: "Creating an effective developer experience for cloud-native apps"
SACON NY 19: "Creating an effective developer experience for cloud-native apps"SACON NY 19: "Creating an effective developer experience for cloud-native apps"
SACON NY 19: "Creating an effective developer experience for cloud-native apps"
 
Sprint 68
Sprint 68Sprint 68
Sprint 68
 
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"
muCon 2019: "Creating an Effective Developer Experience for Cloud-Native Apps"
 
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
 
Sprint 62
Sprint 62Sprint 62
Sprint 62
 
Sprint 54
Sprint 54Sprint 54
Sprint 54
 
Velocity NY 2018 "The Cloud Native Developer Workflow"
Velocity NY 2018 "The Cloud Native Developer Workflow"Velocity NY 2018 "The Cloud Native Developer Workflow"
Velocity NY 2018 "The Cloud Native Developer Workflow"
 
Sprint 60
Sprint 60Sprint 60
Sprint 60
 
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
 
Anypoint Tools and MuleSoft Automation (DRAFT).pptx
Anypoint Tools and MuleSoft Automation (DRAFT).pptxAnypoint Tools and MuleSoft Automation (DRAFT).pptx
Anypoint Tools and MuleSoft Automation (DRAFT).pptx
 
MuleSoft Meetup #9 - Anypoint Tools and MuleSoft Automation (FINAL).pptx
MuleSoft Meetup #9 - Anypoint Tools and MuleSoft Automation (FINAL).pptxMuleSoft Meetup #9 - Anypoint Tools and MuleSoft Automation (FINAL).pptx
MuleSoft Meetup #9 - Anypoint Tools and MuleSoft Automation (FINAL).pptx
 
JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...
JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...
JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...
 
Sprint 53
Sprint 53Sprint 53
Sprint 53
 
Apache Airflow in Production
Apache Airflow in ProductionApache Airflow in Production
Apache Airflow in Production
 
Sprint 50 review
Sprint 50 reviewSprint 50 review
Sprint 50 review
 
Sprint 65
Sprint 65Sprint 65
Sprint 65
 
FORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
FORWARD 5 Key Highlights and Product Updates - Philadelphia ChapterFORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
FORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
 
Transforming mission-critical applications on mainframes for innovation
Transforming mission-critical applications on mainframes for innovationTransforming mission-critical applications on mainframes for innovation
Transforming mission-critical applications on mainframes for innovation
 
Journey to Containerized Application / Google Container Engine
Journey to Containerized Application / Google Container EngineJourney to Containerized Application / Google Container Engine
Journey to Containerized Application / Google Container Engine
 
Promise of DevOps
Promise of DevOpsPromise of DevOps
Promise of DevOps
 

Recently uploaded

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Building on spring boot lastminute.com microservices way (Spring IO Barcelona 2017)

  • 1. Add Title Subtitle Building on spring boot lastminute.com microservices way Michele Orsi and Luca Viola @Spring IO, 18-19 May 2017
  • 2. The relevant and inspiring travel company 2
  • 3. A tech company to the core 3 ● tech department: 300+ people ● applications: ~150 ● database: ~180 database schemas and ~50TB of data ● servers: 1400 VMs, 300 physical machines ● locations: Chiasso, Milan, Madrid, London, Bengaluru
  • 4. At the beginning DEVs created the Monolith 4 credits https://www.flickr.com/photos/southtopia/5702790189
  • 5. 5
  • 6. List of flights What’s the most critical part in the monolith? Flight selected Checkout page 6
  • 7. 1. identify a feature and a business opportunity ○ new UX on checkout page 2. extract and wrap into a service 3. measure improvements (Agile procedure to prepare the new development) The first process of extraction 7
  • 8. ● high coupling from ○ a functional point of view ○ an architectural point of view ● configuration hell ○ Tomcat ○ env variables, properties, etc .. ● dependency hell ○ different libraries/versions Monolith: the micro-problems 8
  • 9. ● well known inside our company ● simplify development ● bounded configuration ○ application.yaml ○ java-opts.yaml ● self-contained deployability ○ tomcat now inside the jar Spring boot at the core 9
  • 10. … and it worked! credits https://www.pexels.com/photo/hand-thumbs-up-thumb-black-and-white-8252/
  • 11. Improvements ● conversion improved ● service is easier to ○ maintain ○ make experiment with ○ create ● developer friendly 11
  • 12. .. ready to follow the micro-service way! credits https://www.pexels.com/photo/women-standing-on-race-track-while-preparing-for-a-run-race-during-daytime-28554/
  • 13. Issues (1): low-level 13 ● LACK OF alignment across micro-service ○ solutions ○ libraries ○ logging/tracing ○ monitoring/alerting ● LACK OF awareness about OPS ● LACK OF alignment across environments
  • 14. Issues (2): higher perspective 14 ● reinventing the wheel ● different tools for same issues ● weak contribution model ○ many silos
  • 15. Our objectives 15 ● hexagonal architecture at the core ● software alignment ● centralized monitoring/logging, with alerts ● zero downtime deployment ● automation everywhere
  • 16. A year-long endeavour 16 ● build the first company framework ● build a new, modern infrastructure ● migrate the search (flight/hotel) product there ... without: ● impacting the business
  • 17. Two new teams: platform and devops 17 credits https://www.pexels.com/photo/blue-lego-toy-beside-orange-and-white-lego-toy-standing-during-daytime-105822/
  • 18. Team objectives 18 ● Platform team ○ servant leadership (no ivory tower) ○ develop the framework and common services ○ support adoption ● Devops team ○ focus on automation ■ building pipelines (CI + CD)
  • 19. Hexagonal Architecture (Port and Adapters) 19 ● designed for testability ● independent from tech (framework, DB, client for external services) ● independent from UI
  • 20. Tailored service template (cit. Thoughtworks) 20 [..] which can be used to quickly seed new services, pre-configured to operate within that organization's production environment [..] This is a very useful technique for encouraging collaborative evolution while retaining lightweight governance
  • 21. Platform framework: a thin layer 21 ● common logging format ● common metrics (monitoring/alerting) ● common tracing format ● centralized dependency management ● smart HTTP Client ● Kubernetes lifecycle (graceful startup/shutdown)
  • 22. Platform framework: based on Spring Boot 22 ● self-contained uber jar ● easier to debug ● configuration is now inside the artifact ● run from command line ● pragmatic test approach, also for integration tests
  • 23. Complexity in the new infrastructure 23 NODE 1 NODE 70 ... APP3-PRODUCTION APP2-PRODUCTION cluster pod pod pod BASE OS JAVA SRE START/STOP JAR APP
  • 24. Healthy use case: self-healing 24 "When a container is dead I will restart it" "When a container is ready I will forward traffic to it"
  • 25. A common solution for all the micro-services 25 /liveness ● when tomcat container is up ● when ratio active/max threads < threshold /readiness ● all the startup jobs have run .. ongoing never-ending research ..
  • 26. Graceful startup: ONE implementation 26 @Autowired(required = false) private CompletableFuture run(Collection<AsyncJob> jobs) { return allOf(jobs.stream().map(job -> runAsync(() -> job.execute())) .toArray(CompletableFuture[]::new)) .thenAccept(this::raiseReadinessUp) .exceptionally(this::shutdown); } JobsExecutor.java
  • 27. Platform framework adoption 27 Platform framework adoption credits https://www.pexels.com/photo/landscape-nature-holiday-vacation-92870/
  • 28. Platform framework from a team perspective (1) 28 ● focus on application domain ● focus on features to develop ● better understanding of what happens inside
  • 29. Platform framework from a team perspective (2) 29 ● always aligned with latest technologies ● lightweight governance ● a platform that encourages contribution
  • 30. Platform framework from platform engineering perspective 30 ● where do the problems lay? ○ not anymore in the smaller components ○ now at the border ● Check how different micro-services work together ○ (Only in case of centralised logging and monitoring)
  • 31. Innovation: KeyValueStorage port example 31 public interface KeyValueStorageService { boolean put(ValueStored data); ValueStored get(String key); void delete(String key); Date findLastUpdateById(String key); } KeyValueStorageService.java
  • 32. Innovation 32 ● KeyValueStorage ○ Mysql adapter ○ Google BigTable adapter (in the cloud) ● easy to change tech part, maintaining domain one ● PlatformFw ○ initializes application (main partition) ○ is the platform adapter
  • 33. Evolution 33 ● 1st step: align tech services ○ distributed cache ○ distributed session ● 2nd step: align business components ○ GIS library ○ money library ○ currency library
  • 34. Platform framework contribution model 34 ● initially perceived as a foreign body ○ .. but it really solved problems ● scale ○ on common efforts ○ sharing solutions across organisation ○ in a more structured way ● sandbox model before platform framework
  • 35. Automate Everything: pipeline DSL 35 microservice = factory.newDeployRequest() .withArtifact("com.lastminute.application1",2) .fromGitRepo("git.lastminute.com/team/application") lmn_deployCanaryStrategy(microservice,"qa") lmn_deployCanaryStrategy(microservice,"preview") lmn_deployCanaryStrategy(microservice,"production") pipeline
  • 37. Give me the numbers! 37 ● app migration in 1/2 weeks, 1/2 people ● 40 micro-services migrated in 6 months ● 5K req/sec generates 1.5M metrics/minute flows ● whole pipeline runs in 16 minutes