Choose an Appropriate Deployment Model

HDR supports access to its services through local and remote EJBs. In remote mode, HDR runs in its own application server instance and client code communicates with it through RMI. In local mode, HDR and the client code are co-located on the same application server. Selection of the appropriate deployment model depends on the requirements of your application.

HDR hides the differences between the two deployment modes—thus permitting the same code to be executed largely without change in either mode (although some minor changes are required to set the mode to local.

For production purposes, the choice comes down to a balance between performance and flexibility. Accessing HDR in local mode performs better than remote mode in terms of throughput and latency. However, local deployment requires your application code to be co-located on the same application server. For many Web based applications, this may be acceptable, but there are other applications (such as rich clients) where this is not possible. In such cases, remote deployment may be preferable.

However, the choice between local and remote access is not absolute. HDR exposes all of its services as remote and local EJBs. In this way, it is possible to interact with HDR in different modes from within the same application. For example, you could split your business logic between a rich client-tier application in remote mode, and a customer middle-tier session bean in local mode, both of which could access HDR.