Code Monkey home page Code Monkey logo

postgresql-cassandra--musicstreamingapp's Introduction

PostGreSQL-Cassandra--MusicStreamingApp

This repository has the code fo both making the Sparkify database with POSTGRESQL and Apache Cassandra

Sparkifydb

The sparkifydb database contains lots of information about songs, artists albums and users. The data was originally in multiple .json files divided into song_data and log_data. By parsing this information the Sparkify startup is able to search their songs to find artists and songs by the Song Title, Artist Name, or Song Duration. This helps catalog their information and make it usable.

PostGreSql

The Database Schema we used was a PostGreSQL Star Schema. This allows for simple queries, easy aggregations, and denormalized tables. The ETL pipeline allows for the json files to be easily parsed and inserted into the tables.

How to Run the Script:

  1. Open test.ipynb & run Cells one at a time.
  2. After Cell 4 you are able to run any queries you would like. All the tables are made and values are inserted.

Files:

  • sql_queries.py
  • etl_POSTGRESQL.py
  • etl_POSTGRESQL.ipynb
  • data folder - full of the .json data

Example Queries:

  • Provide example queries and results for song play analysis. https://www.postgresqltutorial.com/postgresql-group-by/
  • Select Count(user_id) from users Where level = paid; - this would tell us the amount of users that pay for the services
  • Select artist_id count(songplays_id) from songplays group by artist_id - this would give you the number of plays from each artist

Apache Cassandra

Create the same database by running the Songify_Cassandra_ Project.ipynb Juptyner Notebook.

Queries:

With NOSQL its always good to know the queries before you design the DB

  1. Give me the artist, song title and song's length in the music app history that was heard during sessionId = 338, and itemInSession = 4
  2. Give me only the following: name of artist, song (sorted by itemInSession) and user (first and last name) for userid = 10, sessionid = 182
  3. Give me every user name (first and last) in my music app history who listened to the song 'All Hands Against His Own'

Files:

  • Songify_Cassandra_ Project.ipynb
  • event_datafile_new.csv

postgresql-cassandra--musicstreamingapp's People

Contributors

maggieortiz 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.