Ensure service reliability

Updated

Use domain fallback and retry strategies for RTC REST API requests.

To ensure high availability of REST services, Agora enables you to switch domain names when you experience service outage due to regional network failures.

Switch the domain name

  1. Set the primary domain name based on the location of your service server:

    • If the DNS address of the service server is located outside mainland China, set the primary domain name to api.agora.io.
    • If the DNS address of the service server is in mainland China, set the primary domain name to api.sd-rtn.com.
  2. If your attempt to initiate a REST API request using the primary domain fails, use the following retry strategy:

    • Primary domain retry: Retry using the same primary domain name.
    • Alternate domain retry: If the current primary domain name is api.sd-rtn.com, use api.agora.io as the alternate domain name. If the current primary domain name is api.agora.io, use api.sd-rtn.com as the alternate domain name.
    • Adjacent domain retry: If alternate domain retry fails, retry using a regional domain name adjacent to the current region.

For example, suppose your business server is located in Europe. You set the primary domain name to api.agora.io, and the business server resolves the primary domain to Germany. Germany is in Central Europe, corresponding to api-eu-central-1.agora.io. The adjacent region is Western Europe, so you can retry using api-eu-west-1.agora.io or api-eu-west-1.sd-rtn.com.

Precautions

  • To avoid exceeding the QPS limit with retry requests, use a backoff strategy. For example, wait 1 second before the first retry, 3 seconds before the second retry, and 6 seconds before the third retry.
  • If the request fails because of a network problem rather than DNS resolution, skip alternate domain retry and proceed to adjacent domain retry.
  • Before switching to a regional domain name, make sure the REST service you call, such as Channel Management, is deployed in that region.

Domain name table

Primary domain nameRegion domain nameRegion
api.sd-rtn.comapi-us-west-1.sd-rtn.comWestern United States
api.sd-rtn.comapi-us-east-1.sd-rtn.comEastern United States
api.sd-rtn.comapi-ap-southeast-1.sd-rtn.comSoutheast Asia Pacific
api.sd-rtn.comapi-ap-northeast-1.sd-rtn.comNortheast Asia Pacific
api.sd-rtn.comapi-eu-west-1.sd-rtn.comWestern Europe
api.sd-rtn.comapi-eu-central-1.sd-rtn.comCentral Europe
api.sd-rtn.comapi-cn-east-1.sd-rtn.comEast China
api.sd-rtn.comapi-cn-north-1.sd-rtn.comNorth China
api.agora.ioapi-us-west-1.agora.ioWestern United States
api.agora.ioapi-us-east-1.agora.ioEastern United States
api.agora.ioapi-ap-southeast-1.agora.ioSoutheast Asia Pacific
api.agora.ioapi-ap-northeast-1.agora.ioNortheast Asia Pacific
api.agora.ioapi-eu-west-1.agora.ioWestern Europe
api.agora.ioapi-eu-central-1.agora.ioCentral Europe
api.agora.ioapi-cn-east-1.agora.ioEast China
api.agora.ioapi-cn-north-1.agora.ioNorth China