Tags: Database schemas
Popularity Report
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
URL Tag Cloud
Bookmark History
Saved by 92 people (-24 private), first by anonymouse user on 2006-03-02
- Domasm on 2009-08-01 - Tags webdev , database , tagsystems , sql , tagging
- Aquagrrl on 2009-05-01 - Tags tagging , tags , database , mysql , sql , programming
- Xuxiaowei on 2009-02-27 - Tags database , tagging , mysql , schema , delicious , tags
- Hepplerj on 2009-01-15 - Tags programming , tags , mysql , web2.0 , webdevelopment , delicious , analysis
- Neocryptek on 2008-12-30 - Tags imported , tagging_system
Public Sticky notes
Highlighted by babdya
Tags: Database schemas
Recently, on del.icio.us mailinglist, I asked the question “Does anyone know the database schema of del.icio.us?” .
I got a few private responses so I wanted to share the knowledge with the world.
The Problem: You want to have a database schema where you can tag a bookmark (or a blog post or whatever) with as many tags as you want. Later then, you want to run queries to constrain the bookmarks to a union or intersection of tags. You also want to exclude (say: minus) some tags from the search result.
Highlighted by cdetrio
If you want to have more complicated queries like (bookmarks OR bookmark) AND (webservice or WS) AND NOT (semweb or semanticweb) the queries tend to become very complicated. In these cases I suggest the following query/computation process:
- Run a query for each tag appearing in your “tag-query”:
SELECT b.id FROM tagmap bt, bookmark b, tag t WHERE bt.tag_id = t.tag_id AND b.id = bt.bookmark_id AND t.name = "semweb" - Put each id-set from the result into an array (that is: in your favourite coding language). You could cache this arrays if you want..
- Constrain the arrays with union or intersection or whatever.
In this way, you can also do queries like (del.icio.us|delicious)+(semweb|semantic_web)-search. This type of queries (that is: the brackets) cannot be done by using the denormalized “MySQLicious solution”.
This is the most flexible data structure and I guess it should scale pretty good (that is: if you do some caching).
Highlighted by xuxiaowei


Public Comment
on 2006-08-06 by tomo-dzfl
on 2006-08-24 by toxmeister
on 2006-10-01 by pmckinstry
on 2007-01-01 by transitmonger