SlideShare a Scribd company logo
1 of 41
Download to read offline
25 de Novembro de 2020
Migrando um legado
de 30M de Requests/Dia
1º encontro do ada.rb
Gabriel Pereira
@gabrielpedepera
Disclaimer
Domain
Challenge
Code
Consumer
REST APIs
Good Test Suite
Strategy
ctrl + c
ctrl + v
$ bundle exec rails server
Monitoring
How make sure that everything is
working correctly? 🤔
Diffy
Diffy
Diffy Interface
NGINX + Diffy
Monitoring
server {
listen 80;
server_name "nginx-diffy-proxy";
location / {
proxy_pass http://primary;
}
location /endpoint-to-be-migrated {
mirror /mirror;
mirror_request_body on;
add_header X-Will-Mirror 'Yes';
proxy_pass http://primary;
}
location = /mirror {
internal;
proxy_set_header X-Original-Host $host;
proxy_pass http://diffy$request_uri;
}
}
server {
listen 80;
server_name "nginx-diffy-proxy";
location / {
proxy_pass http://primary;
}
location /endpoint-to-be-migrated {
mirror /mirror;
mirror_request_body on;
add_header X-Will-Mirror 'Yes';
proxy_pass http://primary;
}
location = /mirror {
internal;
proxy_set_header X-Original-Host $host;
proxy_pass http://diffy$request_uri;
}
}
server {
listen 80;
server_name "nginx-diffy-proxy";
location / {
proxy_pass http://primary;
}
location /endpoint-to-be-migrated {
mirror /mirror;
mirror_request_body on;
add_header X-Will-Mirror 'Yes';
proxy_pass http://primary;
}
location = /mirror {
internal;
proxy_set_header X-Original-Host $host;
proxy_pass http://diffy$request_uri;
}
}
server {
listen 80;
server_name "nginx-diffy-proxy";
location / {
proxy_pass http://primary;
}
location /endpoint-to-be-migrated {
mirror /mirror;
mirror_request_body on;
add_header X-Will-Mirror 'Yes';
proxy_pass http://primary;
}
location = /mirror {
internal;
proxy_set_header X-Original-Host $host;
proxy_pass http://diffy$request_uri;
}
}
server {
listen 80;
server_name "nginx-diffy-proxy";
location / {
proxy_pass http://primary;
}
location /endpoint-to-be-migrated {
mirror /mirror;
mirror_request_body on;
add_header X-Will-Mirror 'Yes';
proxy_pass http://primary;
}
location = /mirror {
internal;
proxy_set_header X-Original-Host $host;
proxy_pass http://diffy$request_uri;
}
}
Diffy Interface
NGINX
Replacing the APIs
server {
listen 80;
server_name "nginx-diffy-proxy";
location / {
proxy_pass http://primary;
}
location /endpoint-to-be-migrated {
add_header X-Candidate-Service 'Yes';
proxy_pass http://candidate;
}
}
server {
listen 80;
server_name "nginx-diffy-proxy";
location / {
proxy_pass http://primary;
}
location /endpoint-to-be-migrated {
add_header X-Candidate-Service 'Yes';
proxy_pass http://candidate;
}
}
Questions?
Thank You !!
References
• https://gabrielpereira.dev/pt_br/2020/10/28/migrando-apis-utilizando-diffy-e-
nginx

• https://travelupdate.com/gladys-ingle-repairing-plane-video

• https://blog.twitter.com/engineering/en_us/a/2015/diffy-testing-services-
without-writing-tests.html

• https://www.softwaretestingmagazine.com/videos/regression-testing-with-
diffy

• https://medium.com/@rahulmuthu80/mirroring-incoming-web-traffic-with-
nginx-fit-devops-d688ddca7d30

More Related Content

Similar to Migrando um legado de 30M de Requests/Dia

Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...Geert van der Cruijsen
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with CapistranoRamazan K
 
Monitoring CloudStack and components
Monitoring CloudStack and componentsMonitoring CloudStack and components
Monitoring CloudStack and componentsShapeBlue
 
Nko workshop - node js crud & deploy
Nko workshop - node js crud & deployNko workshop - node js crud & deploy
Nko workshop - node js crud & deploySimon Su
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull RequestKasper Nissen
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebookguoqing75
 
NLIT 2011: Chef & Capistrano
NLIT 2011: Chef & CapistranoNLIT 2011: Chef & Capistrano
NLIT 2011: Chef & Capistranonickblah
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Altitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeAltitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeFastly
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year laterChristian Ortner
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecuritiesamiable_indian
 
