---
title: "Discussion on \"When Our Database Got Too Fast\" | Hashnode"
description: "Discussion on \"When Our Database Got Too Fast\". My favorite production bug ever was the day our database got too fast.\nI was Chief Technology Officer (CTO) at MonitorBase, a borrower retention platform for mortgage lenders. We helped about 10,000 c"
url: "https://hashnode.com/posts/when-our-database-got-too-fast/6aeaf0b0e6fe2f6082ca27d6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [When Our Database Got Too Fast](https://www.guywarner.dev/when-our-database-got-too-fast?utm_source=hashnode&utm_medium=feed)

My favorite production bug ever was the day our database got too fast. I was Chief Technology Officer (CTO) at MonitorBase, a borrower retention platform for mortgage lenders. We helped about 10,000 c

Nov 4 · 3 min read · guywarner.dev  
Updated 4d ago  
Read the article

## Written by

[Guy Warner](https://hashnode.com/@GuyWarner)

@GuyWarner · Salt Lake City, Utah

  
[View profile](https://hashnode.com/@GuyWarner)

20+ years building PHP/MySQL/AWS SaaS and Laravel in production. Former CTO at Monitorbase. Founder of Eco Moving Utah and Bin X.

Guy Warner is a Salt Lake City software engineer with 20+ years building PHP/MySQL/AWS SaaS products, with 10+ years of Laravel in production. He was Chief Technology Officer (CTO) and VP of Development at Monitorbase in credit monitoring, handling 7M+ monthly queries, where he led 12+ developers and migrated to SingleStore. He founded Eco Moving Utah, a moving tote rental business, and builds Bin X, rental business software. He has a B.S. in Political Science, University of Utah.

## Responses 2

Markdown supported · ⌘↵ to post

[Jam Yanh](https://hashnode.com/@danagua)

[Nov 4](https://hashnode.com/posts/when-our-database-got-too-fast/6aeaf0b0e6fe2f6082ca27d6/comment/6aeb369296b01eba2b0103f0)

The queue bug is the part I'd love more detail on. What changed in the job-claiming step to stop two workers from reserving the same job? A small before-and-after example would be useful.

[Guy Warner](https://hashnode.com/@GuyWarner)

[Nov 5](https://hashnode.com/posts/when-our-database-got-too-fast/6aeaf0b0e6fe2f6082ca27d6/comment/6aeb369296b01eba2b0103f0#reply-6aecf572b8b7cb134974590d)

Good question. Short version: atomic locks.

Before: we ran the stock database queue driver with the jobs table in a SingleStore rowstore table. Workers hit table locks, and nodes would lock different rows while only one got returned, so two workers could end up reserving the same job. We first tried loading jobs in random order inside a five minute window. It worked okay, not great.

After: we pulled the queue driver into our own class. When a worker finds the next available job, it takes a Laravel atomic cache lock keyed to that job, queue:worker-{job id} for ten minutes, and only gets the job if the lock succeeds. If another worker already holds it, the job is skipped. The lock releases when the job is deleted or released back.

Full code is in an older post of mine: [guywarner.dev/laravel-queues-simplifying-queue-ma…](https://www.guywarner.dev/laravel-queues-simplifying-queue-management-with-singlestore)
