Menu

Post image 1
Post image 2
1 / 2
0

The dual-write problem (and a Postgres-native fix for Node.js background jobs)

DEV Community·Yury·about 1 month ago
#iujLLyWg
Reading 0:00
15s threshold

What Temporal taught me about state I've spent years building on Temporal — workflows-as-code, durable execution, the whole gospel. The thing Temporal got right, the thing that made it hard for me to go back to ordinary Redis-backed queues, is this: workflow state is durable on every step . It lives in a transactional database. There's no in-memory state that disappears on a crash, no message that's "in flight" without being persisted, no step that completes without its result being safely written. But Temporal's durability story has a quiet caveat: it only protects state inside a workflow. The moment you have an application database alongside the workflow service — and most projects do — you're back to two systems. Consider this signup handler: import { Client } from " @temporalio/client " ; import { sendWelcomeEmail } from " ./workflows " ; const temporal = new Client (); await db . transaction ( async ( tx ) => { const user = await tx . users .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More