Quidest?

Twelve Factor App - Disposability

The twelve-factor app’s processes are disposable, meaning they can be started or stopped at a moment’s notice. This facilitates fast elastic scaling, rapid deployment of code or config changes, and robustness of production deploys.

Processes should strive to minimize startup time. Ideally, a process takes a few seconds from the time the launch command is executed until the process is up and ready to receive requests or jobs. Short startup time provides more agility for the release process and scaling up; and it aids robustness, because the process manager can more easily move processes to new physical machines when warranted.

Processes shut down gracefully when they receive a SIGTERM signal from the process manager. For a web process, graceful shutdown is achieved by ceasing to listen on the service port (thereby refusing any new requests), allowing any current requests to finish, and then exiting. Implicit in this model is that HTTP requests are short (no more than a few seconds), or in the case of long polling, the client should seamlessly attempt to reconnect when the connection is lost.

Processes should also be robust against sudden death, in the case of a failure in the underlying hardware. A twelve-factor app is architected to handle unexpected, non-graceful terminations.

References

#twelve #factor #app #webapp #scaling #internet #saas #software #as #a #service #api #codebase #dependencies #config #tfa #backing services #build #release #run #processes #sql #database #port #binding #concurrency #disposability #dev/prod #development #production #container #parity #logs #admin