Skip to content

Design docs

mmamadilov edited this page Aug 17, 2017 · 8 revisions

Database Design

Currently, there are three core entities: Release, Artist and User.

Release

Release document has the following structure:

{
    "_id": "",
    "name": "",
    "artist_list": [ // Issue with queries.
                    // Can't we query artist and access it's list of releases?
        { 
            "artist_name": "",
            "artist_id": ""
        },
        ...
    ],
    "cover_image_url": "",
    "images_urls": [ "", "" ],
    "catalog_numbers": [
        {
            "label_name": "",
            "label_id": "",
            "catalog_num": ""
        },
        ...
    ],
    "format": "",
    "country": "",
    "released_date": {"$dateDay":"yyyy-mm-dd"},
    "genre": "",
    "style": "",
    "track_list": [
        {
            "name": "",
            "position": ,
            "duration": ,
            "artist_list": [
                {
                    "artist_name": "",
                    "artist_id": ""
                },
                ...
            ]
        },
        {
            "name": "",
            "position": ,
            "duration": ,
            "artist_list": [
                {
                    "artist_name": "",
                    "artist_id": ""
                },
                ...
            ]
        }
    ],

    "barcode": "",
    "status": "",
    "packaging": "",
    "language": "",
    "script": "",
    "MBID": "",
    "reviews" : [ 
        {
            "username": "",
            "user_id": "",
            "date": "",
            "content": ""
        }, 
        ...
    ]
}

Artist

Artist document has the following structure:

{
    "_id": "",
    "name": "",
    "profile_image_url": "",
    "images_urls": [ "", "" ],
    "type": "",
    "gender": "", 
    "area": "",
    "begin_date": {"$dateDay":"yyyy-mm-dd"},
    "end_date": {"$dateDay":"yyyy-mm-dd"},
    "IPI": "",
    "ISNI": "",
    "MBID": "",
    "disambiguation_comment": "",
    "release_ids": [ "", "" ]
}

User

User document has the following structure:

{
    "_id": "",
    "user_name": "",
    "email": "",
    "joined_date": {"$dateDay":"yyyy-mm-dd"},
    ...
}
Clone this wiki locally