<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: queues</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/queues.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2024-02-05T17:20:53+00:00</updated><author><name>Simon Willison</name></author><entry><title>How does Sidekiq really work?</title><link href="https://simonwillison.net/2024/Feb/5/how-does-sidekiq-really-work/#atom-tag" rel="alternate"/><published>2024-02-05T17:20:53+00:00</published><updated>2024-02-05T17:20:53+00:00</updated><id>https://simonwillison.net/2024/Feb/5/how-does-sidekiq-really-work/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://dansvetlov.me/sidekiq-internals/"&gt;How does Sidekiq really work?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
I really like this category of blog post: Dan Svetlov took the time to explore the Sidekiq message queue’s implementation and then wrote it up in depth.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=39257174"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ruby"&gt;ruby&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sidekiq"&gt;sidekiq&lt;/a&gt;&lt;/p&gt;



</summary><category term="queues"/><category term="ruby"/><category term="sidekiq"/></entry><entry><title>Transactionally Staged Job Drains in Postgres</title><link href="https://simonwillison.net/2021/Dec/18/transactionally-staged-job-drains/#atom-tag" rel="alternate"/><published>2021-12-18T01:34:13+00:00</published><updated>2021-12-18T01:34:13+00:00</updated><id>https://simonwillison.net/2021/Dec/18/transactionally-staged-job-drains/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://brandur.org/job-drain"&gt;Transactionally Staged Job Drains in Postgres&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Any time I see people argue that relational databases shouldn’t be used to implement job queues I think of this post by Brandur from 2017. If you write to a queue before committing a transaction you run the risk of a queue consumer trying to read from the database before the new row becomes visible. If you write to the queue after the transaction there’s a risk an error might result in your message never being written. So: write to a relational staging table as part of the transaction, then have a separate process read from that table and write to the queue.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/postgresql"&gt;postgresql&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/scaling"&gt;scaling&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/brandur-leach"&gt;brandur-leach&lt;/a&gt;&lt;/p&gt;



</summary><category term="postgresql"/><category term="queues"/><category term="scaling"/><category term="brandur-leach"/></entry><entry><title>huey</title><link href="https://simonwillison.net/2019/Feb/25/huey/#atom-tag" rel="alternate"/><published>2019-02-25T19:49:06+00:00</published><updated>2019-02-25T19:49:06+00:00</updated><id>https://simonwillison.net/2019/Feb/25/huey/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/coleifer/huey"&gt;huey&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Charles Leifer’s “little task queue for Python”. Similar to Celery, but it’s designed to work with Redis, SQLite or in the parent process using background greenlets. Worth checking out for the really neat design. The project is new to me, but it’s been under active development since 2011 and has a very healthy looking rate of releases.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/redis"&gt;redis&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sqlite"&gt;sqlite&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/charles-leifer"&gt;charles-leifer&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="queues"/><category term="redis"/><category term="sqlite"/><category term="charles-leifer"/></entry><entry><title>Introducing Faktory</title><link href="https://simonwillison.net/2017/Oct/25/introducing-faktory/#atom-tag" rel="alternate"/><published>2017-10-25T03:09:39+00:00</published><updated>2017-10-25T03:09:39+00:00</updated><id>https://simonwillison.net/2017/Oct/25/introducing-faktory/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.mikeperham.com/2017/10/24/introducing-faktory/"&gt;Introducing Faktory&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A brand new worker queue system from Mike Perham, the author of Sidekiq for Ruby. It’s written in Go on top of RocksDB and is explicitly designed to support clients and workers in multiple different languages.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/go"&gt;go&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sidekiq"&gt;sidekiq&lt;/a&gt;&lt;/p&gt;



