SlideShare a Scribd company logo
1 of 19
Download to read offline
A novel approach to
Microservices with
Varnish
Microservices (1/2)
• Application pattern used for the last couple of years
• Reduces complexity by having small (micro) services that
are relatively simple
• Distributed application
Microservices (2/2)
• A loose collection of RESTful APIs
• One or more applications
• Potentially on different platforms
• Typically each service has its own infrastructure
• Services are typically synchronous
quux
zoo
baz
bar
foo service
directory
“Where is Foo?”
Potential pitfalls
• Performance on large scale microservices is tricky -
caching is always used
• Debugging distributed systems is hard
• Specifically distributed state can make it a lot harder
• As of 2007:
• Had a monolithic Java application CMS
• Tons of state and caching inside the application
• Deployment was a pain
• Debugging was a pain
New architecture
• Many small services
• All services should be completely stateless
• Potentially leveraging different languages and runtimes for
each application if needed
• UseVarnish for caching of all data
• Support dynamic relationships between objects
quux
zoo
baz
bar
foo
varnish
quux
ing
baz
titl
art
varnish
Cache invalidation
• Primary data handled by CMS
• Derived data clearly marked as such
• HTTP headers used to tag cache metadata
X-KeyVCL
vcl 4.0;
import xkey;
backend default { .host = "192.0.2.11"; .port = "8080"; }
acl purgers {
"203.0.113.0"/24;
}
sub vcl_recv {
if (req.method == "PURGE") {
if (client.ip !~ purgers) {
return (synth(403, "Forbidden"));
}
set req.http.n-gone = xkey.purge(req.http.key);
# or: set req.http.n-gone = xkey.softpurge(req.http.key)
return (synth(200, "Invalidated "+req.http.n-gone+" objects"));
}
}
GET /api/v1/artdb/get_article/50052 HTTP/1.1
Host: foo.com

200 OK
Content-type: text/json
xkey: 50052
GET /api/v1/ingress/get_ingress/50052 HTTP/1.1
Host: foo.com


200 OK
Content-type: text/json
xkey: 50055
xkey: 50053 (derived from 50055)
Purging with x-key
PURGE /the/URL/doesnt/really/matter HTTP/1.1
Host: foo.com
Key: 50052

200 OK
(..)
n-gone: 3
Missing anything?
Results
• After about 10 years in production the architecture is still
very much relevant
• Statelessness has saved thousands of hours of debugging
• After replacing bans with x-key performance is still very
good
• Scaling stateless services up and down is effortless
thanks

More Related Content

What's hot

ServiceNow-Box Integration
ServiceNow-Box IntegrationServiceNow-Box Integration
ServiceNow-Box Integration
Nagendra B
 

What's hot (20)

OPEN'17_2_Customer Experience_Essent
OPEN'17_2_Customer Experience_EssentOPEN'17_2_Customer Experience_Essent
OPEN'17_2_Customer Experience_Essent
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
What’s the Deal with Containers, Anyway?
What’s the Deal with Containers, Anyway?What’s the Deal with Containers, Anyway?
What’s the Deal with Containers, Anyway?
 
Build your First IoT Application with IBM Watson IoT
Build your First IoT Application with IBM Watson IoTBuild your First IoT Application with IBM Watson IoT
Build your First IoT Application with IBM Watson IoT
 
Tech Talks Microservices
Tech Talks MicroservicesTech Talks Microservices
Tech Talks Microservices
 
Mule ESB Intro
Mule ESB IntroMule ESB Intro
Mule ESB Intro
 
Microservices with Spring
Microservices with SpringMicroservices with Spring
Microservices with Spring
 
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring Boot
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
DockerCon SF 2015: Networking Breakout
DockerCon SF 2015: Networking BreakoutDockerCon SF 2015: Networking Breakout
DockerCon SF 2015: Networking Breakout
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Application Rollout - Istio
Application Rollout - Istio Application Rollout - Istio
Application Rollout - Istio
 
Realistic Networking in generic multi-site Cloud Deployments
Realistic Networking in generic multi-site Cloud DeploymentsRealistic Networking in generic multi-site Cloud Deployments
Realistic Networking in generic multi-site Cloud Deployments
 
ServiceNow-Box Integration
ServiceNow-Box IntegrationServiceNow-Box Integration
ServiceNow-Box Integration
 
