# Release for production

After you have created your development environment on Northflank to build, deploy, and preview your applications and microservices, you can use the features explained in this guide to release production deployments smoothly and with zero downtime.

Northflank's features allow you to:

- Release quickly

- Deploy with zero downtime

- Add health checks to ensure requests are served only to healthy containers

- Run migrations and other jobs automatically

- Re-run previous releases easily

## Release strategies

The right release strategy for your project depends on its complexity. Choose the approach that fits your needs:

### 1. Manual deployment

**Best for:** Single-service applications

Manually select a specific build or image to deploy. Best for projects with one or two resources.

- [Build from a Git repository: Start building from your linked Git repositories in minutes.](/v1/application/build/build-code-from-a-git-repository)
- [Run an image continuously: Deploy a built image as a continuously-running service.](/v1/application/run/run-an-image-continuously)

### 2. CI/CD

**Best for:** Smaller projects

Automatically build and deploy your latest commit using continuous integration and deployment. Set up path rules and commit message filters to control when builds trigger.

- [Manage CI/CD: Configure continuous integration and continuous delivery on your Northflank services.](/v1/application/release/manage-ci-cd)

### 3. Environments

**Best for:** All projects, especially complex releases

Create environments for each deployment stage and define workflows within each environment to automate your entire release process including backups, migrations, and multi-service deployments. Run manually, on Git push, or on a schedule.

- [Set up environments: Create environments to organize your release process by deployment stage.](/v1/application/release/set-up-environments)
- [Configure a release flow: Learn how to use the visual editor or code to configure a release flow.](/v1/application/release/pipeline/configure-a-release-flow)
- [Set up a preview environment: Create templates in your pipelines to automatically generate temporary preview environments to view pull requests and branches.](/v1/application/release/pipeline/set-up-a-preview-environment)

## Manage your production environment

You can ensure your production environment has the correct environment variables and build arguments available using secret groups and tags.

Secret groups can contain connection details for addons, passwords, tokens, keys, and other sensitive data. You can also create configuration groups to manage non-sensitive data, and assign roles to your team members accordingly.

You can create groups that contain the relevant secrets for your different environments, and restrict them based on tag, or by specific resources.

Tags are a useful way to identify and manage resources in different environments. You can quickly add or remove multiple groups of secrets and configuration details from resources by adding and removing tags.

- [Manage groups of secrets: Create and manage groups of secrets that can be inherited throughout an entire project or by specific services and jobs.](/v1/application/secure/manage-secret-groups)
- [Tag your workloads and resources: Create tags to assign to your Northflank workloads and resources to help keep track of them.](/v1/application/release/tag-workloads-and-resources)

## Run migrations during release

When you make changes to your database schema you may need to update your application and change your production database simultaneously. Workflows are the recommended approach, as they allow you to back up your database, run a migration, and deploy your new release only when the migration is successful.

- [Run migrations: Run database migrations and update your deployments simultaneously when you update your schema.](/v1/application/release/run-migrations)

## Deploy with zero downtime

You can deploy your release with zero downtime by configuring health checks to ensure that your code is ready before traffic is served to it. Northflank handles deployments differently depending on how many instances your service has.

For single instance deployments, a new container will be started and the old one terminated when the new container is ready. For multiple instances, containers are replaced in a rolling redeployment.

In both cases, configure a readiness probe to ensure your application is initialised and ready to serve requests before traffic is routed to it.

- [Configure health checks: Monitor the uptime and success of your deployed services and builds to ensure your code runs correctly and is always available.](/v1/application/observe/configure-health-checks)

### Upgrade databases with zero downtime

You can configure your addons for high availability, which allows you to update or scale them without losing access to your data.

- [Configure addons for high availability: Configure your addons to maximise availability.](/v1/application/databases-and-persistence/configure-addons-for-high-availability)

## Next steps

- [Build from a Git repository: Start building from your linked Git repositories in minutes.](/v1/application/build/build-code-from-a-git-repository)
- [Run an image continuously: Deploy a built image as a continuously-running service.](/v1/application/run/run-an-image-continuously)
