The Twelve-Factor App: Port Binding, Concurrency, and Disposability

Topics covered
Popular Clips
Episode Highlights
Concurrency
Concurrency in the Twelve-Factor App emphasizes the importance of process scaling and management. Alan Underwood explains that processes are first-class citizens, allowing apps to control and assign tasks to various process types, such as web and worker processes 1. This approach supports horizontal scaling, which is crucial for modern web applications. Joe Zack highlights the need to avoid spinning up threads unnecessarily, as it can lead to inefficient vertical scaling 2.
You should try to avoid your process of spinning up and managing threads.
--- Joe Zack
Instead, leveraging the operating system's capabilities or using tools like Foreman and Upstart can streamline process management across multiple machines 3.
  Â
Scaling Confusion
The discussion on workload scaling reveals some confusion and contradictions in the Twelve-Factor App's guidelines. Michael Outlaw points out the inconsistency in managing workloads, where the app seems to suggest tightly coupled configurations, which contradicts the microservices architecture 4. This confusion extends to thread management, where Joe Zack advises against creating threads for every task, as it can lead to resource exhaustion 2.
If I opened up a thread to do the resizing every time I got a resize request, then I'm going to be maxing out that box.
--- Joe Zack
Instead, the focus should be on distributing tasks across processes efficiently to maintain scalability and performance.
  Â
Process Management
Innovative process management techniques are crucial for effective application scaling. Joe Zack introduces tools like Upstart and Foreman, which help manage processes by restarting applications based on events rather than constant polling 5. This approach ensures that applications remain responsive and can recover quickly from crashes. Efficient queue handling is another vital aspect, as Alan Underwood explains how queues can manage tasks by reassigning them if a process fails 6.
You can almost offset some of your own programming into functionality that's already built in other stacks.
--- Alan Underwood
By leveraging these tools and techniques, developers can enhance the reliability and scalability of their applications.
Related Episodes
The Twelve-Factor App: Codebase, Dependencies, and Config
Answers 383 questionsThe Twelve-Factor App: Backing Services, Building and Releasing, Stateless Processes
Answers 383 questionsThe Twelve-Factor App: Dev/Prod Parity, Logs, and Admin Processes
Answers 383 questionsDesigning Data-Intensive Applications – Scalability
Answers 383 questionsASP.NET 5 - It's Basically Java
Answers 383 questionsCaching in the Application Framework
Answers 383 questions

3factor app - Async Serverless
Answers 383 questions

Clean Code - How to Build Maintainable Systems
Answers 383 questionsDesign Patterns Part 1
Answers 383 questions3factor app - Reliable Eventing
Answers 383 questionsDesign Patterns Part 3
Answers 383 questions

Search Driven Apps
Answers 383 questions

Designing Data-Intensive Applications – Maintainability
Answers 383 questions

Clean Architecture - Are Microservices Truly Decoupled?
Answers 383 questionsOWASP and You - Application Security in .NET
Answers 383 questions
