Originally published on seoulsmith.com .
One Haystack is a Roblox game with a single premise: every server digs the same pile of hay, and there is exactly one needle in it. When someone finds it, the season ends everywhere and a new pile starts.
That premise turns a simple digging game into a small distributed-systems problem. Roblox servers do not share memory. A server holds up to 20 players, lives for as long as people are in it, and can vanish without warning. This post is about how those servers agree on how much of the pile is left, without melting a shared key and without counting the same hay twice.
I'll leave out one part on purpose: how the needle's location is stored and decided. That is the one thing in the design that players would benefit from knowing.
Problem
Roblox gives you two cross-server stores. DataStore is durable and slow-ish. MemoryStore is fast, expires, and has a request budget.β¦