</summary><category term="go"/><category term="queues"/><category term="sidekiq"/></entry><entry><title>HotQueue</title><link href="https://simonwillison.net/2010/Dec/22/hotqueue/#atom-tag" rel="alternate"/><published>2010-12-22T11:51:00+00:00</published><updated>2010-12-22T11:51:00+00:00</updated><id>https://simonwillison.net/2010/Dec/22/hotqueue/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://richardhenry.github.com/hotqueue/"&gt;HotQueue&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A super-simple Python work queue using Redis. The API is neat, and makes clever use of generators for blocking consumption of queue items.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/redis"&gt;redis&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/recovered"&gt;recovered&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hotqueue"&gt;hotqueue&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="queues"/><category term="redis"/><category term="recovered"/><category term="hotqueue"/></entry><entry><title>Introducing docent</title><link href="https://simonwillison.net/2010/Jan/28/huskorg/#atom-tag" rel="alternate"/><published>2010-01-28T20:35:22+00:00</published><updated>2010-01-28T20:35:22+00:00</updated><id>https://simonwillison.net/2010/Jan/28/huskorg/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://husk.org/blog/arch/introducing-docent.html"&gt;Introducing docent&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Paul Mison’s clever little Flickr app for viewing galleries that have been added by your contacts. It runs in Python on App Engine and makes extensive use of the Task Queue API.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/docent"&gt;docent&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/flickr"&gt;flickr&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/google-app-engine"&gt;google-app-engine&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/paul-mison"&gt;paul-mison&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/taskqueue"&gt;taskqueue&lt;/a&gt;&lt;/p&gt;



</summary><category term="docent"/><category term="flickr"/><category term="google-app-engine"/><category term="paul-mison"/><category term="python"/><category term="queues"/><category term="taskqueue"/></entry><entry><title>BLPOP and BRPOP in Redis</title><link href="https://simonwillison.net/2010/Jan/7/blocking/#atom-tag" rel="alternate"/><published>2010-01-07T22:50:22+00:00</published><updated>2010-01-07T22:50:22+00:00</updated><id>https://simonwillison.net/2010/Jan/7/blocking/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://code.google.com/p/redis/wiki/BlpopCommand"&gt;BLPOP and BRPOP in Redis&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Added over Christmas—Redis now has blocking list pop operations. This means you can use Redis to drive a queue server without the need for polling—simply BLPOP against a key and, if it’s empty, your client will block until another client pushes an item on to the list. Multiple clients can block against the same key and only the first client will return when an item becomes available.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/blocking"&gt;blocking&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/redis"&gt;redis&lt;/a&gt;&lt;/p&gt;



</summary><category term="blocking"/><category term="queues"/><category term="redis"/></entry><entry><title>Announcing Alice and Wonderland</title><link href="https://simonwillison.net/2009/Jul/17/rabbits/#atom-tag" rel="alternate"/><published>2009-07-17T09:12:45+00:00</published><updated>2009-07-17T09:12:45+00:00</updated><id>https://simonwillison.net/2009/Jul/17/rabbits/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://willcodeforfoo.com/2009/07/13/announcing-alice/"&gt;Announcing Alice and Wonderland&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Continuing the RabbitMQ “stuff to do with rabbits” naming convention, Alice is a RESTful interface to RabbitMQ which exposes information about vhosts/queues/users/exchanges/etc as JSON. Wonderland is a web UI for RabbitMQ implemented as a pure Ajax application which calls Alice.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ajax"&gt;ajax&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/alice"&gt;alice&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/aliceinwonderland"&gt;aliceinwonderland&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/json"&gt;json&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/message-queues"&gt;message-queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rabbitmq"&gt;rabbitmq&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rest"&gt;rest&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/wonderland"&gt;wonderland&lt;/a&gt;&lt;/p&gt;



</summary><category term="ajax"/><category term="alice"/><category term="aliceinwonderland"/><category term="javascript"/><category term="json"/><category term="message-queues"/><category term="queues"/><category term="rabbitmq"/><category term="rest"/><category term="wonderland"/></entry><entry><title>Rabbits and warrens</title><link href="https://simonwillison.net/2009/Apr/7/rabbits/#atom-tag" rel="alternate"/><published>2009-04-07T09:13:39+00:00</published><updated>2009-04-07T09:13:39+00:00</updated><id>https://simonwillison.net/2009/Apr/7/rabbits/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/"&gt;Rabbits and warrens&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Handy tutorial introduction to using RabbitMQ and AMQP with Python.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/amqp"&gt;amqp&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/message-queues"&gt;message-queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rabbitmq"&gt;rabbitmq&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/tutorial"&gt;tutorial&lt;/a&gt;&lt;/p&gt;



