For most teams working on Astro, Astronomer recommends using multiple Airflow Deployments for running and testing development and production versions of your pipelines, and promoting code between them using CI/CD. This allows you to develop your pipelines faster, more securely, and more reliably.
There are many ways to organize your code, CI/CD pipelines, and Deployments to support a sustainable development lifecycle on Astro, and no single setup will work for all teams. However, there are a two main options for managing your development Deployments and promoting code from development to production:
dev branch of a version-controlled code repository. You can hibernate this Deployment so that it doesn’t consume resources when you’re not using it.This guide covers how to choose which of these methods is best for your team and how to implement both using Astro features.
This guide highlights how to use the following Astro features to manage your Deployments:
It’s a best practice to maintain multiple environments for separate development and production versions of a data pipelione. While there are many ways to do this, the two options covered in this guide — permanent development Deployments and ephemeral preview Deployments mapped to feature branches — will work for most teams.
In general, preview (ephemeral) Deployments offer a better development experience. Since each feature branch maps to its own Astro Deployment, you don’t have to worry about conflicts from other developers working on a development branch at the same time. If you have larger teams working on Astro or deploy changes frequently, this is a good option. However, managing Deployments in this way requires more setup to ensure the Deployments have access to external systems and resources, which in turn requires a more complex CI/CD implementation. Your team should have experience with CI/CD to make this pattern successful. Preview Deployments can also come with less predictable costs, especially at larger scale with many feature Deployments being regularly spun up and down.
Permanent development Deployments are easier to set up and manage. You only need to set up the environment once, and Astro’s GitHub integration offers far simpler CI/CD implementation for GitHub users. In many cases, this pattern is also more cost-effective, as you can maintain one development Deployment and use Astro’s hibernation feature to reduce costs for the Deployment when you aren’t using it. This option is often best for smaller teams, teams that deploy infrequently, and teams who are very cost conscious.
This example shows you how to map a permanent branch on GitHub to a permanent development Deployment with a hibernation schedule. If your team doesn’t use GitHub, you can also implement a branch-based hibernating development Deployment using CI/CD templates.
This example shows how to implement ephemeral Deployments for feature development that are spun up and down by CI/CD.