[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f2tol9tfrpy3i9":3},{"_id":4,"slug":5,"title":6,"subtitle":7,"kind":8,"cards":9,"tags":58,"categories":60,"source":62,"lang":65,"author":66,"audioState":69,"stats":70,"publishedAt":73,"renderer":74},"6abb6e73ca21c797c7e9cbbb","database-modeling-of-a-music-marketplace-part-1-1ad8a9bb","Database Modeling of a Music Marketplace. Part 1","I'd like to discuss database modeling of a big music marketplace — the website Discogs.com.","news",[10,13,18,23,28,33,38,43,48,53],{"headline":6,"body":11,"imageUrl":12,"sourceImageUrl":12},"I'd like to discuss database modeling of a big music marketplace — the website Discogs.com. It's one of the largest databases of physical music media: CDs, vinyl, cassettes, and so on. It covers millions of artists, albums, and releases.","https:\u002F\u002Fmedia2.dev.to\u002Fdynamic\u002Fimage\u002Fwidth=1200,height=627,fit=cover,gravity=auto,format=auto\u002Fhttps%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fare4hz2dq275abc82q2b.png",{"headline":14,"body":15,"imageUrl":16,"images":17},"We're going to build the logical model, following","We're going to build the logical model, following the approach from my Database Design Book. That means cataloging three things: anchors, attributes, and links. For now, we won't talk about the physical schema — tables, indexes, query optimization. We'll focus purely on the business of selling physical music, and what you need to specify for implementation, as if we were building a Discogs clone.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F1.webp",{"local":16},{"headline":19,"body":20,"imageUrl":21,"images":22},"We’ll keep the entire schema in three Google","We’ll keep the entire schema in three Google Docs tables: anchors, attributes and links. Most of the schema describes the logical level. Logical level is independent from a specific database server.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F2.webp",{"local":21},{"headline":24,"body":25,"imageUrl":26,"images":27},"The columns on the right side, “Table name”","The columns on the right side, “Table name”, “Physical column\u002Ftype”, “Table or column names” specify the physical level. We will talk about that much later in the series, because first we need to agree on what we need to implement.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F3.webp",{"local":26},{"headline":29,"body":30,"imageUrl":31,"images":32},"Let's look at a well-known artist: Pink Floyd","Let's look at a well-known artist: Pink Floyd. They have 314 releases at the time of writing, with many versions of each. There's a lot of detail here, but I'll show how to handle it incrementally — start with small pieces, design the basic functionality, and then add detail as needed. Discogs has a huge content catalog: releases and track lists. It’s the main part of the website.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F4.webp",{"local":31},{"headline":34,"body":35,"imageUrl":36,"images":37},"It also has a social-network layer — users","It also has a social-network layer — users can mark that they own an album, that they want to purchase a copy, they can rate stuff, and write reviews. Their first album has more than 100,000 people who own it.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F5.webp",{"local":36},{"headline":39,"body":40,"imageUrl":41,"images":42},"Finally, there's a marketplace: you can buy and","Finally, there's a marketplace: you can buy and sell music. For this particular album there are more than 2500 listings, from sellers all over the world, in all sorts of formats and item qualities. We'll start with the simplest part of the schema.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F6.webp",{"local":41},{"headline":44,"body":45,"imageUrl":46,"images":47},"Looking at the URL — https:\u002F\u002Fwww.discogs.com\u002Fartist\u002F45467-Pink-Floyd — is","Looking at the URL — https:\u002F\u002Fwww.discogs.com\u002Fartist\u002F45467-Pink-Floyd — is often useful when thinking about database design. The artist page has a name, photos (there can be many), links to related sites, a list of members (some crossed out), and name variations. Looking at the release list for this artist, we see format, label, country, and year columns: Format: Album, Vinyl, LP, CD, Cassette, Reissue, Remastered, etc. Label: EMI, Columbia, etc.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F7.webp",{"local":46},{"headline":49,"body":50,"imageUrl":51,"images":52},"Country: US, UK, Europe (yes, \"Europe\" is listed","Country: US, UK, Europe (yes, \"Europe\" is listed as a country), and further down the list, combinations like Australia & New Zealand, or Singapore & Malaysia. Year: just a list of years — straightforward. We'll figure out how to model each of these.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F8.webp",{"local":51},{"headline":54,"body":55,"imageUrl":56,"images":57},"Taking one album — A Saucerful of Secrets","Taking one album — A Saucerful of Secrets — it has a cover photo (again, potentially many), a name, a track list, credits (credits will get complicated, since this is music — more on that later), extensive notes, formats as before, and links to other versions of the same release.","\u002Fapi\u002Fmedia\u002Fposts\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1ad8a9bb\u002F9.webp",{"local":56},[59],"dev",[61],"Technology",{"name":63,"url":64},"Dev.to","https:\u002F\u002Fdev.to\u002Fdatabasedesignbook\u002Fdatabase-modeling-of-a-music-marketplace-part-1-1o08","en",{"handle":67,"displayName":68},"spots","Spots","queued",{"views":71,"likes":72,"saves":72,"shares":72,"completions":72,"opens":72,"skips":72,"depthSum":72},3,0,"2026-09-29T07:53:23.077Z","local"]