What you will be able to do
- Explain what a Client Redirect connection URL identifies and which account it resolves to
- Create a primary connection, enable failover accounts, and create a same-named secondary connection in another region
- Promote a secondary connection during an outage and redirect clients back afterwards, including the DNS step for private connectivity
Key concept
Primary connection — A connection URL names an organization and a connection object. It does not name an account. The URL resolves to whichever account holds the primary copy of that connection, so promoting a secondary connection in another region moves every client at once without changing any client settings.
1.What a connection URL points at
Client Redirect lets applications keep one hostname through a regional outage or a planned move to another region or cloud. When a region fails, nobody has to edit driver configs, BI tool profiles or ETL jobs. The feature is built on a connection object, which stores a secure connection URL that Snowflake clients use in place of an account URL. You can pair Client Redirect with account replication for business continuity, or use it alone to cut down the application changes a region migration needs.
The hostname follows the pattern organization_name-connection_name.snowflakecomputing.com. An account administrator decides which account answers by designating the connection in that account as the primary connection. If an outage hits the region that holds the primary, the administrator promotes a connection in an account in another region. Clients keep using the same URL, and Snowflake resolves it to the account with the newly promoted connection.
The organization name is baked into every connection URL, so check it before you create any connection object. Changing it later means a request to Snowflake Support, and every client that stored the old URL breaks.
Checkpoint 1 of 4· Check yourself
An outage hits the region holding the account with the primary connection. All BI tools and ETL jobs connect through myorg-myconnection.snowflakecomputing.com. What has to happen so those clients reach the account in the unaffected region?
The connection URL names only the organization and the connection object. It resolves to whichever account holds the primary connection. Clients move only when someone promotes the connection in the other region, and no client settings change.
“the administrator can promote a connection in a different account in a different region or cloud platform to serve as the primary connection.”Source: docs.snowflake.com
Sources1
2.Creating the primary and secondary connections
Client Redirect needs an organization administrator to enable replication for two or more accounts first. In the source account, a user with ACCOUNTADMIN then creates the primary connection. Its name must start with a letter, may contain only letters, digits and underscores, and must be unique across both connection names and account names in the organization, because it becomes part of the hostname. The same statement sequence then lists the accounts allowed to hold a secondary copy.
-- Create a new primary connection
CREATE CONNECTION myconnection;
-- View accounts in your organization that are enabled for replication
SHOW REPLICATION ACCOUNTS;
-- Configure failover accounts for the primary connection
ALTER CONNECTION myconnection
ENABLE FAILOVER TO ACCOUNTS myorg.myaccount2, myorg.myaccount3;
-- View the details for the connection
SHOW CONNECTIONS;Every account in that list must be in a different region from the primary. This isn't a style rule. Redirecting from account1 to account2 in the same region simply does not work. Each listed account then creates its secondary with CREATE CONNECTION … AS REPLICA OF, using the fully qualified name taken from the primary column of SHOW CONNECTIONS. The secondary must have the same name as the primary, because the name is part of the URL. Only accounts named in ENABLE FAILOVER TO ACCOUNTS can create one.
CREATE CONNECTION myconnection
AS REPLICA OF myorg.myaccount1.myconnection;| Column | Primary row (MYORG.MYACCOUNT1, AWS_US_WEST_2) | Secondary row (MYORG.MYACCOUNT2, AWS_US_EAST_1) |
|---|---|---|
| is_primary | true | false |
| primary | MYORG.MYACCOUNT1.MYCONNECTION | MYORG.MYACCOUNT1.MYCONNECTION |
| failover_allowed_to_accounts | MYORG.MYACCOUNT2, MYORG.MYACCOUNT3 | (empty) |
| connection_url | myorg-myconnection.snowflakecomputing.com | myorg-myconnection.snowflakecomputing.com |
Private connectivity changes the procedure. Where an account reaches Snowflake over Private connectivity (AWS PrivateLink, Azure Private Link, GCP Private Service Connect), you must create and manage a DNS CNAME record for the connection URL. That applies when you create the primary, when you create each secondary, and again at every promotion. Snowsight can't create these connections for such accounts, so use SQL. Target accounts also don't get private connectivity or Tri-Secret Secure by default. Before you rely on a secondary connection, confirm that the private endpoints exist in the target region. Otherwise the URL can redirect to an account your clients have no private route to.
Checkpoint 2 of 4· Fill the gap
You're signed in to target account myaccount2 to create its secondary connection, which must work with the existing connection URL. Which name completes the statement?
CREATE CONNECTION ?
AS REPLICA OF myorg.myaccount1.myconnection;The connection name is part of the connection URL. Each secondary must therefore have the same name as its primary. Pointing AS REPLICA OF at the right primary is not enough on its own.
Source: docs.snowflake.comCheckpoint 3 of 4· Check yourself
The primary connection lives in myaccount1 in AWS_US_WEST_2. All of the accounts below are enabled for replication. Which one can serve as a working Client Redirect target if you list it in ENABLE FAILOVER TO ACCOUNTS?
Every account that holds a secondary connection must be in a different region from the primary. Redirecting between two accounts in the same region does not work, even if the names match. A different region on the same cloud platform is enough.
“Client Redirect only operates successfully across regions.”Source: docs.snowflake.com
3.Redirecting clients during an outage and back
Promotion runs in the account that is about to become primary. Sign in to that target account and run ALTER CONNECTION myconnection PRIMARY. From then on, the URL resolves there. If private connectivity is in use, update the CNAME record straight away. Once the outage is over, sign in to the original account and run the same statement there to send clients back.
By default, only ACCOUNTADMIN runs these connection commands. An account administrator can grant the FAILOVER privilege on the connection to an account role, so an on-call operator can redirect clients without holding ACCOUNTADMIN. Grant it in the target account, where the promotion will run.
USE ROLE my_failover_role;
ALTER CONNECTION myconnection PRIMARY;Promotion is done from the target account you want to become the new source. The statement runs there, so it does not depend on reaching the account in the failed region.
Checkpoint 4 of 4· Fill the gap
During an outage in Region A, an on-call operator has the FAILOVER privilege on the connection and signs in to the Region B account. Which keyword completes the statement that sends clients to that account?
USE ROLE my_failover_role;
ALTER CONNECTION myconnection ? ;The secondary is promoted by running ALTER CONNECTION … PRIMARY in the target account. After that, the connection URL resolves there. FAILOVER is the name of the privilege that allows this statement, not a keyword in it. You run the same PRIMARY statement in the original account to send clients back after the outage.
Source: docs.snowflake.comSources1
Sources
(2)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Client Redirect is implemented through a Snowflake connection object.”
↩︎ What a connection URL points at“Snowflake resolves the connection URL to the account with the newly promoted connection”
↩︎ What a connection URL points at“Before you create any connection objects, verify that your organization name in Snowflake is satisfactory.”
↩︎ What a connection URL points at“an organization administrator must enable replication for two or more accounts”
↩︎ Creating the primary and secondary connections“Must be unique across connection names and account names in the organization.”
↩︎ Creating the primary and secondary connections“Note that you can only create a secondary connection in an account specified in the ALTER CONNECTION”
↩︎ Creating the primary and secondary connections“you must create and manage a DNS CNAME record for your connection URL”
↩︎ Creating the primary and secondary connections“if your account uses private connectivity, you can’t use Snowsight to create a primary and secondary connection”
↩︎ Creating the primary and secondary connections“Sign in to the target account that you want to promote to serve as the new source account.”
↩︎ Redirecting clients during an outage and back“Once the outage is resolved, promote the original primary connection to serve as the primary connection again.”
↩︎ Redirecting clients during an outage and back“An account administrator can grant the FAILOVER privilege on a connection object to an account role.”
↩︎ Redirecting clients during an outage and back“you are connecting to the account that contains the primary connection.”
↩︎ Key concept“Client Redirect only operates successfully across regions.”
↩︎ Exam trap 1“Each secondary connection must have the same name as its primary connection.”
↩︎ Exam trap 2“Note that this hostname does not specify the account to which you are connecting.”
↩︎ Prediction“the administrator can promote a connection in a different account in a different region or cloud platform to serve as the primary connection.”
↩︎ Checkpoint“Client Redirect only operates successfully across regions.”
↩︎ Checkpoint - 2.
“Target accounts do not have Tri-Secret Secure or private connectivity to the Snowflake service, such as AWS PrivateLink, enabled by default.”
↩︎ Creating the primary and secondary connections