</summary><category term="amqp"/><category term="message-queues"/><category term="python"/><category term="queues"/><category term="rabbitmq"/><category term="tutorial"/></entry><entry><title>New Gearman Server &amp; Library in C, MySQL UDFs</title><link href="https://simonwillison.net/2009/Jan/13/gearman/#atom-tag" rel="alternate"/><published>2009-01-13T16:41:57+00:00</published><updated>2009-01-13T16:41:57+00:00</updated><id>https://simonwillison.net/2009/Jan/13/gearman/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.oddments.org/?p=30"&gt;New Gearman Server &amp;amp; Library in C, MySQL UDFs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Gearman, the job queue written for LiveJournal and now used by Digg and Yahoo!, has been rewritten in C. Looks like a good candidate for an easily configured lightweight message queue. Also includes hooks for writing MySQL functions that can interact with queues.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/c"&gt;c&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/digg"&gt;digg&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/eric-day"&gt;eric-day&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gearman"&gt;gearman&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/livejournal"&gt;livejournal&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/message-queues"&gt;message-queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mysql"&gt;mysql&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/scaling"&gt;scaling&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/yahoo"&gt;yahoo&lt;/a&gt;&lt;/p&gt;



</summary><category term="c"/><category term="digg"/><category term="eric-day"/><category term="gearman"/><category term="livejournal"/><category term="message-queues"/><category term="mysql"/><category term="queues"/><category term="scaling"/><category term="yahoo"/></entry><entry><title>Flickr Engineers Do It Offline</title><link href="https://simonwillison.net/2008/Sep/28/queues/#atom-tag" rel="alternate"/><published>2008-09-28T01:24:57+00:00</published><updated>2008-09-28T01:24:57+00:00</updated><id>https://simonwillison.net/2008/Sep/28/queues/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://code.flickr.com/blog/2008/09/26/flickr-engineers-do-it-offline/"&gt;Flickr Engineers Do It Offline&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Flickr wrote their own queuing mechanism (in PHP), and currently run ten queue servers on dedicated hardware for tasks like pushing new photos in to indexes, denormalisation and “backfills” which move data between clusters and run bulk scripts against large numbers of existing rows.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/backfills"&gt;backfills&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/denormalisation"&gt;denormalisation&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/flickr"&gt;flickr&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/message-queues"&gt;message-queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;&lt;/p&gt;



</summary><category term="backfills"/><category term="denormalisation"/><category term="flickr"/><category term="message-queues"/><category term="queues"/></entry><entry><title>Queue everything and delight everyone</title><link href="https://simonwillison.net/2008/Jul/4/queue/#atom-tag" rel="alternate"/><published>2008-07-04T22:38:01+00:00</published><updated>2008-07-04T22:38:01+00:00</updated><id>https://simonwillison.net/2008/Jul/4/queue/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://decafbad.com/blog/2008/07/04/queue-everything-and-delight-everyone"&gt;Queue everything and delight everyone&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Les Orchard explains why I’ve been getting interested in queues recently: “One of the problems it seems most modern web apps face is the tendency to want to do everything all at once, and all in the same code that responds directly to a user.”


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/les-orchard"&gt;les-orchard&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;&lt;/p&gt;



</summary><category term="les-orchard"/><category term="queues"/></entry><entry><title>Standing in Line</title><link href="https://simonwillison.net/2008/Mar/19/standing/#atom-tag" rel="alternate"/><published>2008-03-19T09:41:11+00:00</published><updated>2008-03-19T09:41:11+00:00</updated><id>https://simonwillison.net/2008/Mar/19/standing/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://deflatermouse.livejournal.com/145533.html"&gt;Standing in Line&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Simon Wistow coins “CLAMP” for LAMP + Cache, and expresses the need for a dirt-simple, high performance open source queue system.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/clamp"&gt;clamp&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/lamp"&gt;lamp&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/queues"&gt;queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/simon-wistow"&gt;simon-wistow&lt;/a&gt;&lt;/p&gt;



</summary><category term="clamp"/><category term="lamp"/><category term="open-source"/><category term="queues"/><category term="simon-wistow"/></entry></feed>