Women Who Code Connect 2018 Conference
Women Who Code Connect 2018 ConferenceWomen Who Code Connect 2018 Conference
Women Who Code Connect 2018 Conference
 
Developing Serverless Microservice in Rust
Developing Serverless Microservice in RustDeveloping Serverless Microservice in Rust
Developing Serverless Microservice in Rust
 
Python wsgi protocol
Python wsgi protocolPython wsgi protocol
Python wsgi protocol
 
Microservices
MicroservicesMicroservices
Microservices
 
Atomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsAtomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed Systems
 
Deploying microservices on AWS
Deploying microservices on AWSDeploying microservices on AWS
Deploying microservices on AWS
 

Viewers also liked

Secretarias, la mano derecha del poder.
Secretarias, la mano derecha del poder.Secretarias, la mano derecha del poder.
Secretarias, la mano derecha del poder.
Gill Johnson
 
انظمه التحكم ف الابواب
انظمه التحكم ف الابواب انظمه التحكم ف الابواب
انظمه التحكم ف الابواب
Manal Zain
 

Viewers also liked (20)

Secure content caching
Secure content cachingSecure content caching
Secure content caching
 
Varnishtest
VarnishtestVarnishtest
Varnishtest
 
Varnish plus con paywall avanzado en la voz de galicia
Varnish plus con paywall avanzado en la voz de galiciaVarnish plus con paywall avanzado en la voz de galicia
Varnish plus con paywall avanzado en la voz de galicia
 
Varnish extend introduction
Varnish extend introductionVarnish extend introduction
Varnish extend introduction
 
Varnish Extend demo
Varnish Extend demoVarnish Extend demo
Varnish Extend demo
 
DevoxxUK 2015 "The Seven Deadly Sins of Microservices (Full Version)"
DevoxxUK 2015 "The Seven Deadly Sins of Microservices (Full Version)"DevoxxUK 2015 "The Seven Deadly Sins of Microservices (Full Version)"
DevoxxUK 2015 "The Seven Deadly Sins of Microservices (Full Version)"
 
Bimodal IT: Shortcut to Innovation or Path to Dysfunction?
Bimodal IT: Shortcut to Innovation or Path to Dysfunction?Bimodal IT: Shortcut to Innovation or Path to Dysfunction?
Bimodal IT: Shortcut to Innovation or Path to Dysfunction?
 
INNOVATION BLUEPRINTS FOR BIMODAL IT
INNOVATION BLUEPRINTS FOR BIMODAL ITINNOVATION BLUEPRINTS FOR BIMODAL IT
INNOVATION BLUEPRINTS FOR BIMODAL IT
 
De idea a implementación con Varnish Plus
De idea a implementación con Varnish PlusDe idea a implementación con Varnish Plus
De idea a implementación con Varnish Plus
 
Secretarias, la mano derecha del poder.
Secretarias, la mano derecha del poder.Secretarias, la mano derecha del poder.
Secretarias, la mano derecha del poder.
 
SCOPE Certificate
SCOPE CertificateSCOPE Certificate
SCOPE Certificate
 
انظمه التحكم ف الابواب
انظمه التحكم ف الابواب انظمه التحكم ف الابواب
انظمه التحكم ف الابواب
 
Debugging varnish
Debugging varnishDebugging varnish
Debugging varnish
 
E-commerce use case
E-commerce use caseE-commerce use case
E-commerce use case
 
VCL - the logic and logistics
VCL - the logic and logisticsVCL - the logic and logistics
VCL - the logic and logistics
 
3582_0001
3582_00013582_0001
3582_0001
 
Lightning fast with Varnish
Lightning fast with VarnishLightning fast with Varnish
Lightning fast with Varnish
 
MSE
MSEMSE
MSE
 
Varnish TLS
Varnish TLSVarnish TLS
Varnish TLS
 
Weather
WeatherWeather
Weather
 

Similar to Microservices

Automating the build and deployment of legacy applications
Automating the build and deployment of legacy applicationsAutomating the build and deployment of legacy applications
Automating the build and deployment of legacy applications
Cachet Software Solutions Ltd
 

Similar to Microservices (20)

Service-oriented architecture
Service-oriented architectureService-oriented architecture
Service-oriented architecture
 
