Web servers
Consider how to use web servers as part of your Diffusion™ solution.
If you are using Diffusion in conjunction with a web client or web application, this web client or application must be hosted on a web server.
- Hosting the Diffusion landing page, demos, and management console
- Providing an endpoint for the HTTP-based transports used by Diffusion clients
- Optionally, hosting a static page you can use the check the status of the Diffusion server
Do not use the Diffusion web server as the host for your production website. Instead use a third-party web server.
- As separate, complementary components in your solution.
- With the Diffusion server deployed inside a web application server.
Use a separate web server with the Diffusion server
Why use a separate web server with Diffusion ?
You can use a third-party web server to host your Diffusion browser clients.
- Greater ability to scale
- More comprehensive security
- Server-side code and dynamic web pages
If your organization already uses a third-party web server, Diffusion augments this component instead of replacing it.
- The load balancer set up is simpler
- You can scale the number of Diffusion servers and the number of web servers in your solution independently and more flexibly
- The web server and the Diffusion server do not share a JVM process, which can cause performance advantages
- The web server and the Diffusion server are independent components, which makes them unlikely to be affected by any problems that occur in the other component
For more information, see Hosting Diffusion web clients in a third-party web server.
Considerations when using a separate web server with the Diffusion server
If your web server hosts a client that makes requests to a Diffusion server in a different URL space, you can use a load balancer to composite the URL spaces and interoperate with browser security or you can set up cross-domain policy files that allow requests to the different URL space.
When the Diffusion server is separate from the web server, the web server has no access to the Diffusion Server API.
Deploy the Diffusion server inside a web application server
Why deploy Diffusion inside a web application server?
You can also host your Diffusion server inside a third-party web application server that has the capability to host Java™ servlets.
This provides the advantage of only setting up a single server and having a single application to manage when hosting your web application.
The web application server has access to the Diffusion Server API of the Diffusion server is hosts. This enables your web application to use server-side logic to include Diffusion information in your web pages.
For more information, see Running the Diffusion server inside of a third-party web application server.
Considerations when deploying the Diffusion server inside a web server
When running inside a web application server, the Diffusion server still requires its own internal web server to communicate with clients over HTTP-based transports.
Your web application and your Diffusion server, while hosted by the same server, can have different port numbers. This can result in cross-origin security concerns for some browsers. You can use a load balancer to composite the ports or you can set up cross-domain policy files that allow requests to the different ports.
The load balancer configuration can be more complex when deploying the Diffusion server inside a web application server. If you have multiple web application server and Diffusion server pairs, configure your load balancer to ensure that requests from a client always go to a pair and not to the web application server from one pair and the Diffusion server from another pair.
When running the Diffusion server inside of a web application server, the Diffusion server and the web application server share a JVM process. This can lead to large GC pauses. Ensure that you test this configuration and tune the JVM