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
120
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
60
RubyConf Brasil - 2018
gabrielpedepera
0
89
Agilidade e Scrum
gabrielpedepera
0
32
Intro - Ruby e Ruby on Rails
gabrielpedepera
0
50
CSM - O que eu aprendi?
gabrielpedepera
0
34
Programadores. Quem são eles? Onde vivem? O que comem?
gabrielpedepera
1
390
Coding Dojo. O que é ? E por que participar ?
gabrielpedepera
0
17
Reuniões Diárias - Você está fazendo isso errado !
gabrielpedepera
0
58
Other Decks in Programming
See All in Programming
脱・初心者!脱・マネコン!AWS CDKを使ってみませんか!?
har1101
0
300
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
Ruby Function Composition
bkuhlmann
1
330
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
350
StreamlitとTerraformでデータカタログを作った話
gussan0223
0
300
Milestoner
bkuhlmann
1
400
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
340
CQRS/ES avec Symfony, c’est (trop) bien !
jeremyfreeagent
1
630
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
190
ONE WEDGE_company_guide
1wedge_one
0
380
Ruby GitHub Packages
bkuhlmann
0
620
雑に思考を整理する技術と効能
konifar
55
26k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
132
6.2k
A Philosophy of Restraint
colly
196
16k
Building Better People: How to give real-time feedback that sticks.
wjessup
354
18k
Done Done
chrislema
178
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
646
57k
Infographics Made Easy
chrislema
237
18k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Creatively Recalculating Your Daily Design Routine
revolveconf
209
11k
Principles of Awesome APIs and How to Build Them.
keavy
120
16k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
4 Signs Your Business is Dying
shpigford
175
21k
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