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
140
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
71
RubyConf Brasil - 2018
gabrielpedepera
0
100
Agilidade e Scrum
gabrielpedepera
0
42
Intro - Ruby e Ruby on Rails
gabrielpedepera
0
57
CSM - O que eu aprendi?
gabrielpedepera
0
46
Programadores. Quem são eles? Onde vivem? O que comem?
gabrielpedepera
1
430
Coding Dojo. O que é ? E por que participar ?
gabrielpedepera
0
23
Reuniões Diárias - Você está fazendo isso errado !
gabrielpedepera
0
79
Other Decks in Programming
See All in Programming
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
230
Data-Centric Kaggle
isax1015
2
760
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
CSC307 Lecture 03
javiergs
PRO
1
490
CSC307 Lecture 02
javiergs
PRO
1
770
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
CSC307 Lecture 08
javiergs
PRO
0
670
CSC307 Lecture 07
javiergs
PRO
0
550
「ブロックテーマでは再現できない」は本当か?
inc2734
0
740
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
110
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
100
Between Models and Reality
mayunak
1
180
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
A Tale of Four Properties
chriscoyier
162
24k
Automating Front-end Workflow
addyosmani
1371
200k
Designing for Timeless Needs
cassininazir
0
130
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
Discover your Explorer Soul
emna__ayadi
2
1.1k
Deep Space Network (abreviated)
tonyrice
0
46
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
53
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