Blue-green deployments on AWS

Before we do this, make sure that you have a service that you want to deploy. To keep things simple, I followed the spring boot tutorial on making a restful web service. It was quick and the app worked like a charm. As usual, I went a bit extra and made my app return a stubbed list of users. You don’t have to. Make sure you have a /healthcheck endpoint and another endpoint that you can test with. In my case, I have /users which returns a list of users.

All righty then. Lets get a high level overview of what things are and how they are going to work. But before we do that, lets go through a quick real-ish life scenario.

Say you have a service that you have deployed onto AWS. Now you have a newer version of that service that you’d like to test. Since you never know if something works without actually trying it out, normally, after exhaustive testing in staging and other environments, you’d deploy that service into production to all your users. But ah ha! That one guy in your team forgot that one test case which made it blow up which means every single user of yours is now seeing error pages everywhere. This is bad so you roll it back to the previous version. Doesn’t sound too bad yet but by the time you do this, you’d have lost a couple of hours in time which would translate into actual money lost to the company which could eventually make a dent in your end of the year bonus.

Continue reading

Gradle multi module projects

Recently I’ve had to deal with a lot of gradle projects, specifically the multi-module ones. It’s dead easy to setup, however, every time I do it, I have to refer to one of my old projects to see the layout. So, hopefully, while this document will certainly help future me, I hope it is of help to you too.

First things first, create a project directory. We will refer this directory as ‘project root directory’ in future. For all the awesome things that I do, we’ll call this one, drum roll please awesomeproject.

Continue reading