Why run microservices using Docker and Kubernetes?

Posted by: Seth Lakowske

Published:

If your development department is growing and adding new teams. In order to remain agile, you may find microservices offer advantages to a large codebase with a plurality of teams. You can avoid needing to synchronize across a whole company and break the problems down into smaller more easily understood modules.

Benefits of microservices

  1. Code can be broken out into smaller microservices that are easier to learn, release and update.
  2. Individual microservices can be written using the best tools for the job.
  3. Releasing a new service doesn't require synchronization across a whole company.
  4. New technology stacks have lower risk since the service is relatively small.
  5. Developers can run containers locally, rebuilding and verifying after each commit on a system that mirrors production.
  6. Both Docker and Kubernetes are open source and free to use.
  7. Access to Docker hub leverages the work of the opensource community.
  8. Service isolation without the heavyweight VM. Adding a service to a server does not affect other services on the server.
  9. Services can be more easily run on a large cluster of nodes making it more reliable.
  10. Some clients will only host in private and not on public clouds.
  11. Lends itself to immutable infrastructure, so services are reloadable without missing state when a server goes down.
  12. 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.
  13. Increasing support for new hardware, like the GPU in a container means even gpgpu tasks like deep learning can be containerized.
There is a cost for running microservices - the build and runtime becomes more complex. This is part of the price to pay and if you've made the right decision in your context, then benefits will exceed the costs.

Costs of microservices

  1. Managing multiple services tends to be more costly.
  2. New ways for network and servers to fail.

Conclusion

In the right circumstances, the benefits of microservices outweigh the extra cost of management.