
roblox-data-stores
Persistence and cross-server data - DataStoreService (UpdateAsync, retries, budgets, limits), session locking with ProfileStore, schema migrations, OrderedDataStore leaderboards, MemoryStore queues/sorted maps/hash maps, MessagingService, right-to-be-forgotten. Use when saving player data, building leaderboards or queues, or fixing data loss, duplication, or throttling.
- Installs
- 456
- Last 24h
- +23
- Trending rank
- #5212
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/el4cteo/roblox-skills --skill roblox-data-stores- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads roblox-data-stores automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Roblox data stores and cloud services
Choose the service
| Need | Service | Notes |
|---|---|---|
| Player progress, inventory, settings | DataStore via ProfileStore (session-locked) | One key per player (User_{UserId}), ≤ 4 MB. |
| Global leaderboards | OrderedDataStore | Integer values only; periodic updates, cached reads. |
| Fast, temporary, cross-server state | MemoryStoreService | Sorted maps, queues, hash maps; everything expires (TTL ≤ 45 days). |
| Matchmaking queues, live events, server lists | MemoryStore queue / sorted map | Not durable — never the only copy of valuable data. |
| Broadcast to all servers | MessagingService | ≤ 1 kB per message, best effort, no delivery guarantee. |
| Values changed by live-ops without publishing | Experience configs (ConfigService) | See roblox-analytics-liveops. |
Player data: use session locking
Two servers must never own the same player's data at once (teleports, fast rejoins), or items duplicate
and progress is lost. ProfileStore (loleris) implements session locking, auto-save, and
BindToClose flushing, and is the recommended default. Install it from Wally/the Creator Store and put
it in ServerScriptService.
-- ServerScriptService/Server/Services/DataService.luau (ProfileStore)
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local ProfileStore = require(ServerScriptService.ServerPackages.ProfileStore)
local TEMPLATE = {
version = 1,
coins = 0,
inventory = {} :: { [string]: number },
}
type PlayerData = typeof(TEMPLATE)
local PlayerStore = ProfileStore.New("PlayerData", TEMPLATE)
local profiles: { [Player]: typeof(PlayerStore:StartSessionAsync("")) } = {}
local function onPlayerAdded(player: Player)
local profile = PlayerStore:StartSessionAsync(`User_{player.UserId}`, {
Cancel = function()
return player.Parent ~= Players -- stop waiting if the player left
end,
})
if profile == nil then
player:Kick("Could not load your data. Please rejoin.")
return
end
profile:AddUserId(player.UserId) -- GDPR / right-to-be-forgotten linkage
profile:Reconcile() -- fill in fields added to TEMPLATE since this profile was created
profile.OnSessionEnd:Connect(function()
profiles[player] = nil
player:Kick("Your data was loaded on another server. Please rejoin.")
end)
if player.Parent == Players then
profiles[player] = profile
else
profile:EndSession() -- left while loading
end
end
for _, player in Players:GetPlayers() do
task.spawn(onPlayerAdded, player)
end
Players.PlayerAdded:Connect(onPlayerAdded)
Players.PlayerRemoving:Connect(function(player)
local profile = profiles[player]
if profile then
profile:EndSession() -- saves and releases the lock
end
end)
local DataService = {}
function DataService.get(player: Player): PlayerData?
local profile = profiles[player]
return profile and profile.Data
end
return DataService
Mutate profile.Data directly on the server (it is cached in memory and auto-saved). Don't
SetAsync per change. Check the ProfileStore docs for the exact current API before relying on less
common features (global updates, MessageAsync, mock stores for Studio).
Raw DataStoreService rules (when not using a wrapper)
- Buffer in memory: load once on join, mutate the in-memory table, save periodically (e.g. every
2–5 minutes with random jitter), on leave, at checkpoints (purchases), and in
game:BindToClose. UpdateAsyncoverSetAsyncwhenever the write depends on the old value or multiple servers may write the key. The transform function must be pure and fast (no yields); returnnilto cancel.- Retry transient errors with exponential backoff + jitter, capped attempts; process retries for a key in order (an old retry must not overwrite newer data). Treat a failed write as "outcome unknown".
- Never save
Instances,Vector3,CFrame, functions, or mixed/sparse tables: store plain tables, numbers, strings, booleans, andbuffers. Serialize datatypes ({ x, y, z }). Validate UTF-8 strings. - Keys and data store names ≤ 50 characters; value ≤ 4,194,304 characters after JSON encoding.
- Stable key patterns (
User_{UserId}), never display names. Few data stores, few keys per player. - Studio needs File → Experience Settings → Security → Enable Studio Access to API Services; use a separate test universe or a different data store name so testing never touches production data.
Complete raw implementation (session lock, autosave, BindToClose, retries): references/raw-datastore.md.
Budgets and limits (2026)
| Limit | Value |
|---|---|
| Experience-wide standard reads / writes | 300 + 40 × CCU / 300 + 20 × CCU per minute (shared with Open Cloud) |
| Default per-server reads/writes | 60 + 40 × players per minute each (configurable) |
| Ordered writes per server | 30 + 5 × players per minute |
| Per-key throughput | 25 MB/min read, 4 MB/min write |
| Storage (latest versions, compressed) | 500 MB + 1 MB × lifetime users per experience |
| Queue per request type | 30 pending requests, then errors 301–306 |
UpdateAsyncconsumes both read and write budget.- Check
DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.StandardWrite)before bulk work; tune per-server limits once at startup withSetRateLimitForRequestType. - Don't pre-compress data; Roblox compresses automatically. Shard only genuinely hot keys.
- Use versions (
ListVersionsAsync,GetVersionAtTimeAsync) to restore data instead of writing backup keys.
Schema versioning and migrations
Store a version field. On load, run ordered migration functions until the data reaches the current
version, then reconcile defaults. Never delete fields in the same release that stops writing them;
never reuse field names with different meanings.
--!strict
type Data = { [string]: any }
local MIGRATIONS: { (Data) -> () } = {
[1] = function(data) -- v1 -> v2: "gold" renamed to "coins"
data.coins = data.gold or 0
data.gold = nil
end,
[2] = function(data) -- v2 -> v3: inventory list -> counts
local counts: { [string]: number } = {}
for _, itemId in data.inventory or {} do
counts[itemId] = (counts[itemId] or 0) + 1
end
data.inventory = counts
end,
}
local CURRENT_VERSION = #MIGRATIONS + 1
local function migrate(data: Data): Data
local version = data.version or 1
while version < CURRENT_VERSION do
MIGRATIONS[version](data)
version += 1
end
data.version = CURRENT_VERSION
return data
end
print(migrate({ gold = 5, inventory = { "Sword", "Sword" } }))
Leaderboards (OrderedDataStore)
- Values must be integers. Write on a schedule or on meaningful change, not every increment.
- Read top N with
GetSortedAsync(false, 100)on one server loop (e.g. every 60 s), cache the result, and replicate to clients. Don't let every server/client read constantly. - For "this week" boards, include the period in the store name (
Wins_2026W39) or use a MemoryStore sorted map. - Roblox-native leaderboards (fully released): register the
OrderedDataStorein Creator Hub (game → leaderboards) and toggle "Active leaderboard"; Roblox renders persistent Global and Friends tabs in the player list. The store stays the source of truth (one active board per game). Initialize each player's score on join so the tabs render correctly.
MemoryStore essentials
- Quotas are experience-wide: memory
64 KB + 1.2 KB × users; requests1000 + 120 × CCUunits/min. MemoryStoreSortedMap: ranked data, server browsers, live leaderboards (SetAsyncwith expiration,GetRangeAsync,UpdateAsync).MemoryStoreQueue: matchmaking/work queues (AddAsync,ReadAsync+RemoveAsyncwith the returned id after successful processing, invisibility timeout for crash safety).MemoryStoreHashMap: high-volume key-value without sorting (SetAsync,GetAsync,UpdateAsync,ListItemsAsync).- Always set expirations; handle throttling (
pcall+ retry); keep items small.
MessagingService essentials
- Message ≤ 1 kB. Per server:
600 + 240 × playerssends/min;20 + 8 × playerssubscriptions. - Delivery is best effort and not ordered: use it for notifications ("refresh your cache", global announcements), never as the source of truth. Pair with DataStore/MemoryStore for state.
- Wrap
SubscribeAsync/PublishAsyncinpcall; they can fail or yield.
More code (MemoryStore queue matchmaking, cross-server announcement, RTBF): references/memory-and-messaging.md.
Right to be forgotten
Use static key patterns so automated RTBF (configured in Creator Dashboard) can delete player data
templates like PlayerData/User_{userId}. Otherwise handle the right-to-erasure webhook (see
roblox-open-cloud). Link keys to user IDs: SetAsync(key, value, { userId }), return them as the second value from an
UpdateAsync transform, or call ProfileStore's AddUserId.
Related skills
roblox-security (duplication and trade exploits), roblox-monetization (receipts),
roblox-open-cloud (external access, bulk operations), roblox-teleport-matchmaking.
FAQ
What does the roblox-data-stores skill do?
Persistence and cross-server data - DataStoreService (UpdateAsync, retries, budgets, limits), session locking with ProfileStore, schema migrations, OrderedDataStore leaderboards, MemoryStore queues/sorted maps/hash maps, MessagingService, right-to-be-forgotten. Use when saving player data, building leaderboards or queues, or fixing data loss, duplication, or throttling.
How do I install roblox-data-stores?
Run npx skills add https://github.com/el4cteo/roblox-skills --skill roblox-data-stores in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/roblox-data-stores/ (personal) or .claude/skills/roblox-data-stores/ (project).
Which AI agents can use roblox-data-stores?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is roblox-data-stores safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains roblox-data-stores?
It is published by el4cteo in el4cteo/roblox-skills. It has 456 recorded installs.
More from el4cteo/roblox-skills
roblox-world-building
el4cteo/roblox-skills
Building worlds with code - parts, models and pivots, materials, Lighting (LightingStyle, Atmosphere, post-processing), day/night, Terrain API, in-game CSG and destruction (GeometryService Subtract/Union/Fragment), ProceduralModel, EditableMesh/EditableImage, particles/beams/trails/highlights. Use when creating maps, environments, lighting, destructible objects, procedural levels, or visual effects.
roblox-ui
el4cteo/roblox-skills
Responsive cross-platform UI - ScreenGui and safe areas (ScreenInsets), Scale vs Offset, UIListLayout flex/UIFlexItem, constraints, StyleSheets/tokens/themes, RichText, gamepad/touch navigation, UIDragDetector, CanvasGroup, tweens, BillboardGui/SurfaceGui, React-lua/Fusion/Vide. Use when building HUDs, menus, shops, inventories, or fixing UI that breaks on mobile, console, or other screen sizes.
roblox-luau
el4cteo/roblox-skills
Modern, type-safe Luau for Roblox, covering --!strict and the new type solver, generics, string interpolation, if-expressions, task library, require-by-string, module/OOP patterns, error handling with retries, buffer/vector, and legacy APIs to avoid. Use when writing, refactoring, or explaining any Roblox script, fixing type errors, or modernizing old Lua code.
roblox-testing
el4cteo/roblox-skills
Open the skill to read its SKILL.md instructions.
roblox-game-systems
el4cteo/roblox-skills
Recipes for common systems built on server authority - currency service and leaderstats, XP/levels, round loops with intermission and teams, validated melee/ranged combat, inventory and tools, soft-currency shops, obby checkpoints, daily rewards, pets. Use when implementing or reviewing gameplay systems such as rounds, combat, weapons, inventories, shops, currencies, or progression.
roblox-code-review
el4cteo/roblox-skills
Review Roblox/Luau code for exploits, data loss, memory leaks, performance problems, lifecycle bugs, policy issues, and deprecated or superseded APIs, using a severity-ranked checklist and the full 2026 deprecation map. Use when reviewing a PR or script, auditing a game before launch, modernizing legacy code, or asked what is wrong with some Roblox code.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.