How dbos-inc/dbos-transact-ts works
Main Components
a) Core Runtime Layer:
• Main runtime components from src/dbos-runtime
• Workflow engine (src/workflow.ts)
• Transaction manager (src/transaction.ts)
• Scheduler system (src/scheduler)
b) Database Layer:
• At the bottom
• Both system database and user database connections
• Support for multiple ORMs (Drizzle, Knex, TypeORM, Prisma)
• FoundationDB integration for durability
c) Communication Layer:
• On the sides
• HTTP Server component (src/httpServer)
• Event receivers (src/eventreceiver.ts)
• Kafka integration (src/kafka)
• SQS integration (packages/dbos-sqs)
d) Observability Layer:
• At the top
• OpenTelemetry integration (src/telemetry)
• Logging system
• Tracing system
e) Development Tools:
• As a separate section
• Compiler (packages/dbos-compiler)
• CLI tools (packages/dbos-cloud/cli.ts)
• Testing framework (src/testing)
• Debugger (src/debugger)
Specific Implementation Details
a) Core Runtime:
[HTTP Server] → [Runtime Manager] → [Workflow Engine]
• ↓
• [Transaction Manager] ← [Scheduler]
• ↓
• [Database Abstraction Layer]
b) Database Integration:
[Database Abstraction Layer]
• ↓
[ORM Adapters (Drizzle/Knex/TypeORM/Prisma)]
• ↓
[System DB] [User DB] [FoundationDB]
c) Communication Patterns:
[External Systems] → [Event Receivers]
• ↓
[Kafka/SQS] → [Message Handlers] → [Workflow Engine]
Additional Elements
• Configuration management components
• Security layers (authentication/authorization)
• Error handling and recovery paths
Notes for Implementation
• Keep the core runtime components tightly coupled in the center
• Clear boundaries between different layers
• Durability aspects with recovery paths
• Observability integrations
• Version control and deployment workflows
• Durable execution capabilities
• Built-in observability
• Database integration flexibility
• Serverless deployment options
• Development tooling