Search code examples
javadeploymentjettyweb-deploymentjetty-9

Multiple jetty instances for different applications


I am new to applications deployments in web servers altogether. Is it OK to add different instances of jetty webserver for two application - One data service and another angular UI application. Or Do I need to deploy the two applications from the same jetty instance.


Solution

  • Suggestions

    Single jetty server hosting both applications

    1. Use this approach when you own both the services and understand the RPS/throughout/latency/memory requirements of both the services. A bottleneck in one service can cause issue to another service
    2. If the available memory/cpu/capacity is limited and hence don't want to waste additional memory for server by running another server instance
    3. Both services are light weight
    4. Both services are not deployed frequently or there is proper a BCP

    Separate jetty server per application - preferably containerized(Docker?)

    1. Provides good isolation to services
    2. Control over resources per application
    3. Easy to manage/scale independently depending on load
    4. Easy to identify and fix issues

    Personally, i would prefer to run them independently with or without containerization.