<p>I understand that blue-green deployment means having two versions of production code deployed. It allows us to test in production.</p>
<p>Assume that we have an e-commerce application, and both deployments are sharing a database.
Then someone testing the green deployment makes a purchase. This purchase will be recorded in the production database even though it was just a test.</p>
<p>How do you deal with this scenario? How do blue-green deployments handle database interactions in general?</p>

AAV
<p>I'm not sure what resources you're looking at, but at least in our organization, using Kubernetes, blue-green deployments are not used for &quot;canary testing&quot;, which is what you're referring to.  Blue-green deployments are used to facilitate smooth deployment switches.  During the process of deployment, the existing pods in the &quot;current color&quot; are still running while the pods in the &quot;target color&quot; are starting up and reaching readiness state.  The service doesn't switch over to the target color until the new pods in the target color are all ready.</p>
<p>Regarding how you would do that sort of thing with &quot;canary testing&quot;, I'd say that is completely application-specific.</p>
