F39

Why we use Docker and Kubernetes. Read about our journey!

How to deliver scalable cloud native apps
At the core of what we do at FACTORY 39 is bringing our client’s ideas into life in the form of a web application, API, mobile app or content driven website. Being able to deliver these applications effectively, means having the ability to develop efficiently and deploy a software architecture that can scale along with our clients. This is why we use Docker and Kubernetes. But first, let me take you through the journey of making this choice:

We are a relatively small development team, where different developers work on different client projects constantly. Needing a way to keep our development environment as consistent as possible we chose Docker and Docker Compose. This  ensures that regardless of which team member is working on a project at any given time, they can be up and running with as close to a production setup as possible. It also allows us to be flexible with planning our work while enabling us to be agile and adaptable to changing customer requirements.

Deploying to production was a different story though. When we started our journey we did not have the resources to manage and maintain bespoke infrastructure and so we decided to use Heroku for all of our projects. It was great! For some time... Heroku is amazing at allowing a small team to focus on what they are great at… building software. And so we relied on Heroku’s addons to help with all of our DevOps needs, Databases, Logging, Monitoring and everything was handled. As we grew though, Heroku started being more of an obstacle rather than a tool. If the architecture you’re building does not fit exactly within Heroku’s ecosystem, it quickly becomes either hard or very expensive to use and therefore you need to start making compromises. So for us, something had to change.

For our development pipeline, we were already using modern practises with applying test-driven development, continuous integration and delivery and having all of our applications dockerized. Therefore, exploring Kubernetes was a natural next step. Kubernetes is a container orchestration system that was originally created by Google, allowing the deployment and management of applications at scale. Having had early experiences with Kubernetes we  were mostly avoiding it out of fear for its complexity when used by a team and company our size. Well that was no more the case. Kubernetes, in the last few years has matured to the point where now it is stable and easy enough to use that as long as you pick a good managed Kubernetes service, any team can take advantage of it.

We were sold on the idea as soon as we went ahead and moved the staging environment of  one of our products “Anyscript” — https://anyscript.io to Kubernetes. It was a good all around spike as Anyscript requires a few different services to run: a PostgreSQL database, Redis, A front end web application, a backend API and worker nodes. Running  databases in Kubernetes is possible but not advisable and can create issues, therefore we decided against it. Our Kubernetes platform would be just running stateless web services. For our databases we chose a managed database service.

Setting up Kubernetes and deploying Anyscript to it was a breeze. We decided to use an external ELK stack as a service solution to manage its logs, and set up our CI/CD pipelines to push docker images and update deployments which gave us a 1 button production deployments. The entire process took less than 3 days to fully set up. Given the nature of Anyscript, setting up the auto scaling of resources was super important as we needed the ability  of executing workloads of different sizes but not necessarily pay for the unneeded compute when not in use. This was made extremely  simple with the Kubernetes “autoscalers” and some assistance from our managed kubernetes provider. Needless to say we were convinced 👍.

Shortly thereafter, all of our applications in staging and production had moved to Kubernetes. This journey has increased our flexibility to design and deliver software to our customers at a much larger scale, helped us optimize the cost of hosting those applications, and enabled us to tailor solutions based on customer needs rather than Heroku “plans”. 

If you feel that your business, or team could benefit from a similar journey ping us at [email protected] .We would love to have a chat and see if we can help you experience the same improvement in workflow as we did.