SlideShare a Scribd company logo
1 of 42
Automated
Deployments in
Snowflake
Using Azure DevOps
Hello!
Drew Hansen
Data Engineer at ADESA (KAR Global)
Email: drew.hansen@adesa.com
Twitter: @DrewHansen_9
2
Adorable picture so you
don’t have to look at me
Agenda
● DevOps and Business Intelligence?
● CI/CD Pipelines: What are they?
● Database Deployments: State based vs Migration based
● Snowflake features for CI/CD
● Azure DevOps: Build and Release Pipelines
● Putting it all together: End to End solution
● Demo
● Other Features we added
3
How do
you
deploy?
If you need to deploy a hot fix to a table in
production, what is your process?
4
Agile? DevOps? What’s the
Hype?
It is about the Business!
Agile vs. DevOps
6
Business Developer Technology
Agile DevOps
7
**Image from: https://skookum.com/blog/agile-transformation-and-devops
Agile vs. DevOps
“ An agile culture that better
supports collaboration between
people that uses automation and
tooling in support of process.
8
DevOps is…
- Grant Fritchey
PASS President (the man)
Continuous Integration + Continuous Deployment
Cool people call it CI/CD
Continuous Integration
● Small incremental changes
● Shift Left
● Test often and early
○ Unit Tests
○ Integration Tests
● Outcome: BUILD
Definitions
Continuous Deployment
● Hands Off deployments
● Consistent throughout
environments
● Outcome: RELEASE
10
By source controlling your objects you can revert back
to a specific time/place.
Helps developers feel confident in their changes.
● Automation means less human mistakes.
● Helps developers feel confident in their changes.
● No one has access to production!
Guardrails
11
12
All together now
Look a Pipeline!
13
Build / Release
14
Build
• Packages SQL to be
run on DB
• Runs Unit Tests
• Produces an Artifact
Artifact Release Stage
CI CD
• File(s) that are
irrespective of
environment.
• Artifact will be
deployed into DB
• A release pipeline is
process that deploys to
multiple stages.
• Holds environment
variables.
• A single deployment
into an environment
(DB)
• Ex. 3 stages (DEV, TST,
PRD)
Database Deployments
State based vs Migration based
State Based
● Compare Database to
Repo/Source Control.
● Deploying tool makes
decision on what to deploy
based on differences.
● Source control objects in a
consistent State.
● Ex. CREATE TABLE AS…
● Ex. DACPAC
Definitions
Migration Based
● Simply deploys scripts given by
the developer.
● Source control objects in a
evolving state.
● Ex. ALTER TABLE AS…
16
Confused? Pictures help.
17
DB Project/
DACPAC
DB
compare
generate
execute
Difference
Script
State Based Migration Based
State 1 State n
Migration 1
Script
Migration
n
Script
Laptop
Developer updates
DB Project
Laptop
Developer creates
new script
Laptop
State Based
● None.
WOMP WOMP WOMP…
Database Management Tools
Available To Snowflake
Migration Based
● Liquibase (XML)
● FlyWay (XML/JSON)
● Sqitch (SQL, but complicated)
● Datical (2020?)
● Make your own!
18
😭
👍
Snowflake Features
and Considerations
● Application?
○ Build the app/solution. Easy Peasy.
● Database?
○ Not so fast. Building a script is not testing.
○ You have to Deploy!
○ Annnnnnd break all the DevOps rules we
just discussed.
○ BUT…
How in the world do you
test a deployment?
20
Spoiler: Snowflake Wins…
21
Testing in Snowflake
Zero-Copy Cloning
● Create clones of tables,
schemas, or entire databases
instantly
● Requires NO additional
storage
● Adds no extra load on the
Production users
22
PRD TESTING_BUILD
What does that mean?
23
● I can Create an Artifact (in the Build Process) and Test it (still in
the Build) by Cloning production and trying to deploy to the
clone.
● I can know 100% that the artifact file that is being deployed in the
TESTING_BUILD clone will be deployed successfully to PRD.
● BOOM.
How to Connect to Snowflake
What connector should we use?
Snowflake Connectors
● Tons to choose from!
SnowSQL (CLI) vs. Python
27
● SnowSQL is a command line interface (CLI) built off the Python
Connector.
● Python cannot run multiple statements.
● SnowSQL can run files with over 100 separate queries and over
10K lines of code.
● Once installed, SnowSQL is super simple to use and easy to
configure.
● We choose SnowSQL!
SnowSQL Config File
28
● After installation of SnowSQL, a file called config is created.
○ C:Usersuser.name.snowsqlconfig
● In this file, you can set up connections, variables, and other
configuration settings.
● Connections:
SnowSQL Configuration Settings
29
● Helpful config settings:
○ exit_on_error
■ exists the program immediately when there is an error.
■ If we deploy something and it fails. STOP! DROP! And ROLLBACK!
○ output_file
■ Instead of outputting to the terminal, it will write to a log file.
○ sfqid
■ Output the Snowflake Query ID. Awesome for troubleshooting.
○ output_format
■ Change the look of how the output is formatted, grid vs. txt.
○ friendly
■ Snowflake greets you with hello and goodbye messages… But
Snowflake isn’t my only friend, so I don’t need this.
Azure DevOps
Planning / Repo / Pipelines all in one place!
Azure DevOps.
One Stop Shop(s).  sick rhyme
Boards
With the Azure Boards
web service, teams can
manage their software
projects. It provides a
rich set of capabilities
including native support
for Scrum and Kanban,
customizable
dashboards, and
integrated reporting.
Repo
Azure Repos is a set
of version control
tools that you can
use to manage your
code.
Testing
The testing suite
contains tools for
both exploratory
and manual testing
as well as
automated
continuous testing.
31
Pipelines
Azure Pipelines is a
cloud service that you
can use to
automatically build
and test your code
project and make it
available to other
users. It works with
just about any
language or project
type.
End to End
From Developer Typing Code to Deploy into Snowflake Production.
33
How do we
get there?
34
Pieces to the Puzzle
1. Source Control.
2. Put Process into place (PRs).
3. Decide how to build artifacts to deploy.
4. Decide stages and gates.
5. Deploy using SnowSql.
Set up your Repo
35
● It is crucial to use source control!
● Benefits:
○ Log of every change to your database for all time.
○ Devs can work on the same objects at the same time.
○ Able to trace all changes in a project management tool
(Azure DevOps boards).
Pull Requests
● Created when the developer is ready to promote their code.
● Reviewed by peers, architect, management, etc.
● Benefits:
○ Asynchronous Code Reviews
○ Can add comments and follow up later.
○ Team knows what is going into Prod.
○ No one can merge into master directly!
36
Build Pipeline
● Purpose: Build Artifacts!
● Steps:
1. Download latest repo (master).
2. Create Artifact.
3. Install SnowSQL.
4. Clone PRD database.
5. Test Deploy Artifact.
6. Publish Artifact.
37
Release Pipeline
38
● Purpose: Deploy Artifact to Stages!
● Steps:
1. Download Artifact.
2. Replace Environment Variables.
3. Install SnowSQL.
4. Deploy Artifact to DEV.
5. Deploy Artifact to TST.
6. Final Approval.
7. Deploy Artifact to PRD.
Demo
Bout time, am I right?
Other Features we added
● Both Change and Rollback Scripts
● Run in Rollback-only Mode.
● Write all Deployment Logs to Storage Container via Azure CLI.
40
Other Features…
● Split CICD Pipeline into two: Lower and Upper.
○ Lower:
■ Deploys to DEV.
■ Used for Devs to test deployments.
■ Can be run on-demand.
○ Upper:
■ Deploys to TST and PRD.
■ Locked Down.
■ Only run by merge into master (PR).
● Next Big Enhancement:
○ Automated Testing!
41
42
Thanks!
Any questions?
Email me: drew.hansen@adesa.com
Connect with me: https://www.linkedin.com/in/drew-hansen-09806289/

