1) Retry
2) Timeout
3) Backoff
Good client libraries have knobs for each one, so you can tune for your application's needs.
docs.aws.amazon.com/redshift/lates…
aws.amazon.com/blogs/develope…
~~~ ssh and curl! ~~~
Super common tools, but both require non-default config to be used in a reliable application. Think build scripts, automated ops tools, and monitoring canaries that you want to withstand failures.
Add this to your SSH config:
Host *
ConnectTimeout 10
ConnectionAttempts 10
And use these curl options:
curl --retry 3 --connect-timeout 10 --max-timeout 20 --retry-max-time 30
(tune the exact numbers for your application's needs)