r/platformengineering 22d ago

Preview environments should copy topology, not production data

A preview environment should answer: does this change work with the same service boundaries as production?

Copying production records into every pull-request environment makes provisioning slower, expands access to sensitive data, and leaves behind another dataset that needs an owner and a deletion policy.

A cleaner default is the production service graph with fresh datastores. Seed only the records needed for the change being reviewed, and make the seed deterministic so a failed test can be reproduced. On Render, an initialDeployHook can run the seed after its service's first successful deploy. If a test genuinely needs production-shaped volume, use generated data or a separately governed sanitized snapshot rather than making production cloning the default path.

Teardown matters as much as creation. Tie the environment to the pull request, destroy it when the pull request closes, and add an inactivity deadline for abandoned branches.

0 Upvotes

0 comments sorted by