Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot + Tomcat - Microservices solution

I'm planning to expose few microservices (~20 at this stage) using Spring Boot. I will be creating executable fat jars using the embededed Tomcat. The executable jar will be wrapped in Docker container and deployed to AWS.

In my case 20 jars will have 20 tomcat instances running at the same time. I'm concerned about the overhead of running so many tomcat instances in the production server. Is this a valid concern?

I was wondering if someone has used something similar configuration in production and can share their experience.

Any suggestions will be appreciated.

Thanks JP

like image 601
JP Singh Avatar asked Jun 28 '15 07:06

JP Singh


2 Answers

We currently use AWS and Spring Cloud / Spring Boot. Our stance is instances that require more resources receive their own EC2 instance. Services that can be deployed using Docker are deployed to Amazon ECS.

All of our deployments are fat jars using embedded Tomcat.

Not knowing the size of what you are calling a service makes this answer a little complicated. If you are worried about Tomcat's overhead why are you running these services in Docker containers? Ease of deployment?

If you do go the route of deploying multiple services to the same Tomcat instance, I would not define your setup as a microservices based configuration.

like image 79
code Avatar answered Nov 14 '22 04:11

code


You may try to deploy all your services (webapps) into one or more tomcat instances. You may not include the Tomcat into war file. Example maven/spring configuration you may find here

like image 20
Konstantin Pavlov Avatar answered Nov 14 '22 05:11

Konstantin Pavlov