
Db2 REST services with high availability
To ensure that your Db2 REST service requests are processed with high availability, the target of the REST service requests must be a Db2 data sharing group.
You need to satisfy the following requirements when you configure the Db2 data sharing group for REST services with high availability:
- Use a group IP address so that any available member of the group can be accessed to satisfy a REST request.
- Use the same TCP port value for all members of the data sharing group. This requirement is true for a Db2 data sharing group that is accessed by any distributed clients, and not just for REST request clients.
For a z/OS® environment, a Db2 group IP address should be a distributed dynamic virtual IP address (DDVIPA). A DDVIPA is a sysplex distributor IP address that is managed by z/OS Communications Server. A DDVIPA provides the technology to balance socket connection requests to a set of servers. Those servers listen for inbound connection requests on a common TCP port. If at least one of the members of the data sharing group is available, a client that uses the sysplex distributor IP address (or its defined DNS domain name) can establish a connection to a member of the data sharing group. A DDVIPA does not balance the REST requests that are sent to a member of the data sharing group. After a path has been established for a connection, for as long as the connection persists, all REST requests that use the connection follow the established path.
Example: Processing of REST requests with high availability
The following figure shows a Db2 for z/OS data sharing environment that supports REST requests with high availability.
The data sharing group has three members: DB2A, DB2B, and DB2C. Assume that the environment is configured as follows:
- The data sharing members are all listening on port 446.
- DDVIPA Vx is configured within the z/OS sysplex to handle requests for port 446.
- The REST client is configured to request a REST request against a server with IP address Vx and TCP port 446.
A REST request is processed in the following way:
- A new socket connection request is sent from the REST client to sysplex distributor Vx.
- Sysplex distributor Vx determines whether data sharing member DB2A, DB2B, or DB2C receives the connection request.
- The data sharing member that the sysplex distributor chose in the previous step builds and sends a reply directly to the REST client.
- For a persistent connection, each REST client request that uses the connection is sent to sysplex distributor Vx. Sysplex distributor Vx forwards the request to the previously selected data sharing member, and that data sharing member sends its reply directly to the client.
Db2 closes a persistent connection that remains idle for more than approximately 15 seconds. A persistent connection is considered to be idle when it is waiting for a new REST request from the client.
