0

I'm looking for a simple database design for tags, where the tag-label can be translated (multilingual).

I'm currently looking at Toxi, which is a very simple and clean way of creating a tagging system.

Normal toxi:

Bookmark(id,name,uri,description,time_created)
Tagmap(id,Bookmark_id,Tag_id)
Tag(Tag_id,name)

Would this be a 'correct' way to implement a multilingual toxi tagging scheme?

bookmark(id,name,uri,description,time_created)
tagmap(id,bookmark_id,tag_id)
tag(tag_id)
tagtranslation(id,tag_id,culture,name)
  • Why do tagmap and tagtranslation have an ID columns? They have perfectly good natural keys (bookmark_id,tag_id) in the first case, and (tag_id,culture) in the second. – David Browne - Microsoft Apr 9 at 14:30
  • because I thought it would be easier to pass and use a separate id in the controller and views of an asp.net core mvc application with EF core. (Entity Framework Core and asp.net core mvc do not like so much a multiple keys I believe). – juFo Apr 9 at 14:34
  • 1
    EF Core works fine with compound keys. There's an example in the docs: docs.microsoft.com/en-us/ef/core/modeling/keys And these entities will rarely be used except through Navigation Properties on the tag and bookmark entities. – David Browne - Microsoft Apr 9 at 14:40
  • @DavidBrowne-Microsoft While I understand what you mean and you are correct, there is nothing 'natural' about the keys here. Natural keys in this case would be either name or uri for the bookmark, and the tag 'name'. Also missing is a table for the 'cultures'. – SQLRaptor Apr 9 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.