More Related Content

What's hot

Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesAmazon Web Services
 
DevOps: Benefits & Future Trends
DevOps: Benefits & Future TrendsDevOps: Benefits & Future Trends
DevOps: Benefits & Future Trends9 series
 
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...SlideTeam
 
CI/CD Best Practices for Your DevOps Journey
CI/CD Best  Practices for Your DevOps JourneyCI/CD Best  Practices for Your DevOps Journey
CI/CD Best Practices for Your DevOps JourneyDevOps.com
 
Path to Production: Value Stream Mapping in a DevOps World
Path to Production: Value Stream Mapping in a DevOps WorldPath to Production: Value Stream Mapping in a DevOps World
Path to Production: Value Stream Mapping in a DevOps WorldVMware Tanzu
 
Airbyte @ Airflow Summit - The new modern data stack
Airbyte @ Airflow Summit - The new modern data stackAirbyte @ Airflow Summit - The new modern data stack
Airbyte @ Airflow Summit - The new modern data stackMichel Tricot
 
DBT ELT approach for Advanced Analytics.pptx
DBT ELT approach for Advanced Analytics.pptxDBT ELT approach for Advanced Analytics.pptx
DBT ELT approach for Advanced Analytics.pptxHong Ong
 
Changing the game with cloud dw
Changing the game with cloud dwChanging the game with cloud dw
Changing the game with cloud dwelephantscale
 
