Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Durable Objects without Cloudflare, on the database you already run

说明与用途

Solid Objects 将 Durable Objects 实现为可在任何 SQL 数据库上运行的库,按身份序列化调用,并将状态和计时器存储在数据库中,消除了外部服务的需求。

问题

Developers need single‑threaded, per‑identity stateful objects without relying on a vendor‑specific edge platform, while avoiding the complexity of databases, queues, and locks.

结果

Solid Objects enables per‑identity, single‑threaded stateful objects on any SQL database, eliminating the need for external queues, locks, or vendor‑specific edge platforms. It serializes concurrent calls, guarantees atomic state updates, and stores timers in the same database, reducing operational cost and complexity.

工作流

  • 1. Install Solid Objects via npm or add the Ruby gem to a Rails app.
  • 2. Define an actor class by extending Actor and implementing business logic.
  • 3. Create a runtime with createRuntime, passing a database driver (e.g., sqlite).
  • 4. Install the runtime to set up necessary tables.
  • 5. Obtain a reference to an actor instance with runtime.ref(actorClass, identity).
  • 6. Call actor methods; each call is queued as a durable message and processed one at a time.
  • 7. Use schedule() to set per‑identity timers that survive crashes.
  • 8. Run quickstart tests to verify serialization and concurrency.
  • 9. Deploy the application; no additional services are required beyond the existing database.

证据

Solid Objects ships in two implementations that share one design: a Ruby gem that runs in production in an app with over 100,000 users, and a TypeScript package for Node.

来源

The ten‑minute hold uses a durable reminder. Calling schedule with the buyer's key arms one alarm for that hold, and calling it again with the same key moves the alarm instead of adding a second one.

来源

  • 记录日期: 2026-09-06T23:22:38.577Z