Workshop: 12 Factor Apps Workshop

Location:

Level: 
Intermediate

When:

1:00pm - 4:00pm

Key takeaways

  • Understand the properties and limitations of Twelve-Factor Applications.
  • Work with a real microservice based system consisting of multiple services that implement Twelve-Factor principles in different programming languages.
  • Get insights how such applications can be managed with Kubernetes.
  • Learn about patterns and tools to overcome the most serious limitation of Twelve-Factor: statelessness.
  • Experiment with a distributed, stateful service using such a pattern, to experience possible failure modes and learn how to fix them.

Prerequisites

  • WiFi-enabled laptop with SSH client.
  • Basic knowledge of Docker and Linux. S
  • ome programming experience in the field of web applications.

The principles behind "Twelve-Factor Apps" are considered good practices or even requirements to develop software for Platform-as-a-Service (PaaS) environments, and lately for container based platforms, such as Kubernetes.

Notable principles include:

  1. execution as stateless processes with no direct access to the host's file system
  2. disposable processes that can be started and stopped at any time
  3. scale out by launching additional, identical processes
  4. strict separation between configuration and code
  5. strict separation between build and run stages with no changes to code at runtime

The most restrictive principle is the requirement of stateless processes, as the underlying platforms may preempt your application processes and re-start them elsewhere at any time. This leads to anything stored in a processes memory or the local filesystem being lost. Therefore, anything resembling a database is off-limits. Common advice is using 3rd party services to store state, such as the Database-as-a-Service (DBaaS) offerings of major cloud providers. This, however, comes with some major downsides:

  • You can't replicate the full system for local development.
  • You might be locked into the managed service of your cloud vendor.
  • Your technology of choice might not be supported, like modern graph databases or new search engines.

In this workshop, we will first discuss how the original Twelve-Factor principles came about and how they have evolved in times of "Cloud Native" application development. We then work with a real microservice based system, consisting of multiple services that were developed following these principles. You will see the different approaches used in various programming language (Go, Node.js and Java). As we work with those services, you'll also learn how to interact with a Kubernetes cluster to deploy and update them. For this, we use the OpenSource "Socks-Shop" Microservice Reference application.

In the second part of the workshop, we will cover various approaches to run stateful applications on container based platforms. We'll specifically look into the "Autopilot Pattern" and "StatefulSets" of Kubernetes, but also glance over other approaches. In the hands-on part, we'll enhance one stateful service to run in a distributed, fault-tolerant way. We then try to break it to experience different failure modes and see if it can recover on it's own.

We finish the workshop with a brief outlook to "Serverless" (or "Function-as-a-Service"), which is sometimes touted as evolutionary step after Twelve-Factor. We look into options to build "Serverless" platforms on top of Kubernetes (instead of using the well-known cloud offerings from Amazon and Google) and launch a simple Function into our workshop clusters.

Hands-on vs. Lecture: 70% / 30%

Speaker: Maximilian Schöfmann

Co-Founder @ContainerSoluti (Container Solutions) & @SoftwareCircus Organiser

Maximilian Schöfmann runs Container Solutions in Switzerland, a European services company specialising in Cloud Native technologies. He specialises in system architecture and security for Microservice based systems, often focussing on the human side of such transitions. He held various management positions in IT operations and software development in the past, always convinced that any good manager in tech needs to get his hands dirty regularly.

Find Maximilian Schöfmann at

Other Workshops:

Tracks

Monday, 6 March

Tuesday, 7 March

Wednesday, 8 March