# Ephemeral Environments

* Temporary deployments that have self-contained versions of your application, generally every feature branch

### How do databases work in ephemeral environments?

* Prepopulated data - it contains representative, anonymized data - to pass security audits, all Personally-Identifiable Information must be scrubbed from databases to be used in such envs
* Undoable - if data is deleted or modified, it should be easy to reset the database to its original state
* Migrated - Database uses the schema currently used in PROD and has proposed migrations run against it
  * On of the most common cases of problems uncovered by ephemeral environments are broken or non-preformat database migrations

### Ephemeral environments lifecycle management:

* Option A: tie the lifecycle to the life of a pull request or merge request
* Option B: Create a ChatOps bot that allows creating a new environment for a specific branch with a small timeout
* Option C: Create an ephemeral environment for every commit, and hibernate them the second they are provisioned, then wake them up as they are required&#x20;

### DYI ephemeral environments:

* Budget 6-12 months of engineering time for setup, then dedicated person for managing these envs
* Will need clould service provider
* Create slackbot that responds to <mark style="color:orange;">`/env-create-for-mybrach <link>`</mark>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/general-concepts/devops/ephemeral-environments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
