Releases
What changed from v6, and what you have to change with it.
+ is new in v7, ~ exists in v6 and works differently now, - is gone, ! is something to know before you upgrade.
7.3.1
Each loaded key holds less memory.
| 7.3.0 | 7.3.1 | |
|---|---|---|
| A 100 KB player, just loaded | 616 KB | 485 KB |
| A busy 100 KB player | 1,469 KB | 1,209 KB |
| A busy 1 MB player | 10.6 MB | 7.4 MB |
+ Ledger keeps one entry for each table it has checked instead of three, so a loaded key holds 18 to 30% less memory
~ Ledger folders got restructured7.3.0
More optimizationsss
| A 100 KB player | 7.2.0 | 7.3.0 |
|---|---|---|
50 Edit calls | ~72 ms | ~12 ms |
50 Commit calls | ~97 ms | ~12 ms |
| 10 trades between two players | ~51 ms | ~7 ms |
200 Session:Get calls | ~98 ms | ~8.5 ms |
Unload | 2.3 ms | ~0.8 ms |
A 1 MB player gains the most: an Edit goes from about 12 ms to about 0.5 ms, and a trade from about 44 ms to about 1.2 ms.
+ Edit, Commit and trades cost about the same on a 1 MB player as on a 100 KB one
+ A save skips reading the stored data back when it is what this server last wrote, checked by a BLAKE3 hash
+ Get, Peek and Follow hand back tables Ledger already holds instead of copying them
! Answers are still read-only, but two answers can now be the same table. Compare contents, not identity
! Memory per loaded key is about what it was in 7.2.0: about 1.4 MB for a busy 100 KB player, against 0.8 MB in 7.1.07.2.0
Changes to big player data cost a fraction of the server time they did.
| A 100 KB player | 7.1.0 | 7.2.0 |
|---|---|---|
200 Apply calls and a save | 1,117 ms | 8.5 ms |
50 Edit calls | ~575 ms | ~72 ms |
50 Commit calls | ~611 ms | ~97 ms |
| 10 trades between two players | ~239 ms | ~51 ms |
Unload | 64 ms | 2.3 ms |
+ Checking a change only looks at the tables it touched, not the whole state
+ Decimal numbers are written up to 50x faster
+ A save reuses this server's last copy when nothing else changed the key, instead of checking it again
+ Peek and Follow copies are cut and handed out faster
! A live server now makes every table inside a reducer's Data, and every table a reducer returns, read-only. Changing one throws and the op is refused, as Studio always did
! Each loaded key holds more memory: about 1.4 MB against 0.8 MB for a busy 100 KB player
~ Loading a large, deeply nested state can take a little longer (16 to 22 ms at 1 MB)7.1.0
One key can now be followed by millions of servers, and saves are far smaller.
What a game gets
| 7.0.5 | 7.1.0 | |
|---|---|---|
| Servers following one busy key | ~3,750 | ~1.9 million |
| Servers following one quiet key | ~30,000 | ~15 million |
| Copy reads a minute across the game | ~0.8 million | ~13.6 million |
| MemoryStore maps copies and totals spread over | 16 | 256 |
| A 100 KB player's save | 100 KB | ~12.5 KB |
Follower numbers are at half of Roblox's MemoryStore limits. The save size is one measured player state; yours depends on your data.
+ Follow and Peek with MaxAge spread a busy key's copy over up to 512 MemoryStore replicas as it gets hot
+ Total spreads its summary the same way
+ Data over 1 KB saves compressed whenever that is smaller, not only near the 4 MB limit
~ Size warnings count the saved size, and also warn when a key's data passes 4 MB as JSON7.0.5
+ Auto Compresses when near 4mb per key limit
+ Slight optimization7.0.4
+ ~25% faster from minor changes7.0.3
+ Fixed output order bug by forcing orderingIf you sell with Hold and Confirm, read Hold and Confirm: calling Confirm twice with the same hold sells two, so the buyer's leg needs the purchase id.
7.0.2
+ Store:Keys(Prefix) lists only the keys that start with Prefix, on a string store
+ Store:Versions(Key) lists the versions Roblox kept of a key
+ Store:PeekVersion(Key, Version) reads one of those versions, as it was saved7.0.1
+ One op in a Ledger.Tx or Quantity:Take leg can be up to 4,096 bytes of terms, up from 512The 512 byte cap was left over from an early design that stored a leg's op in its key.
7.0.0
Ledger 7 is rebuilt from scratch. It's cheaper, holds more, and every edge case we could find is tested.
What a 100k CCU game gets
| v6 | v7 | |
|---|---|---|
| Trades a minute | 225,000 | 900,000 |
| Trades a day | 324 million | 1.3 billion |
| Trades a day through one guild bank or shop | 1,900 | 590,000 |
| Trades running on one key at once | 1 | 16 |
| MemoryStore requests a minute spent on trades | 1.8 million | 0 |
| Players in one trade | 4 | 29 |
| Data per player | 2 MB | 4 MB |
| Limited item sales a minute, never oversold | none | 900,000 |
| Global counter adds a minute | none | unlimited, for 1.6% of your write budget |
What's new
- Balances. Number fields like gold or gems that you change with
CreditandDebitops, withMinandMaxlimits. They never hold up a trade. - Quantities. Limited items sold from every server at once, never oversold, with
Take,Hold,Confirm,Close,Deposit,GatherandWithdraw. - Totals. Count things across the whole game, like total gold spent. Reading them is free most of the time.
- Answers straight away. Every call answers
(Ok, Result, Info)at once. No more:Wait(). - Info.Outcome. When a save answers
Unresolved, this tells you later whether it went through. - Six new answers.
Unreadable,Expired,NoRoom,Missing,ShortandSoldOut, each with one meaning. See Answers. - Strict types. Every op you send is checked against your
Opstype before you press Play. - Safer deletes.
ResetandEraselist the balances they wiped inCut.Losses, and a retried call can never wipe twice. - Support tools.
Store:Keys,Store:LossesandStore:Pendingfor looking into a player's data. - Session:Refresh. Show a player changes made by another server or a trade, straight away.
- Fresh reads.
Peek(Key, { Fresh = true })reads the newest saved data. - Ledger.Now() and Ledger.BeforeClose(). A clock for named ops, and a hook that runs before shutdown saves.
- No
BindToClose. Ledger saves every player on shutdown by itself.
Every change
+ Ledger.Now() and Ledger.BeforeClose()
+ Mock: run a server on the Mock package's in-memory DataStore and MemoryStore
+ Balances: number fields like gold that Ledger changes for you, with limits, and that never hold up a trade
+ Store:Keys(), Store:Losses(), Store:Pending(), Session:Refresh()
+ Quantities: Take, Hold, Confirm, Close, Deposit, Gather, Withdraw
+ Cut.Losses lists what Reset and Erase destroyed
+ Info.Outcome tells you what became of an Unresolved write
+ Six answers: Unreadable, Expired, NoRoom, Missing, Short, SoldOut
+ Peek(Key, { Fresh = true }) reads the newest saved data
~ Every call answers (Ok, Result, Info), with no Future and no Wait. A read never means empty
~ 15 answers instead of 10, all checked by Ledger.Reason
~ Peek of a key that was never saved answers nil, Missing. It no longer gives the Default
~ Ops are named with Id and IdAt in the options (Edit, Commit, Ledger.Tx)
~ Ledger.Id() answers nil, Busy when it cannot make a name yet. Erase and Reset take one
~ Reset and Erase answer a Cut
~ Ledger.Tx, Bump, Total, Follow, Stale and Peek with MaxAge keep their names, with new answers
~ Ledger.New<<Data, Ops>> type-checks every op you send against your Ops type
~ TypeScript typings for roblox-ts, rebuilt for v7: @xoifail/ledger 7.0.0
- Held, and calls that return a Future
- Transfer, Reserve and Once. Use Ledger.Tx, quantities and named ops
- EditOp, CommitOp, Session:Compact, Ledger.Sweep, History, PeekVersion
! Data written by v6 may read Unreadable or Behind. Use new store names for v7
! Erase and Reset take only a Ledger.Id() name, or none. A string Id throws
! A server answers Expired for its own Ledger.Id() name once it is 6 minutes old. Make the name just before you use it
! For a quantity's counts use Store:Quantity(Name):Total(). Store:Total is for totals
! A Final quantity must declare StockUpgrading
Plan for a rewrite of the calls, not a version bump. Start with Getting started, then Answers and Common mistakes.
v7 does not read v5 or v6 data. Open v7 stores under new names, and copy each player's old data in on their first join, as in Changing your data.
Or use the AI skill to help. Install it with npx skills add XoifaiI/Ledger.