Open Source Durable Objects for Postgres
22 days ago
- Solid Objects implements the Durable Objects programming model as a library for SQLite, PostgreSQL, and MySQL, eliminating vendor lock-in, unpredictable pricing, daemon processes, and additional stateful systems.
- It replaces complex manual patterns (row locks, Redis locks, delayed jobs, sweepers) with a single object that handles state, reminders, effects, and broadcasts within one transaction.
- The turn mechanism uses an ordered mailbox and fenced lease per identity, ensuring ordered, at-least-once delivery with idempotent external effects.
- Performance shows ~2.6ms p50 latency within one process (SQLite); cross-process waits ~1s without PostgreSQL notifications or optional Redis wake-up.
- Installation adds tables to existing databases (Node 24+ or Rails 7.1+), and it is pre-1.0 but used in production for one app with >100k users.
- Author's motivation came from replacing cron sweeps and key-value store scans with per-entity reminders, inspired by Shopify's migration of inventory reservations from Redis to MySQL.