Skip to main content

State Management

Terraform's Approach to State Management

Terraform has long supported a wide variety of backend options for storing state, including:

  1. Local backends (storing state files on the local filesystem)
  2. Remote backends, such as:
    • Cloud provider-specific options (AWS S3, Azure Blob Storage, Google Cloud Storage)
    • Database systems (PostgreSQL, etcd)
    • Specialized services (Terraform Cloud, Terraform Enterprise)

This flexibility in backend choices has been a key factor in Terraform's widespread adoption across different environments and organizations. However, this approach comes with trade-offs ie increased complexity in maintaining and supporting multiple backend types

Mantis: Simplifying State Management

Mantis takes a different approach, aiming to simplify state management while maintaining flexibility:

Current Implementation

  • Mantis currently supports only local backends
  • Each Terraform task maps to a separate state file on disk, this reduces locking contention and simplifies understanding and debugging state issues.

Future Plans

  • The current implementation is a design choice that will evolve
  • This evolution will likely involve adapting the state management approach to better suit Kubernetes resources

Benefits of Mantis' Approach

  1. Simplified setup and configuration
  2. Easier debugging and state inspection during development
  3. Consistent behavior across different environments

Considerations

While Mantis' current approach simplifies many aspects of state management, users should be aware that:

  • Large-scale, distributed teams may need additional tooling for state collaboration
  • Transitioning from Terraform's remote backends to Mantis' local approach may require workflow adjustments

As Mantis evolves, the state management strategy will be refined to balance simplicity with the needs of complex, distributed infrastructure management.