Coder Social home page Coder Social logo

k-souvatzidaki / music-streaming-service Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 4.0 891 KB

A client-broker-server music streaming application, for the Distributed Systems course @/AUEB, Greece (2020)

Java 100.00%
java distributed-systems client-server-architecture university-project

music-streaming-service's Introduction

Music Streaming Service

About

A group project for a distributed systems course in uni. A simple music streaming service implemented in a client-broker-server model. This distributed application consists of 4 kinds of nodes, the Publishers(or servers), the Brokers,the Zookeeper, and the Consumers(or clients). The Publishers, the Zookeeper and the Brokers run Java apps on many computers (or a single computer but using different ports), while the Consumers run an Android application. The nodes communicate via network using Java sockets.

Publisher-Broker-Consumer model description

Each node has a different purpose. Briefly, the Publishers store mp3 file data and forward them to the Brokers, each time a Consumer requests some song data. The Brokers, then, forward the requested data to the Consumers. Load balancing is achieved via the use of many Brokers . Each Broker is answering requests for a range of songs ,ex. a range of song name initials. A Broker answers Consumer requests for songs starting with A-C, another one for songs starting with D-F, etc. The distribution of song names to the Brokers is achieved with SHA-1 hashing, in a way similar to the CHORD peer-to-peer protocol.We used 3 brokers for this assignment. Parallel programming using threads is also used, so that many Consumers can send requests for the same songs simultaneously.

The Zookeeper

This node is used to synchronise the Brokers, so that all Brokers know which song requests to answer. The Zookeeper could possibly do more things as in the Apache Kafka stream-processing software platform, but we kept it simple for this project.

The Android app

The Consumers are running a simple Android application that can run both online or offline. If online, the app is initially requesting song information from the brokers and showing the song names in a scrollable list. The user can select an artist and a song, and the application instantly sends a request for the song to the right Broker. Then, the user can listen to the music with a simple player. Clients can also download songs. If offline, the user can listen to downloaded songs only.

Datasets

The song datasets are copyright-free and can be downloaded here

Libraries

We used the mp3agic library to read mp3 file tags.

How to run

Download the dataset from the link above, and place it in the Event Delivery System folder. In the Event Delivery System/src/../Node.java file there are lists with the addresses of Publishers, Brokers, Zookeeper. We change the ip addresses manually. We execute the main apps in the following order: -> first Zookeeper.java. -> then Broker1.java, Broker2.java, Broker3.java, in any order. Each of these files contains a main method, one for each Broker. -> then Publisher1.java, Publisher2.java (main for Publishers), in any order. -> finally, we run the Android application on a mobile phone or Android Studio VM, for the Consumer.

Group

Themelina Kouzoumpasi Lydia Athanasiou
Konstantina Souvatzidaki

music-streaming-service's People

Contributors

k-souvatzidaki avatar themelinakz avatar

Stargazers

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