Traffic Shadowing with Membrane API Gateway

Overview

Testing environments should mimic production as closely as possible. However, simply copying production data into test environments can be too static, leading to unrealistic test conditions. Realistic testing requires an endless stream of API calls with production-like timings.

A solution to this challenge is traffic shadowing, where API traffic from production is mirrored to other environments, such as test and QA. This allows test environments to receive the same traffic as production, ensuring that they are continuously and dynamically tested.

Solution

By using the shadowing plugin in Membrane API Gateway, you can divert API traffic from production to additional environments without affecting the main production flow. The production traffic is routed as usual, while identical copies of the requests are sent to test and QA environments. Only the response from the production environment is returned to the client, ensuring that test and QA responses do not interfere with production.


Ingredients


Configuration

<api port="2000">
    <shadowing>
        <target host="backend.test" port="8080"/>
        <target host="backend.qa" port="8080"/>
    </shadowing>
    <target url="https://backend.prod"/>
</api>
Explanation:

Benefits of Traffic Shadowing