Giter VIP home page Giter VIP logo

data-lake's Introduction

Data Lake with Spark

Overview

A music streaming startup, Sparkify, has grown their user base and song database even more and want to move their data warehouse to a data lake. Their data resides in S3, in a directory of JSON logs on user activity on the app, as well as a directory with JSON metadata on the songs in their app.

As their data engineer, you are tasked with building an ETL pipeline that extracts their data from S3, processes them using Spark, and loads the data back into S3 as a set of dimensional tables. This will allow their analytics team to continue finding insights in what songs their users are listening to.

Project Structure

The repository is made up of the following files:

.
├── dl.cfg       # Configuration file containing AWS IAM credentials
├── etl.py       # Extracts data from S3 and processes using Spark
└── README.md

Data Lake Schema

This project implements a star schema. songplays is the fact table in the data model, while users, songs, artists, and time are all dimensional tables.

Fact Table

  • songplays - records in event data associated with song plays (records with page = NextSong)
    • start_time, userId, level, sessionId, location, userAgent, song_id, artist_id, songplay_id

Dimensional Tables

  • users - users of the Sparkify app.
    • firstName, lastName, gender, level, userId
  • songs - collection of songs.
    • song_id, title, artist_id, year, duration
  • artists - information about artists.
    • artist_id, artist_name, artist_location, artist_lattitude, artist_longitude
  • time - timestamps of records in songplays, deconstructed into various date-time parts.
    • start_time, hour, day, week, month, year, weekday

How to Run

  1. Add appropriate AWS IAM Credentials in dl.cfg
  2. Specify desired output data path in the main function of etl.py
  3. Run etl.py

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.