<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thoughtbot="https://thoughtbot.com/feeds/" xmlns:feedpress="https://feed.press/xmlns" xmlns:media="http://search.yahoo.com/mrss/" xmlns:podcast="https://podcastindex.org/namespace/1.0">
  <feedpress:locale>en</feedpress:locale>
  <link rel="hub" href="https://feedpress.superfeedr.com/"/>
  <title>Giant Robots Smashing Into Other Giant Robots</title>
  <subtitle>Written by thoughtbot, your expert partner for design and development.
</subtitle>
  <id>https://robots.thoughtbot.com/</id>
  <link href="https://thoughtbot.com/blog"/>
  <link href="https://feed.thoughtbot.com/" rel="self"/>
  <updated>2026-03-31T00:00:00+00:00</updated>
  <author>
    <name>thoughtbot</name>
  </author>
  <entry>
    <title>Attending and speaking at Haggis Ruby</title>
    <link rel="alternate" href="https://feed.thoughtbot.com/link/24077/17309889/attending-and-speaking-at-haggis-ruby"/>
    <author>
      <name>Rob Whittaker</name>
    </author>
    <id>https://thoughtbot.com/blog/attending-and-speaking-at-haggis-ruby</id>
    <published>2026-03-31T00:00:00+00:00</published>
    <updated>2026-03-31T13:42:31Z</updated>
    <content type="html"><![CDATA[<p><a href="https://haggisruby.co.uk">Haggis Ruby</a> returns to Glasgow on April 23-24, and thoughtbot will be there.</p>

<p>Rob Whittaker and Mina Slater are attending, and Aji Slater is speaking. Their talk is about playfulness in exploration when tackling novel challenges. What is the challenge in this case? Using Ruby for procedural generation of an endless haunted house.</p>

<p>Haggis Ruby is one of the smaller Ruby conferences, and that’s part of what makes it good. The conversations are better when the room is smaller. If you’re in or around Glasgow in late April, it’s worth the trip.</p>

<p>We’re looking forward to it. If you’re going, find us.</p>

<aside class="related-articles"><h2>If you enjoyed this post, you might also like:</h2>
<ul>
<li><a href="https://thoughtbot.com/blog/heading-to-ruby-east">Heading to Ruby East</a></li>
<li><a href="https://thoughtbot.com/blog/upcoming-events">Upcoming events</a></li>
<li><a href="https://thoughtbot.com/blog/more-upcoming-events">More Upcoming Events</a></li>
</ul></aside>
<img src="https://feed.thoughtbot.com/link/24077/17309889.gif" height="1" width="1"/>]]></content>
    <summary>thoughtbot is heading to Haggis Ruby in Glasgow on April 23-24. Come find us.</summary>
    <thoughtbot:auto_social_share>true</thoughtbot:auto_social_share>
  </entry>
  <entry>
    <title>Enhancing job reliability with Sidekiq Pro's super fetch strategy</title>
    <link rel="alternate" href="https://feed.thoughtbot.com/link/24077/17309128/enhancing-job-reliability-with-sidekiq-pro-s-super-fetch-strategy"/>
    <author>
      <name>Valerie Burzynski</name>
    </author>
    <id>https://thoughtbot.com/blog/enhancing-job-reliability-with-sidekiq-pro-s-super-fetch-strategy</id>
    <published>2026-03-30T00:00:00+00:00</published>
    <updated>2026-03-27T16:43:08Z</updated>
    <content type="html"><![CDATA[<p>When working with Sidekiq, the framework makes a guarantee that a background job will execute at least once.<sup id="fnref1"><a href="https://thoughtbot.com/blog#fn1">1</a></sup> Under normal operation, the process runs smoothly and queues of jobs are processed without issue. It’s critical to realize, however, that there is a small chance for job loss when using the open-source version of Sidekiq. The guarantee that jobs execute at least once does not guarantee job reliability.</p>
<h2 id="jobs-that-exist-in-memory-may-be-lost">
  
    Jobs that exist in memory may be lost
  
</h2>

<p>To clarify, the open-source core of Sidekiq provides a basic job-fetching strategy  (<code>basic_fetch</code>) which aims to be simple and efficient. This algorithm is ideal in many scenarios as it avoids polling Redis with additional requests. It uses the Redis <a href="https://redis.io/docs/latest/commands/brpop/">BRPOP</a> command to fetch jobs in constant time (O(1) complexity) while also offering blocking — allowing the client to wait till a new job is pushed to the queue.</p>

<p>Despite this efficiency, the tradeoff is that there is a period of time where a job exists only in memory. That is, as a job is fetched for processing, it’s data is popped off the queue list and is no longer persisted in Redis. Sidekiq will then execute the job and handle errors. The danger for job loss occurs when the process terminates before the job completes or has it’s data written back to Redis.</p>
<h2 id="sidekiq-recovers-jobs-most-of-the-time">
  
    Sidekiq recovers jobs most of the time
  
</h2>

<p>Fortunately, Sidekiq recovers jobs 99% of the time<sup id="fnref2"><a href="https://thoughtbot.com/blog#fn2">2</a></sup> as it attempts a graceful shutdown procedure under normal shutdown conditions (such as when it handles termination signals like <code>SIGINT</code> or <code>SIGTERM</code>).  During this graceful shutdown, the fetching of new jobs stops; running jobs are give a time limit to complete; and any running jobs that remain at the time limit are written back to Redis.</p>

<p>Job loss occurs when Sidekiq is unable to shutdown properly. Should the process crash or receive a <code>KILL</code> signal, Sidekiq is then unable to complete the steps necessary to write data back to Redis. As a result, the data for all running jobs is lost.</p>
<h2 id="the-superfetch-strategy-prevents-job-loss">
  
    The SuperFetch strategy prevents job loss
  
</h2>

<p>To solve this, Sidekiq Pro provides a <code>super_fetch</code> strategy<sup id="fnref3"><a href="https://thoughtbot.com/blog#fn3">3</a></sup> to increase job reliability.<sup id="fnref4"><a href="https://thoughtbot.com/blog#fn4">4</a></sup> Once you have a license and Sidekiq Pro installed, the configuration to switch from <code>basic_fetch</code> to <code>super_fetch</code> is easy:</p>
<div class="highlight"><pre class="highlight ruby"><code><span class="no">Sidekiq</span><span class="o">::</span><span class="no">Client</span><span class="p">.</span><span class="nf">reliable_push!</span> <span class="k">unless</span> <span class="no">Rails</span><span class="p">.</span><span class="nf">env</span><span class="p">.</span><span class="nf">test?</span>

<span class="no">Sidekiq</span><span class="p">.</span><span class="nf">configure_server</span> <span class="k">do</span> <span class="o">|</span><span class="n">config</span><span class="o">|</span>
  <span class="n">config</span><span class="p">.</span><span class="nf">super_fetch!</span>
  <span class="n">config</span><span class="p">.</span><span class="nf">reliable_scheduler!</span>
<span class="k">end</span>
</code></pre></div>
<p>The <code>super_fetch</code> strategy utilizes the Redis <a href="https://redis.io/docs/latest/commands/lmove/">LMOVE</a> command to maintain a list of running jobs in Redis and ensures jobs are never removed from Redis until their completion is acknowledged. While this command still runs in constant time, it requires Sidekiq to use request polling to check for jobs in queues. So while this increases job resiliency, it comes at a cost of increased network traffic and CPU usage. Yet, when job loss threatens significant impact and harm to the end-user experience, the tradeoff pays off.</p>

<aside class="related-articles"><h2>If you enjoyed this post, you might also like:</h2>
<ul>
<li><a href="https://thoughtbot.com/blog/tuning-the-toad">Tuning the Toad</a></li>
<li><a href="https://thoughtbot.com/blog/yuletide-logs-and-mongodb-capped-collections">Yuletide Logs and MongoDB Capped Collections</a></li>
<li><a href="https://thoughtbot.com/blog/copycopters-client-so-fast">Copycopter’s client: so fast</a></li>
</ul></aside>

<div class="footnotes">
<hr>
<ol>

<li id="fn1">
<p>Sidekiq makes a guarantee that jobs will run at least once, not exactly-once: <a href="https://github.com/sidekiq/sidekiq/wiki/Best-Practices#2-make-your-job-idempotent-and-transactional">https://github.com/sidekiq/sidekiq/wiki/Best-Practices#2-make-your-job-idempotent-and-transactional</a> <a href="https://thoughtbot.com/blog#fnref1">↩</a></p>
</li>

<li id="fn2">
<p>The Sidekiq Wiki makes note that graceful shutdowns are effective at recovering unfinished jobs 99% of the time: <a href="https://github.com/sidekiq/sidekiq/wiki/Pro-Reliability-Server">https://github.com/sidekiq/sidekiq/wiki/Pro-Reliability-Server</a> <a href="https://thoughtbot.com/blog#fnref2">↩</a></p>
</li>

<li id="fn3">
<p>The <code>super_fetch</code> strategy attempts to solve the existing drawbacks of the <code>basic_fetch</code> strategy: <a href="https://github.com/sidekiq/sidekiq/wiki/Pro-Reliability-Server#super_fetch">https://github.com/sidekiq/sidekiq/wiki/Pro-Reliability-Server#super_fetch</a> <a href="https://thoughtbot.com/blog#fnref3">↩</a></p>
</li>

<li id="fn4">
<p>The Sidekiq Wiki discusses considerations and details regarding job reliability: <a href="https://github.com/sidekiq/sidekiq/wiki/Reliability">https://github.com/sidekiq/sidekiq/wiki/Reliability</a> <a href="https://thoughtbot.com/blog#fnref4">↩</a></p>
</li>

</ol>
</div>
<img src="https://feed.thoughtbot.com/link/24077/17309128.gif" height="1" width="1"/>]]></content>
    <summary>Explores how the core Sidekiq fetch behavior has the potential to lead to loss of job data and how the super fetch strategy provided by Sidekiq Pro can resolve this.</summary>
    <thoughtbot:auto_social_share>true</thoughtbot:auto_social_share>
  </entry>
</feed>
