Skip to main content

Deployment Modes

Defang provides three deployment modes: development, staging, and production. These modes allow you to balance cost and resiliency according to your needs.

  • Development: This mode is used for development and testing purposes. It typically involves less stringent resource allocations and may include debugging tools and verbose logging to aid in development.
  • Staging: This mode serves as a pre-production environment where applications are tested in conditions that closely mimic production. It helps in identifying issues that might not be apparent in the development environment.
  • Production: This mode is used for live deployments. It involves optimized configurations for performance, security, and reliability. Resource allocations are typically higher, and debugging tools are minimized to ensure stability.

Deployment Mode Comparison

FeatureDevelopmentStagingProduction
Build ResourcesBuilds will be run with 2x vCPUsBuilds will be run with 2x vCPUsBuilds will be run with 4x vCPUs
ComputeUsing spot instances(like development)On-demand instances
DatabasesDefang will provision resources optimized for burstable memory(like production)Defang will provision resources optimized for production
DeploymentPrevious deployments will be spun down before new deployments are spun up.(like production)Rolling updates will be used to deploy new versions. Defang will gradually replace services while maintaining at least the original number of replicas.
LoggingLogs retained for 1 day to save costs.Logs retained for 30 days for compliance.
Networking(like production)Defang will provision a NAT gateway.
Load BalancingHTTP redirect to HTTPS using 302 FoundTermination Protection will be enabled; logs are retained on "down"
DNSDefang will provision shorter TTLs; zones will be forcefully destroyedDefang will provision longer TTLs; records can be overwritten for ZDT
Managed storageOperations that cause downtime are allowedEncryption at rest; Final snapshot created on "down"
Logs1 day retention7 days retention30 days retention