Why run microservices using Docker and Kubernetes?
Published:
Benefits of microservices
- Code can be broken out into smaller microservices that are easier to learn, release and update.
- Individual microservices can be written using the best tools for the job.
- Releasing a new service doesn't require synchronization across a whole company.
- New technology stacks have lower risk since the service is relatively small.
- Developers can run containers locally, rebuilding and verifying after each commit on a system that mirrors production.
- Both Docker and Kubernetes are open source and free to use.
- Access to Docker hub leverages the work of the opensource community.
- Service isolation without the heavyweight VM. Adding a service to a server does not affect other services on the server.
- Services can be more easily run on a large cluster of nodes making it more reliable.
- Some clients will only host in private and not on public clouds.
- Lends itself to immutable infrastructure, so services are reloadable without missing state when a server goes down.
- Immutable containers improve security since data can only be mutated in specified volumes, root kits often can't be installed even if the system is penetrated.
- Increasing support for new hardware, like the GPU in a container means even gpgpu tasks like deep learning can be containerized.
Costs of microservices
- Managing multiple services tends to be more costly.
- New ways for network and servers to fail.
Conclusion
In the right circumstances, the benefits of microservices outweigh the extra cost of management.