Heroku is a cloud application platform that published following 12 strategies and criteria for software-as-a-service (SAAS) applications to be run in the cloud:
1) Codebase | 2) Dependencies | 3) Configuration | 4) Backing Services |
5) Build, Release, Run | 6) Processes | 7) Port Binding | 8) Concurrency |
9) Disposability | 10) Dev / Prod Parity | 11) Logs | 12) Admin Processes |
This is a lot. Below you find a grid where you can move around the factors in case you consider their order to be wrong. Try to drag & drop the yellow rectangles to the place where you think they belong, and get familiar while playing with them. (This grid is meant to be viewed on big landscape screens.)
Need for Speed
We can't argue that these factors are just Heroku's factors. Cloud application requirements are different from those of a "traditional" application. Availability wins, provided by resilience against, and scaling of, massive request rates.
These factors remind me of UNIX environments and process models. Performance tuning is recommended to not be done inside one process running multiple threads, instead multiple processes should do the work, communicating over message queues, synchronizing through semaphores. Such a concept deprecates web- and application-server concepts, where one process drives several applications deployed to it. Instead every cloud-app contains its own web server.
Healing by Scaling
- Horizontal scaling means running an application as multiple instances on different machines. This raises the need for data replication, mostly done through distributed caches.
- Vertical scaling means putting more processors and memory into a machine. But this helps just when the software actually can use multiple CPUs, which is not the case for old software that never has been modernized. Twelve-factor apps circumvent this by using processes instead of threads, nevertheless the software has to support parallel processing then.
Generally it looks like computers (RAM/CPU), operating systems and applications are dissolving into a mystic fog of containers, ports, protocols, environments, nodes, pods (not bots!) and resources that condenses to what is called cloud. Docker is a virtualization on operating system level, Kubernetes is a deployment and runtime environment for containers, OpenShift is the platform facilitating Kubernetes - how many Matryoshka dolls will we need for our web shop?
Dev, DevOps, Ops
A new role has been created called devops (developer + operator). It is expected to do all that deployment work after a software release. Devops is a developer because Kubernetes requires programming, as do build-severs and containers of any kind. Devops is an operator because of machines, operating systems, application instances, and the resources they use.
Nevertheless dev (developer) maintains the application that needs to go cloud. Development of twelve-factor apps looks like writing just small parts of logic, then encapsulating them carefully against things like concurrency and disposability. Applications need to be stateless, configuring their state on startup from persistence, that's the only place where state is allowed to be. This is quite a programming paradigm shift! How micro can you go? Will we still need devs for that, or can we pass it to business experts now?
In case you intend to hire devops, it's recommendable to define responsibilities of dev and devops sharply in context of the build-server (Jenkins). Both groups need to know it and use it. Dev needs to release the application. Devops needs to deploy the release to customers. Separate these two things, don't let them happen in just one "pipeline".
Twelve-factors mandate that devs do deployment. They must be able to find the reason for a NoClassDefFoundError, typically thrown when some JAR file has not been deployed correctly. So why do we need devops? Most likely because devs have been overloaded with all kinds of responsibilities for many decades, and it's time that this gets better. Cloud deployment environments are as complex as development environments.
May I Criticize her Majesty?
I don't agree with Dev / Production Parity. Yes, devs need to use at least the same environment that users have, but don't restrict the project to that. Try to keep the product flexible by using different database products, file stores, caches, whatever. Backing Services abstraction is what we actually should stick to.
The twelve factors shouldn't include that source code must be versioned, and that it must not be reused by copying it around. We know that, it's state-of-the-art since decades, so why blow up the factors instead of focusing on cloud requirements?
Ever heard of the magical 7 +- 2 rule? Much easier to remember, avoiding overloaded burnt-out nervous-breakdown teams. Below I summarized the factors that focus on what the cloud demands, leaving out the dev responsibilities.
Keine Kommentare:
Kommentar veröffentlichen