Snowflake Tutorial
Snowflake Tutorial
Audience
This tutorial has been prepared for beginners to help them understand what Snowflake is,
what all features it has, and how to use the tool.
Prerequisites
You should have a basic understanding of SQL, Database concepts, knowledge of database
schema, and general caching concepts.
All the content and graphics published in this e-book are the property of Tutorials Point (I)
Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish
any contents or a part of contents of this e-book in any manner without written consent of
the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely as
possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.
Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website
or its contents including this tutorial. If you discover any errors on our website or in this
tutorial, please notify us at contact@[Link].
1
Snowflake Tutorial
Table of Contents
About the Tutorial ....................................................................................................................................... 1
Audience ..................................................................................................................................................... 1
Prerequisites ............................................................................................................................................... 1
2
Snowflake Tutorial
History ....................................................................................................................................................... 73
3
Snowflake Tutorial
Monitoring ................................................................................................................................................ 75
Using UI ..................................................................................................................................................... 93
Using UI ..................................................................................................................................................... 96
Using UI ..................................................................................................................................................... 99
4
1. Snowflake – Introduction Snowflake Tutorial
Snowflake is advanced solution for OLAP (Online Analytical Processing) technology. OLAP is
also known as online data retrieving and data analysis system using historical data. It
processes complex and aggregated queries with low number of transactions. For Ex: Getting
number of orders, sales amount in last month for a company, number of new users list in the
company in last quarter etc. Snowflake is not used as OLTP (Online Transactional Processing)
database. OLTP database usually contains real time data with a high volume of small data
transactions. For Ex: Inserting customer's order detail, register a new customer, tracking
order delivery status etc.
There is no hardware neither virtual nor physical to select, install, configure or manage
from client side.
Traditional databases for analytics solutions are complex in architecture, costly and
constrained while Snowflake is rich in concept of Data Engineering, Data Lake concept, data
warehouse, Data Science, Data Application and Data Exchange or sharing. It is easy to access
and use without having constraint of data size and storage capacity. User must administrate
only their data; all data platform related administrations are done by Snowflake itself.
Simple, reliable data pipelines in multi languages like Java, Python, PHP, Spark, Ruby
etc.
5
Snowflake Tutorial
6
2. Snowflake – Data ArchitectureSnowflake Tutorial
Snowflake data architecture re-invents a new SQL query engine. It is designed for the cloud
only. Snowflake doesn't utilize or built on top of any existing database technology. It doesn't
even use big data software platforms like Hadoop. Snowflake provides all functionalities of an
analytical database plus numbers of additional unique features and capabilities to users.
Snowflake has central data repository for storage of structured and semi-structured data.
These data can be accessed from all available compute nodes in the Snowflake platform. It
uses virtual warehouse as compute environment for processing the queries. While processing
queries, it utilizes multi-cluster, micro-partitioning and advanced cache concepts. Snowflake's
cloud services are responsible to provide end to end solution to the user like logging validation
of user to result of select queries.
Database Storage
Query Processing
Cloud Services
7
Snowflake Tutorial
Database Storage
Snowflake supports Amazon S3, Azure and Google Cloud to load data into Snowflake using
file system. User should upload a file (.csv, .txt, .xlsx etc.) into the cloud and after they create
a connection in Snowflake to bring the data. Data size is unlimited, but file size is up to 5GB
as per cloud services. Once data is loaded into Snowflake, it utilizes its internal optimization
and compression techniques to store the data into central repository as columnar format. The
central repository is based on cloud where data stores.
Snowflake owns responsibilities to all aspects of data management like how data is stored
using automatic clustering of data, organization and structure of data, compression technique
by keeping data into many micro-partitions, metadata, statistics and many more. Snowflake
stores data as data objects and users can't see or access them directly. Users can access
these data through SQL queries either in Snowflake's UI or using programming language like
Java, Python, PHP, Ruby etc.
Query Processing
Query execution is a part of processing layer or compute layer. To process a query, Snowflake
requires compute environment, known as "Virtual Warehouse" in Snowflake's world. Virtual
warehouse is a compute cluster. A virtual warehouse consists of CPU, Memory and temporary
storage system so that it could perform SQL execution and DML (Data Manipulation Language)
operations.
However, the number of servers depends on size of virtual warehouses. For example, XSmall
warehouse has 1 Server per cluster, while a Small Warehouse has 2 Servers per cluster and
it gets double on increasing the size such as Large, XLarge, etc.
While executing a query, Snowflake analyzes the requested query and uses the latest micro-
partitions and evaluates caching at different stages to increase performance and decrease the
time for bringing the data. Decrease the time means less credit is used of a user.
Cloud Services
Cloud Service is the 'Brain' of the Snowflake. It coordinates and manages activities across
Snowflake. It brings all components of Snowflake together to process user requests from
logging validation to deliver query's response.
8
Snowflake Tutorial
9
3. Snowflake – Functional Architecture
Snowflake Tutorial
Snowflake supports structured and semi-structured data. Snowflake organizes and structures
the data automatically once data loading is completed. While storing the data, Snowflake
divides it on his intelligence and saves into different micro-partitions. Even Snowflake stores
data into different clusters.
At functional level, to access data from Snowflake, the following components are required:
Data Transformation
Supports for Business Application
Business Analytics/Reporting/BI
Data Science
Data Sharing to other data systems
Data Cloning
The symbol of "settings" as in each block can be referred as Warehouse and XS, XXL,
XL, L, S as sizes of warehouse requires to perform different operations. Based on requirement
and usage, the size of a warehouse can be increased or decreased; even it can be converted
from single cluster to multi-clusters.
10
Snowflake Tutorial
11
4. Snowflake – How to Access Snowflake Tutorial
Snowflake is a licensed data platform. It uses the concept of credit to charge to clients.
However, it provides 30-days free trial with $400 credits for learning purpose.
Use the following steps to get a free access to Snowflake for 30 days:
Open the URL "[Link] and click "START FOR FREE" at the right
corner of the page.
It navigates to the registration page where the user needs to provide details such as
as First Name, Last Name, Email, Company, and Country. After filling the form, click
the "CONTINUE" button.
12
Snowflake Tutorial
On the next screen, it asks to choose the Snowflake edition. Select the edition based
on functionalities you want to perform. For this tutorial, standard version is sufficient
but for data loading using AWS S3 we require business critical edition.
Select Business Critical and then click AWS. Select the region where your AWS is
present.
Check the Terms & Condition box and click the Get Started button.
13
Snowflake Tutorial
You will get a message that Account creation is in progress and an email is sent to
your address as below screen.
Check your email's inbox. Once you receive the email from Snowflake, usually within
2-3 mins, click the "Click to Activate" button.
It will navigate to Snowflake's page where user requires to set up username and
password. This credential will be used to login into Snowflake.
14
5. Snowflake – Editions Snowflake Tutorial
Standard
Enterprise
Business Critical
Virtual Private Snowflake (VPS)
Standard Edition
It is the basic version of Snowflake. It provides the following features in this edition:
Enterprise Edition
It is Standard+ edition i.e. all features of Standard edition plus following additional features:
Multi-cluster warehouses
Time travel up to 90 days
Encryption key changes annually
Materialized Views
Search Optimization Services
Dynamic Data Masking
External Data Tokenization
15
Snowflake Tutorial
HIPPA support
PCI compliance
Data Encryption everywhere
AWS Private Link Support
Azure Private Link Support
Database Failover and fallback
==========
16