Last Update Feature

From MusicBrainz Wiki
Revision as of 21:08, 16 April 2009 by (talk) (Proposed New Update Rules: ISRC)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Last Update database extension

This feature keeps track of when data in the database last changed. Changed, in this case could be any update to the database. It could be an edit that changes something important like the name or just the count of how many edits are open for this artist. This feature is designed to allow us to add the following features to MusicBrainz:

  • "Artist was last updated X days ago" display in the server.
  • RSS feeds for artists, albums and labels. You could subscribe to feeds of your artists and see changes being made to their data in MB.
  • HTTP caching, which would allow us to let Google index the site without costing us a lot of bandwidth.

Not all of these features will be implemented immediately. For the next release I foresee doing the first two items above.

Originally we had planned to have the update rules change other related data items. For instance, updating a release would also cause the artist and the label associated with the release to be updated. However, our database server buckled under the load to constantly update all of this information so we were forced to abandon this approach and not have any cascading updates happen.

The feature as it stands now only updates one data entity at a time. So, if a release is edited the artist nor its associated labels will be updated.

Database changes

For this feature we added new tables: artist_meta, label_meta. These tables only contain an id column (with a foreign key to the artist/label tables) and a lastupdate timestamp. For releases (albums in DB speak) we added the lastupdate column to the albummeta table. (I can't wait to get the naming in the DB normalized).

Update rules

If an artist is changed, artist is updated.

If a release is changed, release is updated.

If a label is changed, label is updated.

If release event is changed, then update the related releases.

If discid is changed, then update the related releases.

Non implemented update rules

If an alias is changed, then related artist is not updated.

If a track is changed, added or removed from a release, then related releases are not updated.

If an AdvancedRelationship is changed, none of the end-points is updated.

If a PUID is changed, no entity (track, release, ...) is updated.

Proposed New Update Rules

Affected object Affected table Actions triggering the timestamp update Entities having their timestamp updated
aicon.png Artist artist Update (Edit Artist, Edit Artist Name, Edit Artist Sortname, Change Artist Quality) aicon.png Artist
Artist alias artistalias Creation (Add Artist Alias), Update (Edit Artist Alias), Delete (Remove Artist Alias) aicon.png Related artist
Artist annotation annotation Creation (Add Artist Annotation), Update (Edit Artist Annotation) aicon.png Artist
bicon.png Label label Update bicon.png Label
Label alias labelalias Creation (Add Label Alias), Update (Edit Label Alias), Delete (Remove Label Alias) bicon.png Related label
Label annotation annotation Creation (Add Label Annotation), Update (Edit Label Annotation) bicon.png Label
Release-group release-group Update (change artist, change name, change type) Release-group
licon.png Release album Update (Edit Release Name, Edit Release Attributes, Edit Release Language, Move Release) licon.png Release
licon.png Release album(.release_group) Update (Move release from release-group A to release-group B) licon.png Release & release-group
DiscID album_cdtoc Add (Add DiscID), Update (Move DiscID), Remove (Remove DiscID) licon.png Related release(s)
Release Event release Add, Edit, Remove licon.png Related release & bicon.png related label
Release annotation annotation Creation (Add Release Annotation), Update (Edit Release Annotation) licon.png Release
licon.png Release / ticon.png Track album_join Merge Releases (when source release has more tracks than target release), Update (Edit Track Number) licon.png Release & ticon.png Track(s)
ticon.png Track track Update (Edit Track Name, Edit Track Time, Change Track Artist, Set Release Durations) ticon.png Track
Track annotation annotation Creation (Add Track Annotation), Update (Edit Track Annotation) ticon.png Track
PUID puidjoin - (not sure we want to do it) ticon.png Track
ISRC isrc - (not sure we want to do it) ticon.png Track
AdvancedRelationShips l_* Add Relationship, Edit Relationship, Remove Relationship Both end point entities (excepted URL)