Putting the Ops in DataOps: Orchestrate the Flow of Data Across Data Pipelines
Putting the Ops in DataOps: Orchestrate the Flow of Data Across Data PipelinesPutting the Ops in DataOps: Orchestrate the Flow of Data Across Data Pipelines
Putting the Ops in DataOps: Orchestrate the Flow of Data Across Data PipelinesDATAVERSITY
 
Fundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDFundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDBatyr Nuryyev
 
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...Edureka!
 
DevOps Powerpoint Presentation Slides
DevOps Powerpoint Presentation SlidesDevOps Powerpoint Presentation Slides
DevOps Powerpoint Presentation SlidesSlideTeam
 
The Ideal Approach to Application Modernization; Which Way to the Cloud?
The Ideal Approach to Application Modernization; Which Way to the Cloud?The Ideal Approach to Application Modernization; Which Way to the Cloud?
The Ideal Approach to Application Modernization; Which Way to the Cloud?Codit
 
GitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesGitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesVolodymyr Shynkar
 
DataOps: An Agile Method for Data-Driven Organizations
DataOps: An Agile Method for Data-Driven OrganizationsDataOps: An Agile Method for Data-Driven Organizations
DataOps: An Agile Method for Data-Driven OrganizationsEllen Friedman
 

What's hot (20)

DevOps introduction
DevOps introductionDevOps introduction
DevOps introduction
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
DevOps: Benefits & Future Trends
DevOps: Benefits & Future TrendsDevOps: Benefits & Future Trends
DevOps: Benefits & Future Trends
 
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOpsMeetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
 
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
 
Terraform
TerraformTerraform
Terraform
 
CI/CD Best Practices for Your DevOps Journey
CI/CD Best  Practices for Your DevOps JourneyCI/CD Best  Practices for Your DevOps Journey
CI/CD Best Practices for Your DevOps Journey
 
Path to Production: Value Stream Mapping in a DevOps World
Path to Production: Value Stream Mapping in a DevOps WorldPath to Production: Value Stream Mapping in a DevOps World
Path to Production: Value Stream Mapping in a DevOps World
 
Snowflake Overview
Snowflake OverviewSnowflake Overview
Snowflake Overview
 
Airbyte @ Airflow Summit - The new modern data stack
Airbyte @ Airflow Summit - The new modern data stackAirbyte @ Airflow Summit - The new modern data stack
Airbyte @ Airflow Summit - The new modern data stack
 
DBT ELT approach for Advanced Analytics.pptx
DBT ELT approach for Advanced Analytics.pptxDBT ELT approach for Advanced Analytics.pptx
DBT ELT approach for Advanced Analytics.pptx
 
Changing the game with cloud dw
Changing the game with cloud dwChanging the game with cloud dw
Changing the game with cloud dw
 
Putting the Ops in DataOps: Orchestrate the Flow of Data Across Data Pipelines
Putting the Ops in DataOps: Orchestrate the Flow of Data Across Data PipelinesPutting the Ops in DataOps: Orchestrate the Flow of Data Across Data Pipelines
Putting the Ops in DataOps: Orchestrate the Flow of Data Across Data Pipelines
 
Fundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDFundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CD
 
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
 
DevOps Powerpoint Presentation Slides
DevOps Powerpoint Presentation SlidesDevOps Powerpoint Presentation Slides
DevOps Powerpoint Presentation Slides
 
The Ideal Approach to Application Modernization; Which Way to the Cloud?
The Ideal Approach to Application Modernization; Which Way to the Cloud?The Ideal Approach to Application Modernization; Which Way to the Cloud?
The Ideal Approach to Application Modernization; Which Way to the Cloud?
 
GitOps with Gitkube
GitOps with GitkubeGitOps with Gitkube
GitOps with Gitkube
 
GitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesGitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with Kubernetes
 
DataOps: An Agile Method for Data-Driven Organizations
DataOps: An Agile Method for Data-Driven OrganizationsDataOps: An Agile Method for Data-Driven Organizations
DataOps: An Agile Method for Data-Driven Organizations
 

