Skip to content
Tech News
← Back to articles

Show HN: DBOSify – Drop-in Temporal replacement built on Postgres

read original more articles
Why This Matters

DBOSify offers a simplified, infrastructure-light alternative to Temporal by enabling durable workflows directly on Postgres. This innovation streamlines workflow management for developers, reducing complexity and operational overhead, and making reliable workflow execution more accessible for a broader range of applications.

Key Takeaways

DBOSify

DBOSify is a drop-in replacement for Temporal Python that uses Postgres (through DBOS Transact) instead of a Temporal server. This lets you run durable workflows, activities, signals, updates, retries, and recovery without needing any infrastructure except Postgres.

To use this library, import dbosify instead of temporalio and connect your workers and clients to a Postgres database:

Usage

To install:

pip install dbosify

This is a drop-in replacement: simply import dbosify instead of temporalio and connect your clients and workers to a Postgres database instead of a Temporal server. Further documentation here.

import asyncio import os from datetime import timedelta from dbosify import activity , workflow from dbosify . client import Client from dbosify . worker import Worker # Set this to a connection string to your Postgres database DB_URL = os . environ . get ( "DBOS_SYSTEM_DATABASE_URL" ) @ activity . defn async def compose_greeting ( name : str ) -> str : return f"Hello, { name } !" @ workflow . defn class GreetingWorkflow : @ workflow . run async def run ( self , name : str ) -> str : return await workflow . execute_activity ( compose_greeting , name , start_to_close_timeout = timedelta ( seconds = 10 ) ) async def main () -> None : worker = Worker ( DB_URL , task_queue = "greetings" , workflows = [ GreetingWorkflow ], activities = [ compose_greeting ], ) async with worker : async with await Client . connect ( DB_URL ) as client : result = await client . execute_workflow ( GreetingWorkflow . run , "World" , id = "greeting-1" , task_queue = "greetings" ) print ( result ) # Hello, World! if __name__ == "__main__" : asyncio . run ( main ())

How It Works

DBOSify runs each Temporal workflow as a Postgres-backed DBOS workflow. A deterministic interpreter runs the workflow (both its main coroutine and its signal, update, and query handlers) on a virtual event loop that only advances when an event arrives. Using DBOS steps and workflow communication primitives, all nondeterministic actions are checkpointed in Postgres before the workflow observes them.

... continue reading