twelve-factor app

Twelve-factor app, introduced by Heroku, became a popular reference as principles in building cloud-native or software-as-a-service (SaaS) applications. As a software architect, awareness is an important aspect so that you can effectively apply new patterns or methodologies to make successful applications. Use these 3 Tricks / Steps when you are designing or refactoring the applications.

1. Get to the basics

The first step is to ensure that you understand all the 12 principles in detail and also did your homework in finding out the reference applications built using those. Here is a quick snapshot for your reference – you can take the print and put it on your desk for quick reference.

twelve factor apps
Figure 1: Twelve-factor apps in a glance (Reference: https://12factor.net/)

2. Map the technology choices to each factor

Now that you have covered the basics, you need to map the technology choices with these factors into consideration and use each factor as an evaluation criteria to ensure the choice you made will help you realize your vision for the architecture.

For example, a technology mapping diagram (also a reference architecture) has been depicted as shown below using:
– Microservices using Java and Spring-based framework
– Dependencies management using Maven or Gradle or NPM (if Node.js)
– Containerization using Docker & container orchestration using Kubernetes
– Continuous build & deployment using Jenkins or Bamboo or Travis CI
– Logs management using Elastic with log sync with Logstash or Fluentd
– RPEL using Spring Shell or JShell or use a lightweight Linux container with Busybox

twelve-factor app with technologies mapped
Figure 2 – Twelve-factor app reference architecture with technology mapping

3. Measure the effectiveness of twelve-factor principles

Architecture is always evolving, and if there are certain elements of these principles you are not able to meet in the initial phases, don’t worry about it. You can make incremental progress and keep measuring the effectiveness of the architecture on a regular basis.

For simplicity, these principles can be categorized into three specific areas – development & configuration, runtime and management & visibility principles.

Figure 3 – Classification of Principles

Furthermore, a simple scoring mechanism (based on each factor’s checklist) can be used to measure the compliance level of your architecture until you reach your goal.

Figure 4 – Compliance Level of Architecture

That’s it – you can keep making progress towards your journey on learning these principles and mastering them out as you make more implementations. Only the real-world examples can make you perfect. Share your journey of building twelve-factor apps or cloud-native apps to share the experience & knowledge with everyone.

Leave a Comment