Snowflake Architecture · Topic 12 of 18
Object Hierarchy - Account Level Objects, Roles and Warehouses
How Snowflake objects nest from organization to schema, and why roles and virtual warehouses sit at account level and shape ownership, isolation and cost.
- 6 min
- Hierarchy: organization, account, database, schema, schema objects. Names are
database.schema.object. - Roles, users and warehouses are account level; database roles live inside a database.
- Reading a table needs
USAGEon the database and schema plusSELECTon the table.
What it is
Every Snowflake object lives at a fixed level of a hierarchy. The level decides where you create it, how you name it, which privileges reach it, and what happens to it when its parent is dropped, cloned, replicated or shared.
For the exam, the skill is to place an object at the right level and then predict the consequence. Roles and warehouses are account level objects, so they are not inside a database. Tables, views and stages are schema level objects, so they always belong to one schema in one database.
How it works
The levels
| Level | Examples of what lives there |
|---|---|
| Organization | Accounts, organization level usage and billing views |
| Account | Users, roles, virtual warehouses, resource monitors, network policies, security and storage integrations, shares, databases, replication and failover groups |
| Database | Schemas, database roles |
| Schema | Tables, views, stages, file formats, sequences, streams, tasks, pipes, functions, procedures, policies, tags |
A fully qualified name follows the path: database.schema.object. Sessions use USE DATABASE and USE SCHEMA to set a default, so a short name resolves against the current database and schema.
Impact of the hierarchy on design
- Privileges flow down through USAGE. To read a table a role needs
SELECTon the table,USAGEon its schema andUSAGEon its database. MissingUSAGEon a parent is a classic cause of "object does not exist or not authorized". - Dropping a parent drops its children. Dropping a schema drops its tables and other objects, and dropping a database drops its schemas.
- Cloning, replication and sharing work at container level. You clone or replicate a database or schema, and you share objects from a database. Account level objects such as warehouses and users are not inside a database, so database clone and share do not carry them.
- Parameters inherit down. A parameter such as
DATA_RETENTION_TIME_IN_DAYSset on an account applies to databases, schemas and tables unless a lower level sets its own value. - Separate environments (development, test, production) are usually separate databases, or separate accounts when isolation or editions must differ.
Roles
Roles are account level objects. Access is normally granted to roles (role-based access control), and roles can be granted to other roles to form a hierarchy in which a parent inherits the privileges of its children.
| System role | Purpose |
|---|---|
| ORGADMIN | Manages the organization and its accounts |
| ACCOUNTADMIN | Top account role; combines SECURITYADMIN and SYSADMIN |
| SECURITYADMIN | Manages grants; inherits USERADMIN, so it can also manage users and roles |
| USERADMIN | Creates users and roles |
| SYSADMIN | Creates warehouses, databases and other objects |
| PUBLIC | Granted automatically to every user and role |
The recommended pattern is to build custom roles and grant them up to SYSADMIN, so administrators can manage every object. Use functional roles for job functions (analyst, engineer) and access roles that hold object privileges, and grant access roles to functional roles.
Database roles are different. They live inside one database, hold privileges on that database's objects, and are granted to account roles or to shares. Because they travel with the database, they are the right tool for clone, replication and sharing, where account roles cannot follow.
Ownership matters. Each object has one owner role, and by default the owner can grant privileges on it. In a schema created WITH MANAGED ACCESS, only the schema owner, or a role with MANAGE GRANTS, can grant privileges on objects inside it, which stops object owners handing out access.
When a question needs access to follow a database across clone, replication or share, the answer is a database role, not an account role.
Virtual warehouses
A virtual warehouse is an account level compute resource. It is not stored in a database and has no link to the data it queries. Any warehouse can query any table its role is allowed to read, which is how Snowflake separates storage from compute.
Architectural consequences:
- Workload isolation. Give each workload (loading, BI, data science) its own warehouse so one cannot slow another. Warehouses do not share compute or local cache.
- Cost attribution. Credits are charged per warehouse, so one warehouse per team or workload makes cost charge back simple. Pair warehouses with resource monitors.
- Privileges.
USAGElets a role run queries on a warehouse,OPERATElets it suspend and resume,MODIFYlets it resize, andMONITORlets it see usage. Creating warehouses is normally done by SYSADMIN. - Not replicated with the data. A database replica holds data and schema level objects. Warehouses replicate only through replication or failover groups (Business Critical or higher), and they arrive suspended.
| Question | Answer |
|---|---|
| Where is a warehouse created? | At account level, not in a database |
| What does a role need to run a query on it? | USAGE on the warehouse plus the privileges on the data |
| How to stop two teams slowing each other down? | Separate warehouses |
| How to cap spend? | Resource monitor on the warehouse or account |
Common mistakes
Putting account objects "in" a database. Users, roles, warehouses and integrations are account level. They do not move with a database clone, share or database replication.
Granting only table privileges. Without USAGE on the schema and database the role cannot reach the table.
Using account roles in shares. Shares and clones use database roles for privilege packaging. Account roles are not part of a share.
One warehouse for everything. Mixed workloads compete for the same compute and make cost reporting impossible by team.
What to remember for the exam
- Hierarchy: organization, account, database, schema, schema objects. Names are
database.schema.object. - Roles, users and warehouses are account level; database roles live inside a database.
- Reading a table needs
USAGEon the database and schema plusSELECTon the table. - Custom roles roll up to SYSADMIN; grant privileges to roles as the standard pattern (direct user grants exist but are the exception).
- Managed access schemas centralize granting with the schema owner or
MANAGE GRANTS. - Warehouses are independent of data: isolate workloads and attribute cost per warehouse.
Check yourself
A role has SELECT on a table but gets an authorization error. What is the likely gap?
The role lacks
USAGEon the table's schema or database.Which role type should carry privileges that must follow a database into a share or replica?
A database role, granted to the share or to account roles.
Why create separate warehouses for ETL and dashboards?
Warehouses do not share compute, so separation isolates workloads and gives per team cost attribution.
Topic 12 of 18 in Snowflake Architecture
Test yourself on Snowflake Architecture
The full Snowflake ARA-C01 question bank has 687 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.