agentleFS
blushneybusiness-glitchblushneybusiness-glitch/roblox-omniskills/skills/rbx-data-crossserver/SKILL.md

rbx-data-crossserver

Skill0 starsChanged 3 months agoMITView on GitHub

Cross-server state that survives contact with real traffic — MessagingService within its 1 KB / per-minute limits, MemoryStore for shared short-lived state, OrderedDataStore for global leaderboards, UpdateAsync counters for everything permanent. Use when the user says "global announcement", "cross-server event", "server list", "matchmaking queue", "global leaderboard", or when a leaderboard shows stale or missing entries at scale. Do not use for per-player saves — load rbx-data-profilestore instead — or for moving players between servers — load rbx-platform-teleport.

The file

Files
SKILL.md

rbx-data-crossserver

When to load

Anything one server must tell, share with, or rank against other servers: live events, shout systems, server browsers, matchmaking, global leaderboards, world/guild state.

Pick the channel by lifetime

DataChannel
Right now, ephemeral ("2× event started", shouts)MessagingService
Minutes–days, shared, mutable (queues, event scores, server registry)MemoryStore
Permanent ranking by one integerOrderedDataStore
Permanent shared record (guilds, global counters, season config)GlobalDataStore + UpdateAsync

Mixing these up is the root of most cross-server bugs: MessagingService is not storage, MemoryStore is not permanent, DataStore is not real-time.

MessagingService

Fire-and-forget pub/sub: no delivery guarantee, no ordering, no persistence — a server that is down or over quota simply never hears the message. Design every consumer as "poke, then read the truth from a store".

  • Limits: 1 KB per message (after JSON encoding); sends per server 150 + 60 × players per minute; subscriptions per server 5 + 2 × players; receives per topic 10 + 20 × players per second. Topic names ≤ 80 characters.
  • pcall both PublishAsync and SubscribeAsync; the subscribe callback runs on its own thread and an error there kills the subscription silently.
  • Multiplex: one topic per system, a type field inside the payload — not one topic per event kind, or the subscription budget dies first.
  • message.Sent is the send timestamp: drop anything older than your tolerance (10 s is sane for event starts) instead of acting on late replays.

MemoryStore

Shared mutable state with automatic expiry: SortedMap (registries, live-event scores), Queue (matchmaking), HashMap (flat key-value). Item ≤ 32 KB, key ≤ 128 characters, TTL mandatory and capped at 3,888,000 s (45 days). The experience-wide request quota is 1000 + 100 × concurrent users per minute — generous, but a per-Heartbeat poll from every server still eats it; poll shared keys every 5–10 s, not per frame. Everything in it evaporates at TTL: treat it as a cache over DataStore truth, never the only copy of anything a player paid for.

OrderedDataStore leaderboards

Integer values only (decimals: store score × 100); keys are strings — tostring(UserId).

  • Writers: each server writes only its own players' scores (SetAsync, one writer per key, on a 60–120 s loop and on PlayerRemoving). No cross-server write contention by construction.
  • Reader: ONE GetSortedAsync(false, 100) per server per refresh interval (120 s), result broadcast to clients via one RemoteEvent. The budget is 5 + 2 × players per minute — a per-player or per-request fetch pattern exhausts it immediately.
  • Page through GetCurrentPage / IsFinished / AdvanceToNextPageAsync; GetNameFromUserIdAsync inside pcall per row (it fails for deleted accounts — skip the row, don't kill the board).
  • All-time + weekly boards: suffix the store name with the period (Coins_AllTime, Coins_2026w34) so resets are a name change, not a mass delete.

Sharp edges

  • CRITICAL — Granting anything of value via MessagingService alone ("gift arrived" message mutates currency): missed message = vanished grant, replayed handler = dupe. Fix: persist the grant in a DataStore/pending queue first; the message is only a "check the store now" poke, and the handler is idempotent.
  • HIGH — SetAsync on shared global state (guild rosters, counters): two servers read-modify-write and one update evaporates. Fix: UpdateAsync transform, always.
  • HIGH — Leaderboard fetch per player or per UI open: GetSortedAsync budget of 5 + 2 × players/min collapses and the board goes blank at peak CCU — the classic "works at 3 players, dead at 300". Fix: one server-level fetch on a timer, replicate the table.
  • MEDIUM — MemoryStore as the only home of event progress: TTL hits mid-event and scores reset. Fix: checkpoint to DataStore every 60 s; MemoryStore holds the live view.
  • MEDIUM — Trusting MessagingService for time-critical sync (round starts): latency is variable seconds. Fix: publish a shared timestamp, each server counts down locally.

Load with

rbx-data-profilestore (the permanent truth the channels poke at), rbx-liveops-events (event systems built on these rails), rbx-platform-teleport (follow-friend and server-browser joins), rbx-data-schema (shapes for guild/world records).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.