[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [syndication] Aggregating and displaying feeds




Dave Cantrell wrote,

> Question: in your database, how would you store RSS data? That would be a
> new task to me, and I'd like to know what the "accepted best practice" is.
> Sounds like you are storing individual items as unique records tied to title
> and url as primary keys? Assuming you have a separate table (also keyed off
> title and url) that holds the "meta" information on the feed, such as
> author, date, etc? And why not just key off the url, since it has to be
> unique?

Our approach is to store the items in a database (which is XML underneath, because it's groove, but that's not relevant);  effectively, one table for the channels, one table for items, one table for comments, one pseudo-table for enclosures.   We could store native RSS in the database but chose not to, mostly because a record-oriented structure - one record per item - is easier to bring up to the UI.

Each record's main key is a UNID, created by hashing the item's { channel-UNID, title, link, description }.  Unfortunately we needed to do this to be able to tell whether items have changed since you last fetched a feed.

Our channels table again has a UNID which is a hash of its data-feed-URL.  No good reason for this except that UNIDs are fixed length.


-Hugh

hpyle@agora.co.uk       | +44 (0)20 8783 3592
http://www.agora.co.uk/ | http://groovelog.agora.co.uk/  | http://rendezvoo.net/