Skip to content

Support Multi-Statement Transactions with Commit/Rollback #54

Description

@mesgar

Problem statement

Rayfin applications often need to perform multiple related database operations as a single business transaction.

Currently, the SDK provides convenient CRUD operations, but there does not appear to be a way to explicitly control transactional boundaries across multiple create/update/delete operations.

This becomes a challenge for enterprise applications such as inventory management, order processing, manufacturing execution systems, financial workflows, and approval systems, where multiple records must either succeed together or fail together.

For example:

  • Create Order Header
  • Create Order Lines
  • Update Inventory Quantity

If one operation fails after previous operations have already been committed, the application can be left in an inconsistent state.

Many enterprise developers evaluating Rayfin for line-of-business applications expect ACID transactional behavior and explicit transaction management capabilities for critical business operations.

Proposed solution

Add first-class transaction support to the Rayfin SDK and runtime.

Example API:

ts
await client.transaction(async (tx) => {
    await tx.data.Order.create(order);
    await tx.data.OrderLine.createMany(lines);
    await tx.data.Inventory.update(itemId, update);
});

Thank you for considering this enhancement. Transaction support would be a key capability for broader enterprise adoption of Rayfin.

Alternatives considered

We considered implementing compensation logic at the application layer and manually handling failures across multiple SDK operations.

However, this approach is complex, error-prone, and shifts transactional consistency responsibilities to every application developer.

Another option is to bypass Rayfin and execute direct SQL transactions against the underlying database. While this may be possible in some scenarios, it reduces the value of the SDK abstraction and creates inconsistencies between application implementations.

Native transaction support in the Rayfin SDK would provide a standardized and reliable solution for all developers.

Additional context

Rayfin is positioned as a platform for building enterprise applications that combine transactional and analytical workloads.

Many business applications require ACID-compliant operations across multiple entities, including:

  • Inventory management
  • Manufacturing execution systems (MES)
  • Order processing
  • Procurement workflows
  • Financial approvals
  • Asset management

Without explicit transaction support, developers may be reluctant to use Rayfin for mission-critical business processes where data consistency is a fundamental requirement.

This feature would significantly improve confidence in adopting Rayfin for enterprise-grade line-of-business applications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions