environment and traffic pattern Production Staging • Integration tests • Load tests • Smoke test Pass & Release V 1.1 SQA Real users V 1.2 Rollback V 1.1 V 1.2
real traffic is the only way to reliably capture the request path Staging V 1.2 V 1.1 Sampling HTTP/HTTPS Replaying the requests to prod and staging Real users Production Compare the response, record and verify Pass & Release V 1.2
need to keep sync the database Staging V 1.2 V 1.1 Sampling HTTP/HTTPS Replaying the requests to prod and staging Real users Production Compare the response, record and verify Log out Failed!
products 9 You need to consider that… • Shadowing may be suitable for: 1. Idempotent services (冪等) 2. Stateless services (無狀態) 3. Or you have to keep in-sync the data from the prod database to the staging database
traffics 11 • It’s a Golang project which is based on WinPcap (Windows) • Ability to capture and replay(or accelerate) the traffics • Ability to plugin the middleware
traffics to the B site from files gor --input-file data/request_0.gor –output-http=http://staging -output-http="http://production" Gor listen Staging service //Capture traffics from the specific port and output the traffic files gor --input-raw :3000 -output-file= "data/request.gor" Prod service Listen port 3000 //Replay traffics to the B site in the real time gor –input-raw:3000 –output-http=http://staging -output-http="http://production" Traffic files
server gor --file-server :8800 //Capture the packages gor --input-raw :8800 -output-file=data/request.gor • Duplicate HTTPS packages + SSL termination + Gor file server Real users Nginx Gor file server Prod service Gor listen HTTPS Traffic files HTTPS HTTP