Concurrency
Scale out via the process model.
- Historically we scaled via OS processes, but large virtual machines like JVM favour allocating one large uberprocess and facilitating concurrency via threads.
- Processes are a first-class citizen.
- Diverse workloads facilitated via specialised processes of a certain type.
- HTTP requests via a web process, long-running background tasks via worker processes.
- Individual processes can do their own multiplexing using threads/green threads.
- Share-nothing, horizontally partitionable process model simplifies scaling out.
- Array of process types and number of processes of each type known as process formation.
- Never daemonise or write PID files.
- Rely on the OS process manager (e.g. systemd), cloud platform, etc.
- The platform should take of output streams, crashed processes and operator-initiated events like restarts/terminations.
References
Backlinks