Skip to main content

Strata

Data, without the overhead.

Strata isn't the data system with the most features. It's the one that asks the least of you to get a great one.

Typed data, automatic replication, serialization, and session management — without making you build the infrastructure yourself.

S.Coins.Get()
S.Coins.Set(50)

S.Coins.Observe(function(Coins)
print(Coins)
end)

What makes Strata easy?​

  • No session setup. Player sessions are handled automatically.
  • No remotes to manage. Replication is built in.
  • No separate type definitions. Your template provides types and autocomplete.
  • No manual serialization. Supported Roblox and Luau datatypes are handled automatically.
  • No manual saving. Data saves automatically, and you can still call Save when needed.
info

For the best autocomplete experience, enable the new Luau type solver by setting Workspace.UseNewLuauTypeSolver to Enabled. Runtime functionality does not depend on it.

Getting started​

1. Install Strata​

Install Strata via wally,

Strata = "soggybird0/strata-service@^1.1.0"

Or via model.

Place Strata inside ReplicatedStorage. Strata automatically creates its required runtime components and types.

2. Create your data module​

Create a ModuleScript named Data inside ReplicatedStorage:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Strata = require(ReplicatedStorage.Strata)

local Template = {
Coins = 0,
Stats = {
Level = 1,
Xp = 0,
},
Inventory = {} :: { string }, -- `{ string }` Notifies Strata to use array types for this field
}

return Strata.Init({
StoreName = "Players",
Template = Template,
})

The template defines your data structure and provides the types used throughout your project.

New players receive the template, while existing player data is reconciled with newly added fields.

3. Load and use data​

Server

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Data = require(ReplicatedStorage.Data)

Players.PlayerAdded:Connect(function(Player)
local S = Data.Server:LoadVault(Player)
if not S then
return
end

S.Coins.Update(function(Coins)
return Coins + 100
end)

S.Inventory.AddNext("Wooden Sword") -- Adds to the end of the array (pos = #array + 1)
end)

Client

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Data = require(ReplicatedStorage.Data)

local C = Data.Client:LoadVault()
if C then
C.Coins.Observe(function(Coins)
CoinLabel.Text = tostring(Coins)
end)
end

Every node has its own Observe. It calls your listener with the current value shortly after you connect, then again whenever that value changes. Use Changed instead if you only want the changes.

Working with data​

Strata provides methods based on the type of value you're working with.

Any value​

  • Get — Retrieve the current value.
  • Set — Replace the current value.
  • Update — Transform the current value.
  • Observe — Receive the current value, then every change.
  • Changed — A signal that fires on every change.

Tables​

  • Mutate — Modify a table.
  • Snapshot — Retrieve a copy of the current data.

Arrays​

  • AddNext — Add an item to the end.
  • RemoveLast — Remove the last item.
  • InsertAt — Insert an item at a position.
  • RemoveAt — Remove an item at a position.

Arrays and maps​

  • Has — Check whether a key or value exists.
  • Keys — Retrieve keys.
  • Values — Retrieve values.
  • Size — Get the number of entries.
  • Insert — Insert an entry.
  • Remove — Remove an entry.
  • Clear — Remove all entries.

Vault operations​

  • Save — Save the current data.
  • End — End a session.
  • Replicate — Request replication.
  • GetSessionInfo — Retrieve session information.
  • IsLoaded — Check whether a vault is loaded.

All data-node methods use dot syntax:

S.Coins.Get()
S.Coins.Set(100)
S.Coins.Update(function(Coins)
return Coins + 1
end)

Observe works the same way on any node, from a single field to the whole vault:

S.Stats.Level.Observe(function(Level)
print("Level:", Level)
end)

Changed is the one exception to dot syntax. It's a signal, so it uses method syntax:

S.Stats.Level.Changed:Connect(function(New, Old)
print(New, "was", Old)
end)

Batched replication​

By default, Strata does not send a network message on every single write. Writes that happen in the same frame are queued, then flushed together at the end of the frame (task.defer).

What that means in practice:

  1. Queue — Each Set / Update / Mutate / array write produces one or more patches and adds them to a per-session bucket.
  2. Defer — The first write in a frame schedules a flush. Later writes in that same frame only append to the bucket.
  3. Flush — At the end of the frame, the bucket is sent as one "Patch" replica (or one "Full" snapshot).

What Strata is for​

Strata is designed for player data.

It uses ProfileStore for session-based data saving and provides automatic client replication. It is not intended to replace systems such as OrderedDataStore or MessagingService for global data, leaderboards, or communication between servers.

The server owns all data changes. The client receives a read-only replica, and server-side changes are replicated automatically.

What's next?​