I believe this is a huge optimization for a heavily implemented
Web 2.0 idea.
This article makes simple work of groups of queues. An example of
this would be “the most recent 10 people to view an article,” so
each article has a queue of up to 10 items in it. This method
eliminates the need for multiple SQL statements or using TRIGGERS
to check to see if the queue is full.
I bow down to Baron Schwartz, aka Xarpb, for his article on how
to implement a queue in SQL:
http://www.xaprb.com/blog/2007/01/11/how-to-implement-a-queue-in-sql/
I am very excited because this also works for groups of objects,
and we’re about to implement something at work that needs this
idea. The idea of “the most recent x things” or “the top x
things” is huge, especially in social networking, and probably
one of the most often …
[Read more]