August 07, 2006

Feeds: RSS vs. ATOM

FeedsI've been playing with feeding technologies for a while now, and in the meantime reading or earing the rants of others, I've came to the field experience that made me feel that ATOM was better than RSS for a number of reasons. So, I decided to explore the issue more, to be sure of why would I choose ATOM instead of RSS.

The best yet simple comparison I found between both technologies was this one, from which I'll take a comparison table:

RSS 2.0 Atom 1.0 Comments
rss - Vestigial in RSS
channel feed
title title
link link Atom defines an extensible family of rel values
description subtitle
language - Atom uses standard xml:lang attribute
copyright rights
webMaster -
managingEditor author or contributor
pubDate published (in entry) Atom has no feed-level equivalent
lastBuildDate (in channel) updated RSS has no item-level equivalent
category category
generator generator
docs -
cloud -
ttl - is problematic, prefer HTTP 1.1 cache control
image logo Atom recommends 2:1 aspect ratio
- icon As in favicon.ico
rating -
textInput -
skipHours -
skipDays -
item entry
author author
- contributor
description summary and/or content depending on whether full content is provided
comments -
enclosure - rel="enclosure" on <link> in Atom
guid id
source - rel="via" on <link> in Atom
- source Container for feed-level metadata to support aggregation



Please let me give some emphasis on RSS's lastBuildDate against ATOM's updated.
While RSS has a feed-level "last updated date", ATOM has an item-level "last updated date". What does this means? It simply means that while in RSS you can't update an item, in ATOM you can. And notice: when I'm saying you can't I really mean it: it is cahotic to try to predict how you'll circunvent this (or your feed generator) and each feed reader has to do it, so does it on it's own way (which is bad - protocols are made so such things don't happen). Let's think, for instance, in the sweet simple case of a blog and it's posts. Whenever you post something on your blog, a new feed item is created, with a date. Now, one minute after you update it. In Atom, you'll get the same item, updated in it's body and with a new updated time. Easy. Now, on RSS you don't have a way of updating a feed. You can act like it was an Atom feed (I guess that that's what most feed generators are doing nowadays) and just change the pubDate of that item, thus creating another, but simmilar item. Now, if my feed reader knows that the reader will be used to get blog feeds, it can somewhat expect that behaviour, thus only looking to the items on the feed at the moment. That will solve our little update problem, but will limit historical faculties of the reader. Now, if the reader just reads RSS as it is, it sees another item, and so each time you update a post you're creating another item and spamming your readers.

So, in conclusion, specially if you're using feeds to a blog or something simillar in structure, then ATOM should be your choice, not RSS.

3 comments:

  1. Anonymous4:36 PM

    E tabelas?

    Ve como fica a tua noticia nas noticias do DEINIX....

    Atomic

    ReplyDelete
  2. Já vi e já me queixei...

    Mas aí o problema não é do RSS nem do ATOM, é mesmo daquele cliente estar a fazer strip down do html dentro dos items... :-(

    ReplyDelete
  3. Anonymous12:38 PM

    Thanks Noori for making the effort to do this. I have linked to it from my blog article covering RSS.

    ReplyDelete