Stop spinning up Redis, message brokers, and background workers just to expire a trial or cancel a stale order. CronDB evaluates temporal state natively — on every single read.
The same free-trial expiry logic — one done the traditional way, one with CronDB's native temporal syntax.
// 1. Insert user db.query(`INSERT INTO users SET plan='Trial', trial_expires_at = NOW() + INTERVAL 14 DAY`); // 2. Schedule expiry job (cron, SQS, etc.) scheduler.schedule('0 * * * *', async () => { const expired = await db.query(` SELECT id FROM users WHERE plan = 'Trial' AND trial_expires_at < NOW()`); for (const user of expired) { await db.query(`UPDATE users SET plan = 'Free' WHERE id = ?`, user.id); await queue.publish('plan.downgraded', user); } }); // 3. Worker listens to queue, calls webhook // 4. Handle failed jobs, dead letters... // 5. Monitor that all three are running...
// 1. Insert user with native FSM transition INSERT INTO users name = 'Alice' plan = ('Trial' --> 'Free' @ 14 d) // 2. Register webhook — fires exactly at transition LISTEN users.plan --> 'https://api.app.com/downgrade' WHERE plan = 'Free' // That's it. Engine handles the rest. // SELECT always returns the live, current state. // No polling. No workers. No queue.
SELECT, the engine computes elapsed time against the insertion timestamp and returns the live, correct state — no app logic needed.cron.wal before execution. On crash, the bootloader replays the log to restore committed state. Full BEGIN / COMMIT / ROLLBACK transaction support with in-memory undo log..bin files. Row i is always at offset header + i × rowSize — O(1) random access, no heap scan.LINK to establish referential integrity. Parent rows cannot be deleted while child rows reference them. FK columns can themselves be FSM-driven.StartEngine, ExecuteQuery, StopEngine.crondb-driver) and PyPI packages wrap the HTTP API with ORM-style insert, select, update, delete, and listen methods.No subscription. No seats. No vendor lock-in. Pay $29, get the binaries, ship your product.
Questions? Join us on Discord · Read the Architecture Guide
SELECT, the engine computes elapsed time and walks the state chain to find the current value — no background ticker required for reads. A separate clock thread (500ms interval) handles the webhook queue, but this never blocks query execution.ctypes.CDLL('./crondb.so') (or .dll on Windows) and call StartEngine(), ExecuteQuery(query), and StopEngine(). The architecture doc includes a full persistent game-world example showing exactly this pattern.