An important aspect of sandboxes concerns stateful resources. Certain resources such as databases and message queues may require extra isolation. As it may not be feasible to isolate them at the request level, you might need to deploy these stateful resources alongside the sandbox. But, resource management in the context of sandboxes is quite distinct from general resource management, because sandboxes are ephemeral: they come and go and are often expected to spin up in seconds. Thus, the resources tied to sandboxes are ephemeral too. At the same time, the idea of "resources" in this context can refer to multiple different things, from the provisioning of databases, message queues, S3 buckets, etc. to being able to run any custom logic associated with the lifecycle of a sandbox.
Here are some specific scenarios where resources are a good fit:
- There are database schema changes involved in the sandbox which are not yet part of the baseline environment.
- There is a specific seed dataset required to hermetically run a particular integration test scenario in a sandbox.
Resource management for Signadot Sandboxes is done using resource
plugins. If a resource plugin is set up and referenced
by a sandbox, the
create lifecycle methods of the plugin are invoked when the
sandbox is created, and the corresponding
delete methods are called when the
sandbox is deleted.
You can learn more about how to integrate resources within your sandboxes here.