All Projects โ†’ mattarderne โ†’ snowflake-starter

mattarderne / snowflake-starter

Licence: other
A _simple_ starter template for Snowflake Cloud Data Platform

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
PLpgSQL
1095 projects

Projects that are alternatives of or similar to snowflake-starter

pre-commit-dbt
๐ŸŽฃ List of `pre-commit` hooks to ensure the quality of your `dbt` projects.
Stars: โœญ 149 (+380.65%)
Mutual labels:  snowflake, dbt
tellery
Tellery lets you build metrics using SQL and bring them to your team. As easy as using a document. As powerful as a data modeling tool.
Stars: โœญ 219 (+606.45%)
Mutual labels:  snowflake, dbt
dbt-ml-preprocessing
A SQL port of python's scikit-learn preprocessing module, provided as cross-database dbt macros.
Stars: โœญ 128 (+312.9%)
Mutual labels:  snowflake, dbt
YATAS
Yet Another Tailwind Alpine Starter
Stars: โœญ 18 (-41.94%)
Mutual labels:  starter-template
rapide
WIP! do not use just yet - Opinionated Vite + Alpine.js starter PWA template
Stars: โœญ 15 (-51.61%)
Mutual labels:  starter-template
stack
A starter repository for MongoDB, Node.js, and Vue.js, with a local environment based on Docker.
Stars: โœญ 48 (+54.84%)
Mutual labels:  starter-template
carto-spatial-extension
A set of UDFs and Procedures to extend BigQuery, Snowflake, Redshift and Postgres with Spatial Analytics capabilities
Stars: โœญ 131 (+322.58%)
Mutual labels:  snowflake
react-bootstrap-starter
A react-bootstrap starter template with react-router
Stars: โœญ 27 (-12.9%)
Mutual labels:  starter-template
Butterfly
ๅˆ†ๅธƒๅผID็”Ÿๆˆๅ™จๆก†ๆžถ๏ผš่ถ…้ซ˜ๆ€ง่ƒฝ็š„ๅ‘ๅทๅ™จๆก†ๆžถใ€‚้€š่ฟ‡ๅผ•ๅ…ฅๅคš็งๆ–ฐ็š„ๆ–นๆกˆ๏ผŒๅฝปๅบ•่งฃๅ†ณ้›ช่Šฑ็ฎ—ๆณ•็š„ๆ—ถ้—ดๅ›žๆ‹จ็ญ‰้—ฎ้ข˜๏ผŒๅนถๅฐ†้›ช่Šฑ็ฎ—ๆณ•ๅŽŸ็”ŸQPSๆ้ซ˜ๆœ€ๅฐ‘ๅๅ‡ ~ไบŒๅๅ€
Stars: โœญ 111 (+258.06%)
Mutual labels:  snowflake
Minimalist-Blog
Tailwind CSS Starter Template - Minimalist Blog
Stars: โœญ 21 (-32.26%)
Mutual labels:  starter-template
nuxt-starter-netlify-cms
Example nuxt + netlify cms project. Nuxt port of Gatsby starter app.
Stars: โœญ 13 (-58.06%)
Mutual labels:  starter-template
kuwala
Kuwala is the no-code data platform for BI analysts and engineers enabling you to build powerful analytics workflows. We are set out to bring state-of-the-art data engineering tools you love, such as Airbyte, dbt, or Great Expectations together in one intuitive interface built with React Flow. In addition we provide third-party data into data scโ€ฆ
Stars: โœญ 474 (+1429.03%)
Mutual labels:  dbt
top-nuxt3
Full stack Nuxt 3 Template starter with Supabase and Tailwindcss
Stars: โœญ 59 (+90.32%)
Mutual labels:  starter-template
lightdash
An open source alternative to Looker built using dbt. Made for analysts โค๏ธ
Stars: โœญ 1,082 (+3390.32%)
Mutual labels:  dbt
njs-typescript-starter
A starting template for developing njs (NGINX JavaScript) scripts for NGINX server in TypeScript.
Stars: โœญ 20 (-35.48%)
Mutual labels:  starter-template
sfquickstarts
Follow along with our tutorials to get you up and running with the Snowflake Data Cloud.
Stars: โœญ 83 (+167.74%)
Mutual labels:  snowflake
snowworker
Website snow! It'll settle on anything that has a .rooftop class.
Stars: โœญ 25 (-19.35%)
Mutual labels:  snowflake
django-webpack-starter
Django Webpack starter template for using Webpack 5 with Django 3.1 & Bootstrap 4. Yes, it can hot-reload.
Stars: โœญ 52 (+67.74%)
Mutual labels:  starter-template
astro
Astro allows rapid and clean development of {Extract, Load, Transform} workflows using Python and SQL, powered by Apache Airflow.
Stars: โœญ 79 (+154.84%)
Mutual labels:  snowflake
airflow-dbt
Apache Airflow integration for dbt
Stars: โœญ 233 (+651.61%)
Mutual labels:  dbt

