Big Data

Snowflake Virtual Warehouse: An Easy Guide

Pinterest LinkedIn Tumblr

The concept of storing large amounts of data for computing and gaining insights is a popular task that is followed for decades. There have been advancements in the field of storage devices as well as storage technologies that have helped enterprises. Enterprise in the past used on-premise data warehouses for storing, processing, and understanding data, but with the present scenario of an increasing influx of data combined with the fact that data can be preset in different formats, It becomes difficult for an on-premise system to be scaled. This is overcome by using Cloud-based data warehouse solutions like Snowflake and the use of its solutions like Snowflake Virtual Warehouse.

Snowflake Virtual Warehouse represents the solution that is used for computing and storage. This article will provide a comprehensive overview of the snowflake virtual warehouse solutions.

Table of Contents:

  • What is a Snowflake Virtual Warehouse?
    • Advantages of Snowflake Virtual Warehouse
  • Steps to Create Snowflake Virtual Warehouse
  • Benchmarking a Snowflake Virtual Warehouse
  • Scaling The Snowflake Virtual Warehouse
  • Conclusion

What is a Snowflake Virtual Warehouse?

Snowflake Virtual Warehouse is a cluster of computing resources i.e the storage, processing, and computing units. These clusters of database servers are deployed, based on the demands of the user queries. It is a solution that is equivalent to Massively Parallel Processing (MPP) that is present on an on-premise system. The virtual data warehouse is a combination of CPU cores, Storage solutions, and it is deployed in the span of milliseconds. This process is completely transparent to its users.

Snowflake Virtual warehouse is available in different sizes that can be chosen based on demand. It is available in sizes ranging from small to 4XL (also known as t-shirt sizes). The end-users connect to the snowflake virtual data warehouse, by invoking the URL of the Cloud Services Layer.

Advantages of Snowflake Virtual Data warehouse

Dynamic sizing: Since the storage and compute components of the virtual warehouse are independent. The components can be adjusted on the fly since there is also a provision for temporary memory that eases the process of sizing. This means you can start with a small version and then move to 3XL based on demand.

No Contention: The number of virtual data warehouses that can be deployed is not fixed. Since in a traditional data warehouse, the resources are shared it becomes difficult to prioritize. The virtual warehouse has dedicated hardware that is separate for memory and computing which avoids any deadlocks. This results in no contention for resources between different operations.

Automatic suspension: The virtual warehouse is fast in conducting the processes. When the queries are not running, the warehouse can suspend activity and start executing within milliseconds. This allows for saving the processor work seconds, in turn reducing cost and saving resources.

Pay-as-go: snowflake decides the prices, and charges per second of usage. This means that the payment is collected for only the computed resources used.

Steps to Create Snowflake Virtual Warehouse

There are a variety of sizes of virtual data warehouses that are present as options. The image below represents all the sizes as well as all the parameters.

When there is an increase in the size there is a corresponding increase in all the components like CPU, Memory, and Temporary storage. The individual components cannot be altered

But size can be selected that defines and couples all the components together.

You can specify the cluster attributes and the size along with the scaling policy and everything will be done for you.

The workloads of the organizations can be divided between different teams, since creating multiple warehouses is free in Snowflake.

Also, you can use the code given below

— Need SYSADMIN to create warehouses

use role SYSADMIN;

create warehouse Hevo_Example with

        warehouse_size     = SMALL 

       auto_suspend        = 600

       auto_resume         = true

       initially_suspended = true

       comment = ‘Hevo Example Warehouse’;

The above code creates the warehouse.

  • The warehouse_size parameter helps in determining the size of the data warehouse to be created. In this case, we will go with the small size.
  • Auto_suspend parameter determines the time after which the warehouse needs to be suspended in case there are no inputs. In this case, it is 600 seconds or 10 minutes.
  • Auto_resume parameter determines that warehousing starts automatically or requires manual intervention.
  • Initially_suspended determines if the warehouse needs to start from a suspended state if there are no initial inputs.

Now select the warehouse by using the command

           use warehouse Hevo_Example;

Now the SQL queries that are run will be implemented on this virtual warehouse.

Based on the size of data and the number of end-users performing operations on the data, Snowflake offers a wide range of computing clusters. These clusters are categorized based on the size of the data warehouse and data management operations performed on it. While the snowflake virtual warehouse is created and run, it consumes snowflake credits. The credits consumed are determined by the size of the warehouse chosen and the duration it was running. Credit management is one of the important aspects that help in ensuring that there is an efficient use of credits and the cost of the Snowflake virtual warehouse is managed better using these credits.

The below image shows the credits consumed based on the size.

Benchmarking a Snowflake Virtual Warehouse

You can determine the power of all the sizes of the virtual warehouse. Use the command to copy an example table that contains 60 billion rows. The data is about 2TB and is one of the largest tables on Oracle-based data warehouses. When it is performed on a tier 1 system usually takes about 12 hours to run.

create or replace table lineitem as

    select *   

    from snowflake_sample_data.tpch_sf10000.lineitem;

When a graph is plotted between the sizes of the virtual data warehouse, you can see that with an increase in components and computation power the rate of performance increases and elapsed time decreases.

Scaling The Snowflake Virtual Warehouse

Snowflake Warehouse can be scaled in two different ways:

  1. Auto-scale Mode
  2. Maximized Scale Mode

Auto-Scaled:

This scaling mode is chosen when the values for the maximum and the minimum number of clusters are different ( as shown in the image above). When the values are different snowflake uses this mode to dynamically determine and then perform start and stop operations on the cluster. The warehouse is auto-scaled in and out to accommodate the users and query when it increases or decreases.

Maximized Mode:

This scaling mode is chosen when the values entered for both the Minimum and maximum clusters are of the same value ( the number should be > 1). When the warehouse is started it runs on the maximized capacity. It provides all its resources from the start. This mode is recommended when there is a predefined workload with lots of concurrent users. This scaling ensures that there is always a server to support the load as it is functioning at maximum and does not has delay while upscaling the clusters like in auto-scaling.

Also Read – Snowflake Data Lake

Conclusion

With current enterprises using and accepting large amounts of data, it has become quite important that the data storage solution cope with huge influxes. A traditional on-premise system is not very flexible when it comes to the handling of huge volumes of data. Enterprises are moving towards cloud solutions to overcome these scaling issues and improve efficiency. Snowflake provides a trusted cloud-based data warehouse solution. It also has the feature of Snowflake virtual warehousing that allows the users to use clusters that contain all the components for processing, storing, and analyzing data. Users can determine the size of the Snowflake virtual warehouse required, the computational power required, and many more parameters. This article provided a comprehensive guide on the Snowflake Virtual Warehouse.

Moving data from multiple sources to a data warehouse solution is a hectic and difficult task. An automated data pipeline helps in easing this process. Hevo is a No-coding automated data pipeline solution that helps in the efficient transfer of data at affordable pricing.