
dataServiceTyped
DataServiceTyped provides persistent, auto-replicated, and observable typed player data management for Roblox Luau.
It eliminates session locks entirely, providing stronger consistency guarantees (invalid state is unreachable) with zero lock wait time, no lease expiry issues, and no need for side-channel communication, while supporting cross-server writes, atomic transactions, and automatic recovery.
Player data as a ledger, not a document.
A datastore library for Roblox with no session locks. You never write state. You write down the change you want, a function you own decides whether it is legal, and state is what falls out of replaying those changes.
local Store = Ledger.New({
Name = "PlayerData",
Default = { Gold = 100, Items = {} },
Reducer = function(State, Op)
if Op.Kind == "SpendGold" then
if Op.Amount > State.Gold then
return nil -- refused, on every server, forever
end
local Next = table.clone(State)
Next.Gold -= Op.Amount
return Next
end
return nil
end,
})
Store:Load(Player)
Store:Expect(Player):Apply("SpendGold", { Amount = 25 })
Two servers spend the same 100 gold, both writes land, the fold accepts one and refuses the other. Every server agrees, every time.
A session lock serializes writers. A validating fold makes the invalid state unreachable, which is a stronger guarantee that also costs nothing when a server crashes: no lease to wait out, no locked player join stall, no side channel to touch someone offline or on another server. What you pay instead is discipline. Changes are ops with names, and a reducer validates them.
Apply is an instant local call. Commit
is durable and tells you whether your op won, so exactly one server lands a one time grant.Edit, Transfer and Tx work on any player, online here,
elsewhere, or offline.Keys = "String" gives you clans, listings, world records: shared state
no single server owns.