You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Classify the package immediately, describe the exact browser coverage, and scope the quickstart assertions to one local run. Put the runnable example before the broader use-case table.
See #2
| Multiplayer, presence, or collaboration | Room, session, or document | Joins, moves, and edits commit in order; subscribers refresh from committed state |
55
-
| Reservations and expiring holds | Show, resource, or stock item | Availability checks and holds cannot interleave; a durable reminder can release an old hold |
56
-
| Checkout and account workflows | Cart, order, account, device | The current step, retries, and effect results return to the same ordered mailbox |
57
-
| Per-key rate limits | API key, account, or device | Token checks and decrements are serialized; a reminder can refill the bucket |
58
-
| Stateful agent sessions | Agent session | Messages and tool results apply in order and pending work survives a worker exit |
59
-
60
-
The common shape is one durable coordination boundary with an application
61
-
defined identity. Work for that identity is serialized, while unrelated rooms,
62
-
carts, accounts, or sessions can progress concurrently. A single global rate
63
-
limiter or another very hot identity is a poor fit because it becomes an
64
-
intentional bottleneck. If one ordinary row transaction solves the problem,
65
-
prefer that. See [Choosing Solid Objects](docs/fit.md) for the longer guide.
66
-
67
44
## Run it now with SQLite
68
45
69
46
Node.js 24.15 or newer is required. The `0.13.0` release includes a
@@ -77,8 +54,8 @@ The command needs no repository checkout, database server, Redis, container, or
77
54
application configuration. It uses Node's built-in SQLite module and removes
78
55
its scoped temporary database before exiting.
79
56
80
-
The executable asserts rather than merely printing a plausible result. It
81
-
proves that:
57
+
The executable asserts rather than merely printing a plausible result. In one
58
+
local run, it verifies that:
82
59
83
60
- 25 concurrent calls to one identity produce the exact committed state `25`;
84
61
- their return values are the complete sequence from `1` through `25`;
@@ -88,6 +65,28 @@ proves that:
88
65
Before `0.13.0` reaches the registry, maintainers can run the identical
89
66
executable from a generated package tarball with `pnpm run test:package`.
90
67
68
+
## What Solid Objects is for
69
+
70
+
Use Solid Objects when more than one request, job, or process can act on the
71
+
same logical thing and the next action must use its latest committed state.
72
+
These are the stateful coordination patterns for which people often reach for
73
+
Durable Objects:
74
+
75
+
| Pattern | One identity per | What the object coordinates |
| Multiplayer, presence, or collaboration | Room, session, or document | Joins, moves, and edits commit in order; subscribers refresh from committed state |
78
+
| Reservations and expiring holds | Show, resource, or stock item | Availability checks and holds cannot interleave; a durable reminder can release an old hold |
79
+
| Checkout and account workflows | Cart, order, account, device | The current step, retries, and effect results return to the same ordered mailbox |
80
+
| Per-key rate limits | API key, account, or device | Token checks and decrements are serialized; a reminder can refill the bucket |
81
+
| Stateful agent sessions | Agent session | Messages and tool results apply in order and pending work survives a worker exit |
82
+
83
+
The common shape is one durable coordination boundary with an application
84
+
defined identity. Work for that identity is serialized, while unrelated rooms,
85
+
carts, accounts, or sessions can progress concurrently. A single global rate
86
+
limiter or another very hot identity is a poor fit because it becomes an
87
+
intentional bottleneck. If one ordinary row transaction solves the problem,
88
+
prefer that. See [Choosing Solid Objects](docs/fit.md) for the longer guide.
89
+
91
90
## How it works
92
91
93
92
An object is addressed by its TypeScript class and application-defined ID.
0 commit comments