Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Migrando um legado de 30M de Requests/Dia
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Gabriel Pereira
November 25, 2020
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Migrando um legado de 30M de Requests/Dia
Apresentação realizada no primeirto meetup do Ada.rb
Gabriel Pereira
November 25, 2020
More Decks by Gabriel Pereira
See All by Gabriel Pereira
My Journey (so far) as a Software Developer
gabrielpedepera
0
74
RubyConf Brasil - 2018
gabrielpedepera
0
110
Agilidade e Scrum
gabrielpedepera
0
47
Intro - Ruby e Ruby on Rails
gabrielpedepera
0
65
CSM - O que eu aprendi?
gabrielpedepera
0
50
Programadores. Quem são eles? Onde vivem? O que comem?
gabrielpedepera
1
440
Coding Dojo. O que é ? E por que participar ?
gabrielpedepera
0
40
Reuniões Diárias - Você está fazendo isso errado !
gabrielpedepera
0
89
Other Decks in Programming
See All in Programming
一人だけ、Kiroが静止する日
hideg
0
110
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
150
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
250
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
180
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.7k
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
290
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
560
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
120
アクセシビリティから考える情報設計
high_g_engineer
0
380
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
1
150
App Intentsのビルドプロセスを支える技術
kntkymt
0
390
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
410
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Crafting Experiences
bethany
1
340
Mobile First: as difficult as doing things right
swwweet
225
10k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
280
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
580
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