Similar to Snowflake Automated Deployments / CI/CD Pipelines

Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipsterJulien Dubois
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixC4Media
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...OW2
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDoku
 
Idi2018 - Serverless does not mean Opsless
Idi2018 - Serverless does not mean OpslessIdi2018 - Serverless does not mean Opsless
Idi2018 - Serverless does not mean OpslessLinuxaria.com
 
Instant developer onboarding with self contained repositories
Instant developer onboarding with self contained repositoriesInstant developer onboarding with self contained repositories
Instant developer onboarding with self contained repositoriesYshay Yaacobi
 
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesRise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesDiUS
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life DevOps.com
 
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Kaxil Naik
 
Delhi_Meetup_flyway_Integration.pptx
Delhi_Meetup_flyway_Integration.pptxDelhi_Meetup_flyway_Integration.pptx
Delhi_Meetup_flyway_Integration.pptxAnuragSharma900
 
Sean schofield & Richard Lister, Spree Commerce_ Fearless deployment @ Open C...
Sean schofield & Richard Lister, Spree Commerce_ Fearless deployment @ Open C...Sean schofield & Richard Lister, Spree Commerce_ Fearless deployment @ Open C...
Sean schofield & Richard Lister, Spree Commerce_ Fearless deployment @ Open C...Spark Solutions
 
Thinking DevOps in the Era of the Cloud - Demi Ben-Ari
Thinking DevOps in the Era of the Cloud - Demi Ben-AriThinking DevOps in the Era of the Cloud - Demi Ben-Ari
Thinking DevOps in the Era of the Cloud - Demi Ben-AriDemi Ben-Ari
 
Thinking DevOps in the era of the Cloud - Demi Ben-Ari
Thinking DevOps in the era of the Cloud - Demi Ben-AriThinking DevOps in the era of the Cloud - Demi Ben-Ari
Thinking DevOps in the era of the Cloud - Demi Ben-AriDemi Ben-Ari
 
Tips for Installing Cognos Analytics 11.2.1x
Tips for Installing Cognos Analytics 11.2.1xTips for Installing Cognos Analytics 11.2.1x
Tips for Installing Cognos Analytics 11.2.1xSenturus
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tipsSamuel Chow
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Giovanni Toraldo
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychThe Software House
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftYaniv cohen
 
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdfLupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdfWolfgangZiegler6
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBUniFabric
 

Similar to Snowflake Automated Deployments / CI/CD Pipelines (20)

Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
 
Idi2018 - Serverless does not mean Opsless
Idi2018 - Serverless does not mean OpslessIdi2018 - Serverless does not mean Opsless
Idi2018 - Serverless does not mean Opsless
 
Instant developer onboarding with self contained repositories
Instant developer onboarding with self contained repositoriesInstant developer onboarding with self contained repositories
Instant developer onboarding with self contained repositories
 
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesRise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life
 
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
 
Delhi_Meetup_flyway_Integration.pptx
Delhi_Meetup_flyway_Integration.pptxDelhi_Meetup_flyway_Integration.pptx
Delhi_Meetup_flyway_Integration.pptx
 
Sean schofield & Richard Lister, Spree Commerce_ Fearless deployment @ Open C...
Sean schofield & Richard Lister, Spree Commerce_ Fearless deployment @ Open C...Sean schofield & Richard Lister, Spree Commerce_ Fearless deployment @ Open C...
Sean schofield & Richard Lister, Spree Commerce_ Fearless deployment @ Open C...
 
Thinking DevOps in the Era of the Cloud - Demi Ben-Ari
Thinking DevOps in the Era of the Cloud - Demi Ben-AriThinking DevOps in the Era of the Cloud - Demi Ben-Ari
Thinking DevOps in the Era of the Cloud - Demi Ben-Ari
 
Thinking DevOps in the era of the Cloud - Demi Ben-Ari
Thinking DevOps in the era of the Cloud - Demi Ben-AriThinking DevOps in the era of the Cloud - Demi Ben-Ari
Thinking DevOps in the era of the Cloud - Demi Ben-Ari
 
Tips for Installing Cognos Analytics 11.2.1x
Tips for Installing Cognos Analytics 11.2.1xTips for Installing Cognos Analytics 11.2.1x
Tips for Installing Cognos Analytics 11.2.1x
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danych
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdfLupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
 

Recently uploaded

