Building Workflows That Are Repeatable and Never Lost
Understand idempotency and how it leads to repeatable workflows.
We'll cover the following...
As DevOps engineers, we write tooling all the time. In small shops, many times, these are sets of scripts. In large shops, these are complicated systems.
As we may have gleaned from the introduction, it can be said that tool execution should always occur in a centralized service, regardless of scale. A basic service is easy to write, and we can expand and replace it as new needs arise.
But to make a workflow service work, two key concepts must be true of the workflows we create, as follows:
They must be repeatable.
They cannot be lost.
The first concept is that running a workflow more than once on the same infrastructure should produce the same result. We called this idempotency, borrowing the computer science term.
The second is that a workflow cannot be lost. If a tool creates a workflow to be executed by a system and the tool dies, the tool must be able to know that the workflow is running and resume watching it.
Building idempotent workflows
Idempotency is a concept that if we make a call with the same parameters multiple times, we receive the same result. This is an important concept for writing certain types of software.
In infrastructure, we modify this definition slightly: an idempotent action is one that, if repeated with the same parameters and without changes to the infrastructure outside ...