Логотип Roblox Data Stores

Roblox Data Stores

Спільнота
EL4CTEO
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.

Огляд

ВидавецьEL4CTEO
Репозиторійroblox-skills
Назва навичкиroblox-data-stores
Зірки
170
Форки
18
Файли в пакеті
2
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 2

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: EL4CTEO. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Roblox Data Stores у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/EL4CTEO/roblox-skills/tree/main/skills/roblox-data-stores
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/EL4CTEO/roblox-skills.git /tmp/roblox-skills
mkdir -p .claude/skills
cp -r /tmp/roblox-skills/skills/roblox-data-stores .claude/skills/roblox-data-stores
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Roblox Data Stores в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Roblox Data Stores, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Roblox Data Stores не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Roblox data stores and cloud services

Choose the service

NeedServiceNotes
Player progress, inventory, settingsDataStore via ProfileStore (session-locked)One key per player (User_{UserId}), ≤ 4 MB.
Global leaderboardsOrderedDataStoreInteger values only; periodic updates, cached reads.
Fast, temporary, cross-server stateMemoryStoreServiceSorted maps, queues, hash maps; everything expires (TTL ≤ 45 days).
Matchmaking queues, live events, server listsMemoryStore queue / sorted mapNot durable — never the only copy of valuable data.
Broadcast to all serversMessagingService≤ 1 kB per message, best effort, no delivery guarantee.
Values changed by live-ops without publishingExperience 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.

luau
-- 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.
  • UpdateAsync over SetAsync whenever the write depends on the old value or multiple servers may write the key. The transform function must be pure and fast (no yields); return nil to 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, and buffers. 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)

LimitValue
Experience-wide standard reads / writes300 + 40 × CCU / 300 + 20 × CCU per minute (shared with Open Cloud)
Default per-server reads/writes60 + 40 × players per minute each (configurable)
Ordered writes per server30 + 5 × players per minute
Per-key throughput25 MB/min read, 4 MB/min write
Storage (latest versions, compressed)500 MB + 1 MB × lifetime users per experience
Queue per request type30 pending requests, then errors 301–306
  • UpdateAsync consumes both read and write budget.
  • Check DataStoreService:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.StandardWrite) before bulk work; tune per-server limits once at startup with SetRateLimitForRequestType.
  • 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.

luau
--!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 OrderedDataStore in 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; requests 1000 + 120 × CCU units/min.
  • MemoryStoreSortedMap: ranked data, server browsers, live leaderboards (SetAsync with expiration, GetRangeAsync, UpdateAsync).
  • MemoryStoreQueue: matchmaking/work queues (AddAsync, ReadAsync + RemoveAsync with 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.
  • Sorted-map and hash-map UpdateAsync retry write conflicts internally (jittered backoff, re-reading the latest value), so the transform function can run several times: keep it pure, no side effects.

MessagingService essentials

  • Message ≤ 1 kB. Per server: 600 + 240 × players sends/min; 20 + 8 × players subscriptions.
  • 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/PublishAsync in pcall; 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.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ 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.

Навіщо використовувати Roblox Data Stores у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Roblox Data Stores — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Roblox Data Stores у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/EL4CTEO/roblox-skills/tree/main/skills/roblox-data-stores. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Roblox Data Stores?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Roblox Data Stores?

Зі скількома забажаєте. У TypingMind ви можете використовувати Roblox Data Stores із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Roblox Data Stores?

Так. На GitHub цю навичку публікує EL4CTEO за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