Continuous Deployment changes your mind
We are practicing Continuous Deployment since about a year. When looking back I realize the dramatic way this practice changed the way we work.
Just to draw the fine line between Continuous Delivery and Continuos Deployment I use the definition I once heard from Neal Ford. Continuous Delivery allows you to deploy every commit but you don’t do it every time. With Continuous Deployment you go further and really deploy every time.
I have recently been asked what the benefits of Continuous Deployment are compared to Continuous Delivery. I think the impact on your development practice is a huge thing.
In our company we practice agile development since about 2005. During that time I can remember many discussions about agile practices like:
- Test Driven Development
- Definition of Done
- Potentially Shippable Product
- Refactoring in baby steps
- Not committing on a red build
Many of them do not easily reveal their benefits in daily business. So it becomes difficult to use them consequently.
The Definition of Done is a great example. It is easy to declare something finished or appropriately tested when there is usually a QA department that will find your mistakes during release tests. So the common recipe is write down your definition, post it on the wall and “be more disciplined”. Force yourself to write more tests, force yourself to declare things done only if they are really done and so on. This is not easy. In my experience it seldom works.
This changes dramatically when using continuous deployment. Between your commit and the production system is only an automated deployment pipeline, that usually takes something around 30 minutes. There is no QA department that does a extensive release test. Your mistakes will only be found by automated test that you wrote yourself. Well or they will be found by your Users.
Automated tests become your safety net. This again changes the way you think about TDD. It totally makes sense to have a near full coverage of your code. It also makes sense to have integration tests on API and GUI level to make sure your deployment pipeline catches most mistakes. It will not catch any mistake, but in my experience the same is true for most QA departments.
You will think differently about Potentially Shippable Products. Every commit has to be shippable and it will (not only potentially) be shipped.
This forces working in baby steps. It is just not possible to refactor a system by destroying it for several days.
If a build is red the deployment pipeline is halted. Nobody is able to apply more changes to the system unless this problem is fixed. Again something that used to be a discipline thing becomes a necessity. You need to help your teammates to fix the problem otherwise you can’t work yourself. The same is true if there is a red build in the evening. One of my teammates even talks about an addiction to fix the build before going home. It just gives you a good feeling to finish your day in a green state.
Continuous Delivery has several immediate business benefits I might tell you about another time. But most of them don’t need every commit to be deployed.
But I think the impact of deploying every commit on your development practice huge. Many agile practices make so much more sense. They fit naturally in this environment and you follow them easily. This will then result in benefits for your business on the long term.