How the endpoint discovery pattern works
Timestream is built using a cellular architecture to ensure better scaling and traffic isolation properties. Because each customer account is mapped to a specific cell in a region, your application must use the correct cell-specific endpoints that your account has been mapped to. When using the SDKs, this mapping is transparently handled for you and you do not need to manage the cell-specific endpoints. However, when directly accessing the REST API, you will need to manage and map the correct endpoints yourself. This process, the endpoint discovery pattern, is described below:
-
The endpoint discovery pattern starts with a call to the
DescribeEndpoints
action (described in theDescribeEndpoints
section). -
The endpoint should be cached and reused for the amount of time specified by the returned time-to-live (TTL) value (the
CachePeriodInMinutes
). Calls to the Timestream API can then be made for the duration of the TTL. -
After the TTL expires, a new call to DescribeEndpoints should be made to refresh the endpoint (in other words, start over at Step 1).
Syntax, parameters and other usage information for the
DescribeEndpoints
action are described in the API
Reference. Note that the DescribeEndpoints
action is
available via both SDKs, and is identical for each.
For implementation of the endpoint discovery pattern, see Implementing the endpoint discovery pattern.