Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# @toolctrl/shared-store
|
||||
# @hivegrid/shared-store
|
||||
|
||||
Cross-replica state primitives backed by Redis (production) or an in-memory
|
||||
adapter (dev/test). This package is the foundation for horizontal scaling of
|
||||
@@ -7,7 +7,7 @@ idempotency keys, MCP transport pool).
|
||||
|
||||
## When to use
|
||||
|
||||
Reach for `@toolctrl/shared-store` whenever a piece of state must remain
|
||||
Reach for `@hivegrid/shared-store` whenever a piece of state must remain
|
||||
consistent across multiple replicas of the API, web, or worker process. The
|
||||
package exposes a small adapter surface (`SharedStoreAdapter`) plus higher
|
||||
level helpers for the most common patterns:
|
||||
@@ -22,14 +22,14 @@ level helpers for the most common patterns:
|
||||
|
||||
- Hot in-loop counters that never leave a single request. Plain locals are
|
||||
fine.
|
||||
- Long-term durable storage. Use Postgres via `@toolctrl/db`.
|
||||
- Job queues. Use `@toolctrl/queue` (BullMQ) which already owns Redis DB
|
||||
- Long-term durable storage. Use Postgres via `@hivegrid/db`.
|
||||
- Job queues. Use `@hivegrid/queue` (BullMQ) which already owns Redis DB
|
||||
index `0`.
|
||||
|
||||
## Quickstart
|
||||
|
||||
```ts
|
||||
import { createSharedStore, createFixedWindowRateLimiter } from "@toolctrl/shared-store";
|
||||
import { createSharedStore, createFixedWindowRateLimiter } from "@hivegrid/shared-store";
|
||||
|
||||
const store = createSharedStore({
|
||||
namespace: "auth-login",
|
||||
@@ -57,9 +57,9 @@ key spaces never collide:
|
||||
|
||||
| Index | Owner | Notes |
|
||||
| ----- | --------------------- | ------------------------------------- |
|
||||
| 0 | `@toolctrl/queue` | BullMQ default |
|
||||
| 1 | `@toolctrl/shared-store` | KV state (rate-limits, sessions, etc.) |
|
||||
| 2 | `@toolctrl/shared-store` Pub/Sub | Reserved for cross-instance invalidation |
|
||||
| 0 | `@hivegrid/queue` | BullMQ default |
|
||||
| 1 | `@hivegrid/shared-store` | KV state (rate-limits, sessions, etc.) |
|
||||
| 2 | `@hivegrid/shared-store` Pub/Sub | Reserved for cross-instance invalidation |
|
||||
|
||||
The factory accepts `redisDbIndex` to override the default of `1`.
|
||||
|
||||
@@ -76,7 +76,7 @@ The factory accepts `redisDbIndex` to override the default of `1`.
|
||||
## Namespace conventions
|
||||
|
||||
- Use a short, kebab/snake-cased namespace that names the **subsystem**, not
|
||||
the helper. Good: `auth-login`, `mfa-challenge`, `stripe-idempotency`.
|
||||
the helper. Good: `auth-login`, `mfa-challenge`, `mollie-idempotency`.
|
||||
Bad: `ratelimit`, `cache`.
|
||||
- Every key passes through `shared-store:<namespace>:<prefix>:<suffix>`.
|
||||
Two helpers in the same namespace cannot collide because each helper
|
||||
@@ -93,9 +93,9 @@ key spaces never collide:
|
||||
|
||||
| Index | Owner | Notes |
|
||||
| ----- | --------------------- | ------------------------------------- |
|
||||
| 0 | `@toolctrl/queue` | BullMQ default |
|
||||
| 1 | `@toolctrl/shared-store` | KV state (rate-limits, sessions, etc.) |
|
||||
| 2 | `@toolctrl/shared-store` Pub/Sub | Reserved for cross-instance invalidation |
|
||||
| 0 | `@hivegrid/queue` | BullMQ default |
|
||||
| 1 | `@hivegrid/shared-store` | KV state (rate-limits, sessions, etc.) |
|
||||
| 2 | `@hivegrid/shared-store` Pub/Sub | Reserved for cross-instance invalidation |
|
||||
|
||||
The factory accepts `redisDbIndex` to override the default of `1`.
|
||||
|
||||
|
||||
Reference in new issue
Block a user