Menu

1 / 3

How I built a fair waiting room with OpenResty and one Valkey script

DEV Community: redis·Jikwang Moon·6 days ago
#fnPewhMo
#devtoredis#devto#dev#head#redis
Reading 0:00
15s threshold

A waiting room (or "virtual queue") is what you see when a ticket sale opens: "You are number 1,342 in line." Behind it is a simple promise: let in only as many people as the site can handle, and let the rest in, in the order they arrived.

I built one into Corvus , a self-hosted gateway on OpenResty. This post walks through how it works, the parts that were harder than they looked, and the trade-offs I made.

What "working" means

Before writing code I wrote down what the queue must guarantee:

Capacity : never more than N visitors inside at once.

Order : first come, first served.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.