Infrastructure provisioning & Environments

How the Encore platform provisions infrastructure for your application

The Encore platform automatically provisions all necessary infrastructure, in all environments and across all major cloud providers, without requiring application code changes. You simply connect your cloud account and create an environment.

How it works

This is powered by Encore's open source backend framework, which lets you declare infrastructure resources (databases, caches, queues, scheduled jobs, etc.) as type-safe objects in application code.

At compile time, Encore parses the application code to generate an Application Model, and the Encore platform uses this meta data to create an infrastructure graph with a high-resolution definition of the infrastructure your application requires.

The Encore platform then uses this graph to provision and manage the necessary infrastructure in your cloud account (using AWS and GCP APIs), and in development and preview environments hosted on Encore Cloud.

The approach removes the need for infrastructure configuration files and avoids creating cloud-specific dependencies in your application.

Having an end-to-end integration between application code and infrastructure also enables the Encore platform to keep environments in sync and track cloud infrastructure, giving you an up-to-date view of your infrastructure to avoid unnecessary cloud costs.

Environment types

By default, the Encore platform provisions infrastructure using contextually appropriate objectives for each environment type. You retain control over the infrastructure in your cloud account, and can configure it directly both via the Encore platform dashboard and your cloud provider's console. The Encore platform takes care of syncing your changes.

LocalEncore platform HostingGCP / AWS
Environment types:DevelopmentPreview, DevelopmentDevelopment, Production
Objectives:Provisioning speedProvisioning speed, Cost*Reliability, Security, Scalability

*the Encore platform Hosting is free to use, subject to Fair Use guidelines and usage limits. Learn more

Development Infrastructure

The Encore platform provisions infrastructure resources differently for each type of development environment.

LocalPreview / Development (Encore platform Hosting)GCP / AWS
SQL Databases:DockerEncore platform Managed (Kubernetes), NeonSee production
Pub/Sub:In-memory (NSQ)GCP Pub/SubSee production
Caches:In-memory (Redis)In-memory (Redis)See production
Cron Jobs:DisabledEncore platform ManagedSee production
Object Storage:Local DiskEncore platform ManagedSee production

Local Development

For local development the Encore platform provisions a combination of Docker and in-memory infrastructure components. SQL Databases are provisioned using Docker. For Pub/Sub and Caching the infrastructure is run in-memory.

When running tests, a separate SQL Database cluster is provisioned that is optimized for high performance (using an in-memory filesystem and fsync disabled) at the expense of reduced reliability.

To avoid surprises during development, Cron Jobs are not triggered in local environments. They can always be triggered manually by calling the API directly from the development dashboard.

The application code itself is compiled and run natively on your machine (without Docker).

Preview Environments

When you've connected your application to GitHub, the Encore platform automatically provisions a temporary Preview Environment for each Pull Request.

Preview Environments are created in the Encore platform Hosting by default, and are optimized for provisioning speed and cost-effectiveness. The Preview Environment is automatically destroyed when the Pull Request is merged or closed.

On the Enterprise tier, Preview Environments can also be hosted on your own cloud infrastructure. See the Preview Environments docs for more information.

Preview Environments are named after the pull request, so PR #72 will create an environment named pr:72.

Encore Cloud Hosting

Encore Cloud Hosting is a simple, zero-configuration hosting solution provided by Encore. It's perfect for development environments and small-scale use that do not require any specific SLAs. It's also a great way to evaluate the Encore platform without needing to connect your cloud account.

Encore Cloud Hosting is not designed for business-critical use and does not offer reliability guarantees for persistent storage like SQL Databases. Other infrastructure primitives like Pub/Sub and Caching are provisioned with small-scale use in mind.

Learn more about the usage limitations

Production Infrastructure

The Encore platform provisions production infrastructure resources using best-practice guidelines and services for each respective cloud provider.

GCPAWS
Networking:VPCVPC
Compute:Cloud Run, GKEFargate ECS, EKS
SQL Databases:GCP Cloud SQL, NeonAmazon RDS, Neon
Pub/Sub:GCP Pub/SubAmazon SQS & Amazon SNS
Object Storage:GCS/Cloud CDNAmazon S3/CloudFront
Caches:GCP Memorystore (Redis)Amazon ElastiCache (Redis)
Cron Jobs:Encore platform ManagedEncore platform Managed
Secrets:Secret ManagerAWS Secrets Manager

Configuration

With Encore you do not define any cloud service specifics in the application code. This means that after deploying, you can safely use your cloud provider's console to modify the provisioned resources, or use the built-in configuration UI in the Encore platform dashboard.

Learn more in the Infrastructure Configuration documentation.

For information on infrastructure safety, upgrades, disaster recovery, and shared responsibilities, see Managing Infrastructure.