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
68
RubyConf Brasil - 2018
gabrielpedepera
0
100
Agilidade e Scrum
gabrielpedepera
0
40
Intro - Ruby e Ruby on Rails
gabrielpedepera
0
54
CSM - O que eu aprendi?
gabrielpedepera
0
44
Programadores. Quem são eles? Onde vivem? O que comem?
gabrielpedepera
1
420
Coding Dojo. O que é ? E por que participar ?
gabrielpedepera
0
21
Reuniões Diárias - Você está fazendo isso errado !
gabrielpedepera
0
76
Other Decks in Programming
See All in Programming
Flutterで分数(Fraction)を表示する方法
koukimiura
0
140
Six and a half ridiculous things to do with Quarkus
hollycummins
0
210
One Enishi After Another
snoozer05
PRO
0
150
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
140
スキーマ駆動で、Zod OpenAPI Honoによる、API開発するために、Hono Takibiというライブラリを作っている
nakita628
0
320
オープンソースソフトウェアへの解像度🔬
utam0k
17
3.1k
品質ワークショップをやってみた
nealle
0
630
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
120
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
8.5k
コード生成なしでモック処理を実現!ovechkin-dm/mockioで学ぶメタプログラミング
qualiarts
0
260
CSC305 Lecture 10
javiergs
PRO
0
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
230
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
45
7.7k
The World Runs on Bad Software
bkeepers
PRO
72
11k
KATA
mclloyd
PRO
32
15k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
116
20k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
640
Navigating Team Friction
lara
190
15k
YesSQL, Process and Tooling at Scale
rocio
173
15k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Build your cross-platform service in a week with App Engine
jlugia
233
18k
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