Search code examples
architecturecontainersmicroservices

I want explanation on where we can use microservices instead of containers and some applications of it


Example of a micro services application that we would do without using Containers. Explain why should we take that approach?


Solution

  • The reason because normally containers are used in a microservices architecture is that it is an easy and light way to isolate an application so you can share the same physical machine among multiple services without problems of library dependencies or operating system requirements.

    Apart from that, you can specify in the container the amount of resources your service needs so the same physical CPU or memory can be shared among the services proportionally as the services need. And this is an important feature for cloud providers because they have a limited number of machines and they have to share them among all the applications deployed.

    Technically, It is not necessary to use containers in a microservices architecture, for example, if you manage the physical machine and the library dependencies are the same for all your services and the ports needed for each service don't collide with the others you can deploy your services in traditional application servers in your machine without other problems but they wouldn't be portable.