microsoft / microsoft/rayfin

Support Multi-Statement Transactions with Commit/Rollback

Open
#54 0 comments 0 reactions 1 assignee View on GitHub

@bczulauf is already working on this.

Since Jul 29, 2026.

enhancement issue-mapped triaged
Dominant language
No language data
Stars
610
Forks
62
Avg merge
1d 23h
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.