*Note: this article is superseded by the newer Idiomatic Containers. This page will auto redirect in 5 seconds.
Ephemeral Immutable Apps stand on the principals of the 12-factor app. However, the 12 factors leave unclear some of the operational and administrative factors — things which are very important if you want to build and deploy in a Continuous Delivery world.
The Factors of an Ephemeral App explain how to build and deploy a 12-factor Ephemeral App in a manner that is sustainable, uses Continuous Delivery and helps with maintainability and Disaster Recovery.
Important in understanding an Ephemeral App is knowing the layers that makeup all running services:
- Stack -- what the service runs on. The application and basic language framework (Java, Node, Ruby, Python, etc).
- Code -- the code that defines the service, in addition to all required libraries and add-on modules. These are included as part of the application, not the platform.
- Config -- the definitions and secrets that describe how the application runs within a single environment or for a single customer.
- Data -- all of the data used by the application, regardless of the storage format.
XIII. Immutable Release
Building on 12-Factor V. Build, Release, Run, the Immutable Release factor is that the final product of an assembled solution, including all dependencies, should be packaged in an immutable format, and that immutable package is delivered to a specific environment to be run, then disposed of. It is never updated. The same package can be delivered to any number of environments, paired with Factor XIV: Config at Runtime, to define how it should execute.
XIV. Secrets to Heap
Clarifying 12-Factor III. Config, the configuration that defines how the environment executes is delivered at runtime. In spirit, this is similar to Factor III. However, configurations include secrets, which should never be stored in OS environment settings as these are insecure, yet Factor III suggests using the "Environment" as a general concept which can cause confusion. The point of Factor III is that the way the application runs is delivered at run-time, and nothing is stored within the packaged app to tell it how to run for a given environment, but rather that it is introduced in the general running environment of the application.
The clarification of Factor XIV: Secrets to Heap, is that the configuration defining all aspects of how the Immutable package runs including secrets and environmental context are delivered at runtime, into the variable space of the application (application allocated memory), ideally avoiding any disk and notably avoiding the OS Environment space.
XV. Real Service Monitoring
Testing and validating the process is working as expected is mandatory for a stable pipeline between the various steps in an environment.
The service itself should be monitored in a manner similar to how it is used. Do not rely upon the process simply being in an execution state as being sufficient to know it is operating as expected. The testing should validate the service is online and ready for use, as well as to discover if it has stopped operating as expected.
If it is a web service, web calls can be made directly to the service. For services which do not have an external surface to connect to (such as batch jobs), use heartbeats that push out signals at regular intervals.
XVI. CI Data Migrations
Data itself should be treated in the same manner as code, with a pipeline and quality assurance testing and tests around them. Nobody should be manually adjusting data or data schemas on live systems.