Multi-Container Pods: The Typical Example
An example of multi-container Pods.
We'll cover the following
A common example of comparing single-container and multi-container Pods is a web server that utilizes a file synchronizer.
The example
In this example there are two clear concerns:
- Serving the web page
- Making sure the content is up to date
The question is whether to address the two concerns in a single container or two separate containers.
In this context, a concern is a requirement or a task. Generally speaking, microservices design patterns dictate that we separate concerns. This means we only ever deal with one concern per container.
Assuming the previous example, this will require two containers: one for the web service, another for the file sync service.
This model of separating concerns has a lot of advantages, including:
- Different teams can be responsible for each of the two containers.
- Each container can be scaled independently.
- Each container can be developed and iterated independently.
- Each container can have its own release cadence.
- If one fails, the other keeps running.
Get hands-on with 1200+ tech skills courses.