Lasse Foo-Rafn Profile picture
Husband - 📦 https://t.co/ClQkJiVg4c - 🦦 https://t.co/cHjVYMxP8W - 👤 https://t.co/tXVlVZNnCs - 🌍 https://t.co/Q6o8v8u9u3
Oct 25, 2023 6 tweets 2 min read
Some time ago I did a bunch of simulations for queue worker w/ multi-tenants; some who sends more requests than others.

We use Laravel Horizon for our queues: Default logic.

Each square corresponds to a job. The above, normal logic, can be easily abused, lets see what happens if Tenant 1 (blue) goes real crazy.

Red and Green (2, 3) has to wait forever for their jobs to be processed. 👎🏻
Nov 26, 2021 7 tweets 3 min read
🧵 Today I decided to tackle a performance issue in our #MySQL Database.

We use timestamp columns for storing states (is paid, is invoiced, is shipped etc.) and clients would like to be able to filter by these states (see screenshot)

Thread below👇🏻 Despite having indexes on all 4 of our timestamp columns, this query can become incredibly slow as data grows. Screenshot from first tweet is an example on 1 million records.

In order to optimize this, we can add a indexed boolean state column that concats all the timestamps.