What is Declarative Deployment?

Discover the differences between declarative and imperative deployment, the benefits of each, and how Armory provides declarative deployment solutions for any developer.

What Is Declarative Deployment?

Declarative focuses on “what” and imperative focuses on “how”.

Automation frameworks can be designed and implemented in these different ways: declarative or imperative, also known as DevOps paradigms. In an imperative paradigm, the user is responsible for defining the necessary steps to achieve the end goal. In a declarative paradigm, a set of requirements and the desired end state are provided. The system automatically determines the steps that need to be run in order to reach this end state while meeting the additional requirements.

Imperative deployments are determined by the user, quite often by writing a script to execute the deployment. Whereas declarative deployments are determined by the outcome first and the steps to reach the end state are determined automatically.

When you use declarative deployments, instead of writing a set of instructions for one deployment use case and describing exactly how you want something done, you simply state what you want to be done, along with any special requirements, and the machine figures out how to do it. This means you can cut back on the manual nature of your deployments and speed up how quickly you can bring new innovations, like a “suggested for you” feature, to your customers.

Figure 1: an example yaml file declaring what you want to be done (prod-eu is using a blue/green strategy and depends on infosec and staging to complete first, prod-east is using a canary strategy that’s deploying to 25% of the traffic first)

The structure and examples of Armory's CD-as-a-Service yaml file used to configure declarative deployment.
Figure 1

What’s the Difference Between Declarative Deployment and Imperative Deployment?

An imperative deployment pipeline shown as depicted in Spinnaker vs. a declarative deployment yaml shown in figure 1.
Figure 2

Declarative Deployment focuses on “what, while Imperative Deployment focuses on “how.” The declarative approach uses structural models that describe the desired application structure and state, which are interpreted by a deployment engine to enforce this state.

One of the main differences between declarative deployment and imperative deployment is that the imperative approach uses procedural models that explicitly specify a process to be executed.

Figure 2: An end-to-end process (a pipeline of defined stages) to execute as the deployment progresses

What Are the Benefits?

Declarative deployment is the right automation strategy to scale modern enterprise software development. Because the focus is on the outcome and not the individual steps, teams focus more on what they want their software to accomplish, not how to get there, creating efficiency and leading to better quality outcomes. Declarative deployments are also much more resilient to change. With imperative deployments, changing one part of the process may break a different part. With declarative deployments each requirement is standalone, and the system automatically determines how best to combine them, leading to easier maintenance and a greater ability to handle changing requirements over time.

Why Choose Declarative Deployment?

With Armory Continuous Deployment-as-a-Service (CDaaS) you can work with YAML to define what the end state of the deployment should look like or achieve. Try declarative deployments with Armory today!

Commit. Deploy. Repeat.

Continuous Deployment at any scale, for all developers.