Project Documentation

Project Documentation

Purpose

The aim of this project is to help me in order to manage my music collection.

Also, I want to split this project in different microsrvices in order to improve my knowledge about them and microsrvices architecture.

Service Intercomunication

The following graph shows how microservices are communicated.

graph TD;
User -- Asks for an artist, album or pendent job --> Request_Manager[Request Manager];
Request_Manager -- Request info if job has finished --> Storage_Manager[Storage Manager];
Request_Manager -- Asks for job satus --> Status_Manager[Status Manager];
Storage_Manager -- Check for requested info --> MusicInfoStore[(Music Info Store)];

Request_Manager -- No job found, create a job --> Job_Manager[Job Manager];
Job_Manager -- Store pendent job ID --> Status_Manager;
Status_Manager -- Store job ID with pending status --> JobStatusStore[(Job Status Store)];
Status_Manager -- Update job with finished status --> JobStatusStore[(Job Status Store)];
Status_Manager -- Check job status --> JobStatusStore[(Job Status Store)];

Job_Manager -- Send new job --> Job_Router[Job Router];
Job_Router -- Route job --> Metal_Archives_Wrapper[Metal archives wrapper];
Metal_Archives_Wrapper -- Retrieve info --> Metal_Archives((metal-archives));
Metal_Archives_Wrapper -- Returns retrieved info--> Job_Router;
Job_Router -- Not found at metal archives - Look for info --> Music_Brainz_Wrapper[Music Brainz wrapper];
Music_Brainz_Wrapper -- Retrieve info --> Music_Brainz((musicbrainz));
Music_Brainz_Wrapper -- Returns retrieved info --> Job_Router;
Job_Router -- Job has finished  - Send retrieved info to be stored --> Storage_Manager;
Job_Router -- Job has finished  - Send job final status to be stored --> Status_Manager;
Storage_Manager[Storage Manager] -- Store retrieved info --> MusicInfoStore[(Music Info Store)];

Services

Request Manager

Repo

Main entry of this Service, serves public API and communicates with other services.

Functions:

  • Manage User requests
  • Retrieve Required info.
  • If required info was not found, a job with info retrieval request is requested to Job Manager.

Job Manager

Repo

This service manages job traffic.

Functions:

  • Creates jobs for retrieving artists and records info, which are received by Job Router.
  • Creates jobs status.

Job Router

Repo

  • Routes jobs to wrappers.
  • If wrappers does not find required info, job is routed to the next configured wrapper.
  • When there are no more wrappers to route jobs, this service sends info to Storage Manager.
  • When there are no more wrappers to route jobs, this service send final job status to Status Manager.

Metal Archives Wrapper

Repo

This service retrieves Artists and Records info from Metal Archives

With or without info, state is returned to Job Router.

Musicbrainz Wrapper

Repo

This service retrieves Artists and Records from MusicBrainz

With or without info, state is returned to Job Router.

Storage Manager

Repo

This service stores, updates and retrieves Artists, Albums and Jobs info.

Status Manager

Repo

This service stores, updates, retrieves jobs statuses.

Common Libraries

Some microservices will use the same data types for their communications, instead of duplicating code, shared libraries will be used.

Common types

Repo

Common types used by Music Manager microservices ecosystem.

Storage Repository

Repo

Storage repository used by multiple Music Manager services.