Skip to main content

DBOS Transact Core Concepts

DBOS Transact is a TypeScript framework that helps you develop backend applications that work right by default. Its two main principles are inspired by the DBOS research project from Stanford and MIT:

  1. Store all application state in the database. By managing database connections and transactions, DBOS makes it easy for you to store all your app state in the database so it can be safe, consistent, and durable. Under the hood, we use the database to manage the state of workflow execution as well as all messages and events.

  2. Access state only through database transactions. All database operations in DBOS are transactional, making it easy for you to leverage databases' strong safety guarantees and eliminating most race conditions. Under the hood, we use transactions to guarantee your workflows always run to completion, your operations execute exactly-once, and your messages are delievered reliably.

Programming Model

In DBOS Transact, you build your applications from Typescript functions, annotating them with decorators to declare their properties. There are four basic types of functions:

  • Transactions run your core business logic transactionally in the database.
  • Communicators talk to external services and APIs, with built-in automatic retries.
  • Workflows reliably orchestrate other functions—if a workflow is ever interrupted for any reason (like a server crash), it always resumes from where it left off.
  • Handlers serve HTTP requests.

When you launch an application, DBOS automatically wires these functions together for you, setting up an HTTP server for your endpoints and a database connection pool for your transactions.

Reliable by Default

A critical component of DBOS's programming model is reliability, guaranteed by the database. Your transactions are always ACID. Your workflows always run to completion, even when interrupted by a server crash—when the server is restarted, they resume from where they left off and don't repeat any operation they previously completed. Your messages come with guaranteed exactly-once delivery. Our goal is to make your app work the way you think it should.