MK KOMUNIKASI DATA (TI)komdat komdat.docx
MK KOMUNIKASI DATA (TI)komdat komdat.docxMK KOMUNIKASI DATA (TI)komdat komdat.docx
MK KOMUNIKASI DATA (TI)komdat komdat.docxUnduhUnggah1
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Boston Institute of Analytics
 
IMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxIMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxdolaknnilon
 
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degreeyuu sss
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsVICTOR MAESTRE RAMIREZ
 
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesConf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesTimothy Spann
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Boston Institute of Analytics
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理e4aez8ss
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Seán Kennedy
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一F sss
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectBoston Institute of Analytics
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGILLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGIThomas Poetter
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Thomas Poetter
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...Amil Baba Dawood bangali
 

Recently uploaded (20)

MK KOMUNIKASI DATA (TI)komdat komdat.docx
MK KOMUNIKASI DATA (TI)komdat komdat.docxMK KOMUNIKASI DATA (TI)komdat komdat.docx
MK KOMUNIKASI DATA (TI)komdat komdat.docx
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
 
IMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxIMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptx
 
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
办美国阿肯色大学小石城分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business Professionals
 
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesConf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
办理学位证加利福尼亚大学洛杉矶分校毕业证,UCLA成绩单原版一比一
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis Project
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGILLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
 