snowflake-starter

A starter template for Snowflake Cloud Database

  • Snowflake offers a 1 month free trial, and with this repo you should be able to get a sense for the basics of Snowflake within an hour.
  • This template will create the necessary ROLE, USER, DATABASE, SCHEMA & WAREHOUSE(s) necessary to get up and running with Snowflake:

snowflake.png

Strongly recommend taking a looking at managing Snowflake with Terraform once you're familiar with the basics.

Usage

Requirements

1. Deploy

Copy first_run.sql into a worksheet as in the screenshot below and Run All.

Or use the CLI

snowsql -c <your_connection_name> -f first_run.sql

snowflake.png

Infrastructure Details

The following is created, as described in first_run.sql

โ”œโ”€โ”€ DATABASES
โ”‚   โ”œโ”€โ”€ RAW                     # This is the landing pad for everything extracted and loaded
โ”‚   โ””โ”€โ”€ ANALYTICS               # This database contains tables and views accessible to analysts and reporting
โ”œโ”€โ”€ WAREHOUSES
โ”‚   โ”œโ”€โ”€ WAREHOUSE_INGEST        # Tools like Stitch will use this warehouse to perform loads of new data
โ”‚   โ”œโ”€โ”€ WAREHOUSE_TRANSFORM     # This is the warehouse that dataform/dbt will use to perform all data transformations
โ”‚   โ”œโ”€โ”€ WAREHOUSE_REPORT        # BI tools will connect to this warehouse to run analytical queries
โ”œโ”€โ”€ ROLES
โ”‚   โ”œโ”€โ”€ ROLE_INGEST             # Give this role to your Extract/Load tools/scripts to load data
โ”‚   โ”œโ”€โ”€ ROLE_TRANSFORM          # Give this role to Dataform/dbt to transform data, and Data Engineers
โ”‚   โ”œโ”€โ”€ ROLE_REPORT             # Give this role to BI tools / Analysts to query analytics data
โ”œโ”€โ”€ USERS
โ”‚   โ”œโ”€โ”€ USER_INGEST             # eg: Stitch User
โ”‚   โ”œโ”€โ”€ USER_TRANSFORM          # eg: Dataform User
โ”‚   โ”œโ”€โ”€ USER_REPORT             # eg: Looker user

2. Test

Use the test_permissions.sql SQL to:

  1. create a base table in the RAW database, load a test row using the ROLE_INGEST role
  2. create a new table and view in ANALYTICS using the ROLE_TRANSFORM role
  3. query that view using the ROLE_REPORT role

NB replace <USERNAME> in the file with your login name

Or use the CLI:

snowsql -c <your_connection_name> -f test_permissions.sql

3. JSON

JSON is very well handled in Snowflake, and worth a look. The test_json.sql file runs through the flattening of raw JSON into a table.

Or use the CLI:

snowsql -c <your_connection_name> -f test_json.sql
  • Key to note is the RECURSIVE=>TRUE flag

4. User-Defined Functions

UDF allow you to create functions in SQL or JavaScript. The test_udf.sql file runs through the creation and testing of a SQL and JavaScript UDF. See the docs for more

Or use the CLI:

snowsql -c <your_connection_name> -f test_udf.sql

5. Tear Down

The first_run_drop.sql file will drop all objects created by first_run.sql

Or use the CLI:

snowsql -c <your_connection_name> -f first_run_drop.sql

6. SnowSQL-CLI

If you want to do this more than once, the SnowSQL CLI is great.

git clone https://github.com/mattarderne/snowflake-starter.git
cd snowflake-starter
snowsql -c <your_connection_name> -f first_run.sql

7. End to End Test

If the following script runs without error, then that is an end to end test... it should take about a minute. (change the <placeholders> in the file)

sh tests/run.sh

Other things

SnowAlert

SnowAlert is a project maintained by Snowflake that provides some useful system monitoring features. I like to use some of the queries they have created to monitor cost spikes.

The snowAlert.sql creates the views and runs the queries necessary to get alerts. Running it daily in Dataform/dbt is a nice way to get custom alerts to unusual spikes

snowsql -c <your_connection_name> -f utils/snowAlert.sql -o friendly=false -o quiet=true

Snowflake Inspector

If you'd like to keep track of the evolution of your Snowflake Data Warehouse, snowflakeinspector is a great tool to do just that. Query your metadata and paste the results into their tool and you'll get a nice explorable visualisation as below:

snowflakeinspector.png

Thanks

TODO

TODO: Snowflake Inspector

  • Schema:
    • explore "analytics" database for primary keys, analyse for similarity, unnamed primary keys, variables etc
    • make suggestions
  • Costs
    • Explore query history and build a recommendation for query optimisation
    • Visualise
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].