Multi-Account Strategy¶
π Organizations - Organization management overview
Overview¶
This document covers Snowflake Organizations, multi-account strategy, replication, failover, and data sharing architecture. These topics represent a significant portion of the SnowPro Advanced Architect exam, focusing on enterprise-grade deployment patterns and business continuity.
Snowflake Organizations¶
Organization Structure¶
- An organization is a top-level container for Snowflake accounts
- Managed by the ORGADMIN role
- Enables centralized account management across regions and cloud providers
- Provides unified billing and usage monitoring across all accounts
π ORGADMIN Role - Organization admin capabilities
ORGADMIN Capabilities¶
- Create and manage accounts within the organization
- View and manage organization-level properties
- Monitor usage and billing across accounts
- Enable replication and failover between accounts
- Cannot access data within individual accounts (separation of duties)
Account Deployment Patterns¶
| Pattern | Use Case | Accounts |
|---|---|---|
| Environment Isolation | Dev/staging/prod separation | 3+ per workload |
| Regional Deployment | Low-latency global access | 1 per region |
| Business Unit Separation | Compliance or billing isolation | 1 per business unit |
| Data Provider/Consumer | Data marketplace architecture | Provider + consumer accounts |
Cross-Cloud and Cross-Region¶
- Accounts can be created on AWS, Azure, or GCP within one organization
- Cross-cloud replication enables data movement between providers
- Cross-region replication provides geographic redundancy
- Different pricing models per cloud provider and region
π Supported Regions - Available cloud regions
Account Replication¶
Replication Groups¶
- Bundle multiple object types for coordinated replication
- Objects replicated together: databases, shares, roles, users, warehouses, parameters
- Replication group defines what is replicated between accounts
- Primary account owns the replication group and controls refresh
π Replication Groups - Replication configuration
Database Replication¶
-- On primary account: enable replication for database
ALTER DATABASE my_db ENABLE REPLICATION TO ACCOUNTS org.secondary_acct;
-- On secondary account: create replica
CREATE DATABASE my_db AS REPLICA OF org.primary_acct.my_db;
-- On secondary account: refresh replica
ALTER DATABASE my_db REFRESH;
-- Check replication status
SELECT * FROM TABLE(INFORMATION_SCHEMA.DATABASE_REPLICATION_USAGE_HISTORY());
- Primary database is read-write
- Secondary (replica) database is read-only
- Refresh is point-in-time snapshot - not continuous
- Refresh frequency configurable (manual or scheduled)
- Cross-region replication incurs data transfer costs
π Database Replication - Database replication guide
Replication Considerations¶
- Storage Cost: Secondary database uses storage in the target account
- Data Transfer: Cross-region/cross-cloud transfers incur network costs
- Latency: Refresh creates a point-in-time copy, not real-time sync
- Objects Replicated: Tables, views, stages, file formats, sequences, UDFs
- Pipes: not replicated by database replication; group-based replication supports pipes (copy history only if the pipe and its target table are in the same group)
- Streams and tasks: replicated, with conditions. Streams need source tables/views in the same replicated database (no shared databases, external tables or append-only streams on replicated sources). Tasks replicate suspended; with group replication they resume only if resumed on the primary and the owner role exists on the secondary; never-resumed tasks are not replicated by database replication
π Replication considerations - what replicates for streams, tasks and pipes
Failover Groups¶
Failover Architecture¶
- Failover groups extend replication groups with failover capability (an admin promotes the secondary)
- Include databases, shares, and account-level objects
- Primary group is read-write, secondary groups are read-only
- Promotion makes a secondary group the new primary
π Failover Groups - Failover configuration
Client Redirect¶
-- Enable client redirect
ALTER ACCOUNT SET ENABLE_ACCOUNT_REDIRECT = TRUE;
-- Connection URL uses organization-level URL
-- snowflake://org-name-account-name.snowflakecomputing.com
-- Resolves to the account holding the promoted (primary) connection
- Connection URLs use organization-level naming
- Once a secondary connection is promoted (
ALTER CONNECTION ... PRIMARY), the connection URL resolves to the new primary - No application code change is needed, only an admin promotion (private connectivity also needs manual DNS CNAME updates)
- DNS-based redirect with configurable TTL
π Client Redirect - Connection failover
Failover vs Replication¶
| Feature | Database Replication | Failover Group |
|---|---|---|
| Scope | Single database | Multiple objects |
| Failover | Manual promotion | Manual promotion (ALTER FAILOVER GROUP ... PRIMARY); client redirect then moves the URL |
| Objects | Database only | Databases, shares, roles, users |
| Use Case | Read replicas | Business continuity / DR |
| Client Impact | Requires connection change | Connection URL moves once the connection is promoted |
Data Sharing¶
Sharing Architecture¶
- Zero-copy data sharing - no data movement or copying
- Provider creates a share object containing databases, schemas, tables, views
- Consumer mounts the share as a read-only database
- Consumer uses their own compute to query shared data
- Provider retains full control and can revoke access at any time
π Data Sharing Introduction - Sharing overview
Share Objects¶
-- Create a share
CREATE SHARE weather_share;
-- Grant access to specific objects
GRANT USAGE ON DATABASE weather_db TO SHARE weather_share;
GRANT USAGE ON SCHEMA weather_db.public TO SHARE weather_share;
GRANT SELECT ON TABLE weather_db.public.forecasts TO SHARE weather_share;
-- Add consumer account
ALTER SHARE weather_share ADD ACCOUNTS = consumer_acct;
-- Consumer: create database from share
CREATE DATABASE weather_data FROM SHARE provider_acct.weather_share;
Secure Views for Sharing¶
-- Secure view hides query logic from consumers
CREATE SECURE VIEW weather_db.public.shared_forecasts AS
SELECT date, region, temperature, precipitation
FROM weather_db.internal.raw_forecasts
WHERE is_published = TRUE;
-- Grant secure view to share (not the underlying table)
GRANT SELECT ON VIEW weather_db.public.shared_forecasts TO SHARE weather_share;
- Secure views hide the view definition from consumers
- Consumers cannot see the underlying SQL or table structure
- Secure UDFs similarly protect function logic
- Both prevent information leakage through EXPLAIN plans
π Secure Views - Secure view documentation
Reader Accounts¶
- Managed accounts for consumers without Snowflake subscriptions
- Provider creates and manages the reader account
- Provider pays for reader account compute (warehouse credits)
- Consumer accesses data through the reader account interface
- Limited functionality compared to full Snowflake accounts
π Reader Accounts - Reader account setup
Snowflake Marketplace¶
- Public platform for discovering and accessing shared data
- Providers can list free or paid datasets
- Consumers get instant access without data copying
- Cross-region auto-fulfillment via replication
- Standard and personalized listings available
π Snowflake Marketplace - Marketplace documentation
Key Decision Framework¶
When to Use Each Pattern¶
| Need | Solution | Key Consideration |
|---|---|---|
| Share with Snowflake users, same region | Direct Share | Zero copy, instant |
| Share with non-Snowflake users | Reader Account | Provider pays compute |
| Access data in another region | Database Replication | Data copy, transfer cost |
| Business continuity / DR | Failover Group | Failover group (admin-promoted) |
| Monetize datasets | Marketplace Listing | Auto-fulfillment |
| Group collaboration | Data Exchange | Private, curated group |
Cost Implications¶
- Data Sharing: No storage cost for provider (data in place), consumer pays compute
- Reader Accounts: Provider pays compute, storage shared from provider
- Replication: Storage cost in target account + data transfer fees
- Failover Groups: Same as replication + failover management overhead
- Marketplace: Platform fees for paid listings, replication for cross-region
Key terms¶
- Replication group - a defined collection of objects in a source account that is replicated as a unit to one or more target accounts, where the copies are read-only.
- Failover group - a replication group that can also fail over, whose secondary becomes read-write only when promoted to primary; it needs Business Critical edition or higher.
- Database replication - copies a single database to another account as a read-only secondary that is refreshed as a point-in-time snapshot, not a continuous sync.
- Client redirect - account redirect using organization-level connection URLs so clients follow the active primary without code changes.
- Share - a provider-side object holding databases, schemas, tables and views that consumers mount as a read-only database, with no data copied.
- Secure view - a view whose definition is hidden from consumers, used to share a filtered subset of data safely.
- Reader account - a provider-managed account for consumers without their own Snowflake account, where the provider pays the compute.