Git Product home page Git Product logo

project-data-warehouse's Introduction

Introduction

In this Udacity Project, we are helping a streaming startup, Sparkify to move their data to the cloud. We builded a ETL process, to read the data from a Amazon S3 bucket and send to a Amazon Redshift database and create the analytics tables from the raw data.

Datasets

The datasets used in this project was provided by the Udacity in the a public S3 bucket.

One of the buckets contains the songs and artist data and the second one has the user events on the app. The datasets are in the format of json.

Schema

We have the staging tables and the star schema.

In the end of this section their a image of the schema

Staging Tables

  • stage_events - table with the info about the user events
  • stage_songs - table with the info about the data song and artists

Dimesion Tables

  • dim_user - the table who holds the user data
  • dim_song - the table who holds the song data
  • dim_artist - the table who holds the artist data
  • dim_time - the table who holds the time data

Fact Table

  • fact_songplay - records of the events linked to the songs

diagram

Configuration and Setup

You have two ways to run the project

    1. Using the Terraform to configurate all you need in the AWS
    1. Configure manually on the AWS Console and set the local variables
    1. Copy the local_dwh.cfg and save as dwh.cfg

But first of all you need to:

  • Create the IAM User in the AWS Console.
  • Give the needed access AdministratorAccess and attach policies.

1. Using Terraform

    1. Create the venv and install the dependencies
    poetry shell && poetry install
    1. Set the AWS SECRET_KEY and SECRET_ID
 export AWS_SECRET_ACCESS_KEY=...
 export AWS_ACCESS_KEY_ID=...
    1. Run the command bellow, who will create the terraform plan and run the terraform apply and set the needed envvars
    make setup
    1. Now just run the create_tables.py and the etl.py
    python3 create_tables.py && python3 etl.py
    1. And in the end, run the command bellow to destroy the AWS services created.
    make destroy

2. Setting manually

  • Use access key and secret key to create clients for IAM and Redshift.

  • Create an IAM Role that makes Redshift able to access S3 bucket (ReadOnly)

  • Create a RedShift Cluster and get the DWH_ENDPOINT(Host address) and DWH_ROLE_ARN and fill the config file with the same information in the local_dwh.cfg.

  • Update the dwh.cfg with the needed information.

  • Now just run the create_tables.py and the etl.py

    python3 create_tables.py && python3 etl.py

project-data-warehouse's People

Contributors

deividmarreiro avatar

Watchers

 avatar

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.