Annotations
Introduction
Annotations is a service that can associate arbitrary information about URLs. The goal is to use it for both history and bookmarks.
Possible uses:
- Visit count (*)
- Last visit date (*)
- Fav icon
- Page thumbnail
- Notes
- Persistent storage for Javascript on the page
(*) May be stored in history instead (TBD)
Note that IE has persistency for web pages called 'userData' which we should understand: http://216.239.63.104/search?q=cache:msdn.microsoft.com/workshop/author/behaviors/reference/behaviors/userdata.asp&hl=en&lr=&sa=G&strip=1 A related feature is 'history' saving, which seems similar except for the current browser session only. The 'favorite' saving behavior is persisted only when the user adds the page to their favorites (seems useless). The 'snapshot' saving behavior saves stuff when the user saves the page to their local machine.
Internal design
The design consists of two tables. The first maps URLs to internal IDs.
The second stores all annotations:
- URL ID
- Annotation name
- Value
- Expiration information
- Flags (perhaps combined with expiration information)
Expiration
Because some annotations can be large, and the number of pages can also become very large, some sort of annotation expiration scheme is required. Annotations beyond the expiration date will be deleted. The time frame must be variable because some annotations may be large and should expire faster, while others may be small and have minimal overhead for keeping them around. The option of never expiring will also be provided.
This time frame may be measured from annotation creation, but it could potentially be more valuable to measure from from last page access time: "this annotation expires after one month of page disuse".
Flags
Flags could indicate whether an annotation is user-entered (e.g. notes) or automatic/service-entered (e.g. favicons, last visit date, etc.); could also store whether that annotation should be synced remotely or not, and possibly other bits.
External interface
Required operations:
- Get/set annotation "x" on this page
- Give me all the annotations on this page
- Give me all pages with annotation "x"="y" or "x" > "y", etc.
Issues: Namespacing of annotation names