Snowflake Automated Deployments / CI/CD Pipelines

  • 2. Hello! Drew Hansen Data Engineer at ADESA (KAR Global) Email: drew.hansen@adesa.com Twitter: @DrewHansen_9 2 Adorable picture so you don’t have to look at me
  • 3. Agenda ● DevOps and Business Intelligence? ● CI/CD Pipelines: What are they? ● Database Deployments: State based vs Migration based ● Snowflake features for CI/CD ● Azure DevOps: Build and Release Pipelines ● Putting it all together: End to End solution ● Demo ● Other Features we added 3
  • 4. How do you deploy? If you need to deploy a hot fix to a table in production, what is your process? 4
  • 5. Agile? DevOps? What’s the Hype? It is about the Business!
  • 6. Agile vs. DevOps 6 Business Developer Technology Agile DevOps
  • 8. “ An agile culture that better supports collaboration between people that uses automation and tooling in support of process. 8 DevOps is… - Grant Fritchey PASS President (the man)
  • 9. Continuous Integration + Continuous Deployment Cool people call it CI/CD
  • 10. Continuous Integration ● Small incremental changes ● Shift Left ● Test often and early ○ Unit Tests ○ Integration Tests ● Outcome: BUILD Definitions Continuous Deployment ● Hands Off deployments ● Consistent throughout environments ● Outcome: RELEASE 10 By source controlling your objects you can revert back to a specific time/place. Helps developers feel confident in their changes.
  • 11. ● Automation means less human mistakes. ● Helps developers feel confident in their changes. ● No one has access to production! Guardrails 11
  • 14. Build / Release 14 Build • Packages SQL to be run on DB • Runs Unit Tests • Produces an Artifact Artifact Release Stage CI CD • File(s) that are irrespective of environment. • Artifact will be deployed into DB • A release pipeline is process that deploys to multiple stages. • Holds environment variables. • A single deployment into an environment (DB) • Ex. 3 stages (DEV, TST, PRD)
  • 15. Database Deployments State based vs Migration based
  • 16. State Based ● Compare Database to Repo/Source Control. ● Deploying tool makes decision on what to deploy based on differences. ● Source control objects in a consistent State. ● Ex. CREATE TABLE AS… ● Ex. DACPAC Definitions Migration Based ● Simply deploys scripts given by the developer. ● Source control objects in a evolving state. ● Ex. ALTER TABLE AS… 16
  • 17. Confused? Pictures help. 17 DB Project/ DACPAC DB compare generate execute Difference Script State Based Migration Based State 1 State n Migration 1 Script Migration n Script Laptop Developer updates DB Project Laptop Developer creates new script Laptop
  • 18. State Based ● None. WOMP WOMP WOMP… Database Management Tools Available To Snowflake Migration Based ● Liquibase (XML) ● FlyWay (XML/JSON) ● Sqitch (SQL, but complicated) ● Datical (2020?) ● Make your own! 18 😭 👍
  • 20. ● Application? ○ Build the app/solution. Easy Peasy. ● Database? ○ Not so fast. Building a script is not testing. ○ You have to Deploy! ○ Annnnnnd break all the DevOps rules we just discussed. ○ BUT… How in the world do you test a deployment? 20
  • 22. Testing in Snowflake Zero-Copy Cloning ● Create clones of tables, schemas, or entire databases instantly ● Requires NO additional storage ● Adds no extra load on the Production users 22 PRD TESTING_BUILD
  • 23. What does that mean? 23 ● I can Create an Artifact (in the Build Process) and Test it (still in the Build) by Cloning production and trying to deploy to the clone. ● I can know 100% that the artifact file that is being deployed in the TESTING_BUILD clone will be deployed successfully to PRD. ● BOOM.
  • 24. How to Connect to Snowflake What connector should we use?
  • 25. Snowflake Connectors ● Tons to choose from!
  • 26.
  • 27. SnowSQL (CLI) vs. Python 27 ● SnowSQL is a command line interface (CLI) built off the Python Connector. ● Python cannot run multiple statements. ● SnowSQL can run files with over 100 separate queries and over 10K lines of code. ● Once installed, SnowSQL is super simple to use and easy to configure. ● We choose SnowSQL!
  • 28. SnowSQL Config File 28 ● After installation of SnowSQL, a file called config is created. ○ C:Usersuser.name.snowsqlconfig ● In this file, you can set up connections, variables, and other configuration settings. ● Connections:
  • 29. SnowSQL Configuration Settings 29 ● Helpful config settings: ○ exit_on_error ■ exists the program immediately when there is an error. ■ If we deploy something and it fails. STOP! DROP! And ROLLBACK! ○ output_file ■ Instead of outputting to the terminal, it will write to a log file. ○ sfqid ■ Output the Snowflake Query ID. Awesome for troubleshooting. ○ output_format ■ Change the look of how the output is formatted, grid vs. txt. ○ friendly ■ Snowflake greets you with hello and goodbye messages… But Snowflake isn’t my only friend, so I don’t need this.
  • 30. Azure DevOps Planning / Repo / Pipelines all in one place!
  • 31. Azure DevOps. One Stop Shop(s).  sick rhyme Boards With the Azure Boards web service, teams can manage their software projects. It provides a rich set of capabilities including native support for Scrum and Kanban, customizable dashboards, and integrated reporting. Repo Azure Repos is a set of version control tools that you can use to manage your code. Testing The testing suite contains tools for both exploratory and manual testing as well as automated continuous testing. 31 Pipelines Azure Pipelines is a cloud service that you can use to automatically build and test your code project and make it available to other users. It works with just about any language or project type.
  • 32. End to End From Developer Typing Code to Deploy into Snowflake Production.
  • 34. 34 Pieces to the Puzzle 1. Source Control. 2. Put Process into place (PRs). 3. Decide how to build artifacts to deploy. 4. Decide stages and gates. 5. Deploy using SnowSql.
  • 35. Set up your Repo 35 ● It is crucial to use source control! ● Benefits: ○ Log of every change to your database for all time. ○ Devs can work on the same objects at the same time. ○ Able to trace all changes in a project management tool (Azure DevOps boards).
  • 36. Pull Requests ● Created when the developer is ready to promote their code. ● Reviewed by peers, architect, management, etc. ● Benefits: ○ Asynchronous Code Reviews ○ Can add comments and follow up later. ○ Team knows what is going into Prod. ○ No one can merge into master directly! 36
  • 37. Build Pipeline ● Purpose: Build Artifacts! ● Steps: 1. Download latest repo (master). 2. Create Artifact. 3. Install SnowSQL. 4. Clone PRD database. 5. Test Deploy Artifact. 6. Publish Artifact. 37
  • 38. Release Pipeline 38 ● Purpose: Deploy Artifact to Stages! ● Steps: 1. Download Artifact. 2. Replace Environment Variables. 3. Install SnowSQL. 4. Deploy Artifact to DEV. 5. Deploy Artifact to TST. 6. Final Approval. 7. Deploy Artifact to PRD.
  • 39. Demo Bout time, am I right?
  • 40. Other Features we added ● Both Change and Rollback Scripts ● Run in Rollback-only Mode. ● Write all Deployment Logs to Storage Container via Azure CLI. 40
  • 41. Other Features… ● Split CICD Pipeline into two: Lower and Upper. ○ Lower: ■ Deploys to DEV. ■ Used for Devs to test deployments. ■ Can be run on-demand. ○ Upper: ■ Deploys to TST and PRD. ■ Locked Down. ■ Only run by merge into master (PR). ● Next Big Enhancement: ○ Automated Testing! 41
  • 42. 42 Thanks! Any questions? Email me: drew.hansen@adesa.com Connect with me: https://www.linkedin.com/in/drew-hansen-09806289/