Search code examples
snowflake-cloud-data-platformdatabase-schema

What are best practices around creating schemas?


I am creating new database in Snowflake and working on migrating data from other data sources. What are best practices around creating schemas? Should I create multiple schemas for logical groups of data? Should I migrate all tables in one schema? Should I use PUBLIC schema or create new ones? Wondering what are pros and cons and best practices of each? Thanks!


Solution

  • Database schemas separate out the data into different entities and helps to organize the data.

    A] Best Practices:

    1. Define naming convention to schema so it will be easy to figure out the data relevance and ownership context
    2. Avoid system keywords to name schema
    3. Don't use special characters
    4. Void long name
    5. Use access level wisely, avoid admin privilege to all users

    B] You can create multiple schema if it helps to differentiate logical group like – entity, department, user groups etc.

    C] You can use Public schema for data which can be accessed by all users Please let me know if it helps Or you need any help.