Microservices and Best Practices
Microservices and Best Practices Microservices and Best Practices
Microservices and Best Practices
 
Micro services and Containers
Micro services and ContainersMicro services and Containers
Micro services and Containers
 
Exploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeExploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscape
 
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.
 
Microservice intro
Microservice introMicroservice intro
Microservice intro
 
Microservices with Spring Cloud
Microservices with Spring CloudMicroservices with Spring Cloud
Microservices with Spring Cloud
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
 
6 microservice architecture
6 microservice architecture6 microservice architecture
6 microservice architecture
 
L'approccio ai microservizi secondo Service Fabric
L'approccio ai microservizi secondo Service FabricL'approccio ai microservizi secondo Service Fabric
L'approccio ai microservizi secondo Service Fabric
 
Massimo Bonanni - L'approccio ai microservizi secondo Service Fabric - Codemo...
Massimo Bonanni - L'approccio ai microservizi secondo Service Fabric - Codemo...Massimo Bonanni - L'approccio ai microservizi secondo Service Fabric - Codemo...
Massimo Bonanni - L'approccio ai microservizi secondo Service Fabric - Codemo...
 
Service fabric overview
Service fabric overviewService fabric overview
Service fabric overview
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
From 0 to syncing
From 0 to syncingFrom 0 to syncing
From 0 to syncing
 
1. Docker Introduction.pdf
1. Docker Introduction.pdf1. Docker Introduction.pdf
1. Docker Introduction.pdf
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservice
Developing Enterprise Applications for the Cloud, from Monolith to MicroserviceDeveloping Enterprise Applications for the Cloud, from Monolith to Microservice
Developing Enterprise Applications for the Cloud, from Monolith to Microservice
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
Developing Enterprise Applications for the Cloud,from Monolith to MicroservicesDeveloping Enterprise Applications for the Cloud,from Monolith to Microservices
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
 
Mq Lecture
Mq LectureMq Lecture
Mq Lecture
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
Automating the build and deployment of legacy applications
Automating the build and deployment of legacy applicationsAutomating the build and deployment of legacy applications
Automating the build and deployment of legacy applications
 

More from Varnish Software

More from Varnish Software (19)

Ask Me Anything on authentication & authorisation in Varnish
Ask Me Anything on authentication & authorisation in VarnishAsk Me Anything on authentication & authorisation in Varnish
Ask Me Anything on authentication & authorisation in Varnish
 
Boozt.com Use Case
Boozt.com Use CaseBoozt.com Use Case
Boozt.com Use Case
 
Akamai connector for varnish
Akamai connector for varnishAkamai connector for varnish
Akamai connector for varnish
 
Varnish High Availability
Varnish High AvailabilityVarnish High Availability
Varnish High Availability
 
PostNord: Copy On Write
PostNord: Copy On WritePostNord: Copy On Write
PostNord: Copy On Write
 
Varnish extend
Varnish extendVarnish extend
Varnish extend
 
Streaming with Varnish
Streaming with VarnishStreaming with Varnish
Streaming with Varnish
 
Edgestash
EdgestashEdgestash
Edgestash
 
What is new in varnish plus
What is new in varnish plusWhat is new in varnish plus
What is new in varnish plus
 
Cedexis introduction
Cedexis introductionCedexis introduction
Cedexis introduction
 
Access control
Access controlAccess control
Access control
 
Varnish cache en ocho pasos
Varnish cache en ocho pasosVarnish cache en ocho pasos
Varnish cache en ocho pasos
 
Detalles técnicos e impacto de negocio de varnish plus
Detalles técnicos e impacto de negocio de varnish plusDetalles técnicos e impacto de negocio de varnish plus
Detalles técnicos e impacto de negocio de varnish plus
 
VCL - the logic and logistics
VCL - the logic and logisticsVCL - the logic and logistics
VCL - the logic and logistics
 
Debugging forensics
Debugging forensicsDebugging forensics
Debugging forensics
 
SFR use case
SFR use caseSFR use case
SFR use case
 
Kering use case
Kering use caseKering use case
Kering use case
 
Handelsbanken use case
Handelsbanken use caseHandelsbanken use case
Handelsbanken use case
 
Setting up automated tasks
Setting up automated tasksSetting up automated tasks
Setting up automated tasks
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Microservices