Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why didn't anybody tell me about Redis hash slots?

The story follows a developer from a gig economy delivery app who needed to optimize the process of assigning work to couriers. The developer discovered that Redis hash slots were the key to improving performance and reducing latency. Redis clusters have 16,384 hash slots that evenly distribute keys and their values among cluster nodes.

The writer learned that keys are assigned to slots based on the CRC16(key) mod 16384 algorithm. In their system, keys had unique hex IDs, causing them to land in different slots and preventing batching. To resolve this, the developer introduced hash tags, which allowed keys to be forced into specific slots. By grouping keys by their destination and organizing them by slot, the writer was able to reduce the number of multi-key commands and improve overall performance.

Finally, the story highlights how Redis hash slots can be used to optimize key distribution and improve the efficiency of multi-key commands in a Redis cluster.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at blog.verygoodsoftwarenotvirus.dev →

More in Tech

If the Round Trip Was Instant, You Cheated

Your agent did not pass. It never waited for anything. Local tool calls hide timeouts, retries, and partial payloads. An instant round trip is not evidence. It is a missing network.

The Best Framework Gives You Your Time Back

Frameworks are supposed to save time. That's an obvious statement. But I think there's a deeper version of it. A good framework doesn't just help you write today's application faster.

  • KiwiEngine framework saves time by abstracting common components like configuration and routing.
  • Developer observes repetitive foundational elements across multiple projects.
  • KiwiEngine enables efficient time investment in unique project aspects.

More from Wednesday 23 September →