Information security programming in ruby
Information security programming in rubyInformation security programming in ruby
Information security programming in rubyHiroshi Nakamura
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slidesDocker, Inc.
 
Introduction to Cloud Foundry #JJUG
Introduction to Cloud Foundry #JJUGIntroduction to Cloud Foundry #JJUG
Introduction to Cloud Foundry #JJUGToshiaki Maki
 
Api Design
Api DesignApi Design
Api Designsartak
 
How to Get Your Website Into the Cloud
How to Get Your Website Into the CloudHow to Get Your Website Into the Cloud
How to Get Your Website Into the CloudAll Things Open
 

Similar to Migrando um legado de 30M de Requests/Dia (20)

Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Monitoring CloudStack and components
Monitoring CloudStack and componentsMonitoring CloudStack and components
Monitoring CloudStack and components
 
Stacki and Chef at Pardot
Stacki and Chef at PardotStacki and Chef at Pardot
Stacki and Chef at Pardot
 
Nko workshop - node js crud & deploy
Nko workshop - node js crud & deployNko workshop - node js crud & deploy
Nko workshop - node js crud & deploy
 
Hadoop security
Hadoop securityHadoop security
Hadoop security
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
 
NLIT 2011: Chef & Capistrano
NLIT 2011: Chef & CapistranoNLIT 2011: Chef & Capistrano
NLIT 2011: Chef & Capistrano
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Altitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeAltitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the Edge
 
Stackato Presentation Techzone 2013
Stackato Presentation Techzone 2013Stackato Presentation Techzone 2013
Stackato Presentation Techzone 2013
 
Pyramid deployment
Pyramid deploymentPyramid deployment
Pyramid deployment
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
 
Information security programming in ruby
Information security programming in rubyInformation security programming in ruby
Information security programming in ruby
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Introduction to Cloud Foundry #JJUG
Introduction to Cloud Foundry #JJUGIntroduction to Cloud Foundry #JJUG
Introduction to Cloud Foundry #JJUG
 
Api Design
Api DesignApi Design
Api Design
 
How to Get Your Website Into the Cloud
How to Get Your Website Into the CloudHow to Get Your Website Into the Cloud
How to Get Your Website Into the Cloud
 

More from Gabriel Pereira

Intro - Ruby e Ruby on Rails
Intro - Ruby e Ruby on RailsIntro - Ruby e Ruby on Rails
Intro - Ruby e Ruby on RailsGabriel Pereira
 
Programadores. Quem são eles? Onde vivem? O que comem?
Programadores. Quem são eles? Onde vivem? O que comem?Programadores. Quem são eles? Onde vivem? O que comem?
Programadores. Quem são eles? Onde vivem? O que comem?Gabriel Pereira
 
Desenvolvimento de Aplicações Sociais com Ruby
Desenvolvimento de Aplicações Sociais com RubyDesenvolvimento de Aplicações Sociais com Ruby
Desenvolvimento de Aplicações Sociais com RubyGabriel Pereira
 

More from Gabriel Pereira (7)

RubyConf Brasil - 2018
RubyConf Brasil - 2018RubyConf Brasil - 2018
RubyConf Brasil - 2018
 
Intro - Ruby e Ruby on Rails
Intro - Ruby e Ruby on RailsIntro - Ruby e Ruby on Rails
Intro - Ruby e Ruby on Rails
 
Csm o quê eu aprendi?
Csm   o quê eu aprendi?Csm   o quê eu aprendi?
Csm o quê eu aprendi?
 
Programadores. Quem são eles? Onde vivem? O que comem?
Programadores. Quem são eles? Onde vivem? O que comem?Programadores. Quem são eles? Onde vivem? O que comem?
Programadores. Quem são eles? Onde vivem? O que comem?
 
Coding dojo
Coding dojoCoding dojo
Coding dojo
 
Daily Stand Up Meeting
Daily Stand Up MeetingDaily Stand Up Meeting
Daily Stand Up Meeting
 
Desenvolvimento de Aplicações Sociais com Ruby
Desenvolvimento de Aplicações Sociais com RubyDesenvolvimento de Aplicações Sociais com Ruby
Desenvolvimento de Aplicações Sociais com Ruby
 

Recently uploaded

Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburgmasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 

Recently uploaded (20)

Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 

Migrando um legado de 30M de Requests/Dia