> For the complete documentation index, see [llms.txt](https://flapjax.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flapjax.gitbook.io/docs/hosting/environments/staging-environment-optional.md).

# Staging Environment (Optional)

A dedicated **staging environment** can be provisioned alongside your production environment to support testing, QA, preview workflows, and pre‑release validation. The staging environment mirrors the production architecture while offering the flexibility needed for development and experimentation.

***

### Purpose of a Staging Environment

A staging environment provides a safe, isolated space to:

* Test new features before they reach production
* Validate infrastructure changes
* Perform QA and regression testing
* Run automated or manual acceptance tests
* Reproduce and debug production issues without impacting live users

Staging environments help ensure stability and reliability by catching issues early.

***

### Architecture

The staging environment uses the same core components as production:

* Dedicated VPC
* EKS cluster and node groups
* Aurora RDS (or smaller instance sizes)
* Redis
* MongoDB (Atlas or self‑managed)
* Load balancers and ingress
* Secrets Manager
* Logging and monitoring

While the architecture matches production, resource sizes can be adjusted to optimise cost.

***

### Deployment Options

A staging environment can be provisioned under either hosting model:

#### **Option A — Flapjax’s AWS Account**

Flapjax provisions a separate staging environment inside our AWS infrastructure.

#### **Option B — Client’s AWS Account**

A staging environment is provisioned inside the client’s AWS sub-account, using the same Terraform automation as production.

***

### Cost Considerations

Staging environments generally operate with reduced resource sizes to minimise cost:

* Smaller instance types
* Reduced node counts
* Lower database capacity
* Spot-only node groups (where appropriate)

***

### Summary

A staging environment provides a reliable, isolated space for validating changes before deployment to production. It mirrors the production setup while allowing cost-efficient configurations and safe testing workflows.
