Just a second...

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.

While the Diffusion server includes a web server, this internal web server is intended for the following uses:
  • 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
For more information, see Diffusion web server.

Do not use the Diffusion web server as the host for your production website. Instead use a third-party web server.

There are two ways you can use Diffusion with 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

Figure 1. Using a web server with Diffusion Simple graphic showing a square representing a web server beside an equal sized square representing a Diffusion server. Both the web server and the Diffusion server are beneath a wide rectangle representing a load balancer.

Why use a separate web server with Diffusion?

You can use a third-party web server to host your Diffusion browser clients.

A third-party web server provides the following advantages over the lightweight internal Diffusion web server:
  • 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.

Using a separate web server with the Diffusion server provides the following advantages over deploying the Diffusion server inside a web application server:
  • 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

Figure 2. Deploying Diffusion inside a web application server Simple graphic showing a square representing a Diffusion server inside a large rectangle representing a web application server. Both the web server and the Diffusion server are beneath a wide rectangle representing a load balancer.

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