I am developing Rest APIs with Spring Boot which is deployed on AWS Beanstalk. Potentially, the service will be getting hits from thousands of clients every day. Therefore I would like to understand capability of Spring Boot of handling multiple requests.
From what I read in Spring-Boot: Handle multiple requests concurrently and How to have thread safe controller in spring boot, it seems Spring Boot can handle requests concurrently while controller being thread safe.
If two requests are made to the same endpoint for updates at the same time though, does the controller deal with the requests one after another or simultaneously with two threads in parallel? If latter, does each thread has its own entity manager? Is there a way to implement a thread pool to limit the number of threads based on the capacity of the EC2 instance? By the way, how do I decide how big of an instance should I start with based on the estimated volumn of requests?