Giter Site home page Giter Site logo

song_analysis_airflow's Introduction

Data pipeline using airflow

Propose of the project

Since the sparkify a music streaming company is growing rapidly, the company wants to introduce more automation and monitoring to their data warehouse ETL pipelines.

About datasets

The songs data & log data are in JSON format that are stored in Amazon S3

Tech stack

  • Python
  • Apache Airflow
  • Postgres
  • AWS redshift
  • Notion for project management
  • Github for Version control

Usage manual

  • Create connection "aws_credentials" & "redshift" for storing aws credentials & redshift connection string, respectively.
  • Create variable named s3_bucket, s3_prefix, region and json_format, which will be used in the program
  • Run the airflow server using "airflow standalone command"
  • Go to localhost:8080 in browser
  • Run dag named sparkify_analysis to perform following task in sequence
    • Create staging, facts and dimension tables
    • Load data from s3 to staging tables
    • Load data from staging tables to facts and dimension tables
    • Check the quality of data

Files description

The project consists of following files:

sparkify_dag.py

This is the major file of the project in which all of the tasks and their ordering are defined.

create_tables.sql

This file consists of all queries required for creating staging, fact, and dimension tables.

Operator: staging_redshift.py

This operator allows tasks in dag to load data from s3 to redshift staging tables

sql_quries.py

This file consists of all sql queries that are required to load data on the facts and dimension table.

Operator: load_fact.py

This operator loads data from the staging table in redshift to the fact table

Operator: load_dimension.py

This operator loads data from the staging table to the dimension tables

Operator: data_quality.py

This operator validates the data loaded to the facts and dimension table

Generated DAG

  • Graph view

  • Tree view

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.