Microservice deployment --- simple jars vs docker containers Microservice deployment --- simple jars vs docker containers docker docker

Microservice deployment --- simple jars vs docker containers


Definitely Docker. Using containerization gives you max flexibility.

In your first approach, you jar is dependent on Java. Whenever you create new VM, you need to install fix set of software to support you application.

Benefits in second approach,

First, everything is going to be in single container.

You can install all required software in container and that container can be user in any VM. You have flexibility to use java of your choice for each microservices. Only install docker and everything is going to be worked.

Second, Dev Prod Parity

If you thing very much of microservice architecture and 12-factor apps. Then docker helps to support lots of factors. Your java and other software are going to be unique in all your environment. That means you are never going to get surprise whether it is working in QA and not in Prod due to some version mismatch of runtime environment.

Third, Flexibility

If you go into microservice architecture, then why only java. You can also go with GO, Python or other languages. At this time, rather installing runtime environment for each platform on each VM it is very useful to have microservice in containers.

Last, Deployment Easiness

You can use docker-compose or docker swarm to run 100s of mivroservice in single command.