Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Migrando um legado de 30M de Requests/Dia
Search
Gabriel Pereira
November 25, 2020
Programming
0
130
Migrando um legado de 30M de Requests/Dia
Apresentação realizada no primeirto meetup do Ada.rb
Gabriel Pereira
November 25, 2020
Tweet
Share
More Decks by Gabriel Pereira
See All by Gabriel Pereira
My Journey (so far) as a Software Developer
gabrielpedepera
0
65
RubyConf Brasil - 2018
gabrielpedepera
0
99
Agilidade e Scrum
gabrielpedepera
0
38
Intro - Ruby e Ruby on Rails
gabrielpedepera
0
52
CSM - O que eu aprendi?
gabrielpedepera
0
43
Programadores. Quem são eles? Onde vivem? O que comem?
gabrielpedepera
1
400
Coding Dojo. O que é ? E por que participar ?
gabrielpedepera
0
19
Reuniões Diárias - Você está fazendo isso errado !
gabrielpedepera
0
73
Other Decks in Programming
See All in Programming
時計仕掛けのCompose
mkeeda
1
250
VitePressを2週間使ってみた感想
hal_spidernight
0
100
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
240
Spring gRPC について / About Spring gRPC
mackey0225
0
200
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
4.3k
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
330
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
140
DROBEの生成AI活用事例 with AWS
ippey
0
120
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
200
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
120
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
10
1.7k
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
280
Featured
See All Featured
Bash Introduction
62gerente
610
210k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Side Projects
sachag
452
42k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Site-Speed That Sticks
csswizardry
3
310
Testing 201, or: Great Expectations
jmmastey
41
7.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.4k
KATA
mclloyd
29
14k
Scaling GitHub
holman
459
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
230
Transcript
25 de Novembro de 2020 Migrando um legado de 30M
de Requests/Dia 1º encontro do ada.rb
Gabriel Pereira @gabrielpedepera
None
None
None
None
None
Disclaimer
None
Domain
None
Challenge
None
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?
None
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; } }
None
None
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