---
title: "Transactions"
---

# Transactions

Full ACID-compliant transaction support with distributed capabilities.

## Overview

HeliosDB provides comprehensive transaction support including:
- Full ACID compliance
- Multiple isolation levels
- Distributed transactions with 2PC
- Savepoints and nested transactions
- XA transaction support

## Quick Start

```sql
-- Basic transaction
BEGIN;
  UPDATE accounts SET balance = balance - 100 WHERE id = 1;
  UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;

-- With savepoints
BEGIN;
  INSERT INTO orders (customer_id, total) VALUES (1, 500);
  SAVEPOINT before_items;
  INSERT INTO order_items (order_id, product_id) VALUES (1, 100);
  -- Rollback to savepoint if needed
  ROLLBACK TO SAVEPOINT before_items;
COMMIT;

-- Serializable isolation
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
  -- Conflicts automatically detected
COMMIT;
```

## Isolation Levels

| Level | Description | Performance |
|-------|-------------|-------------|
| READ UNCOMMITTED | Dirty reads allowed | Fastest |
| READ COMMITTED | Default, no dirty reads | Fast |
| REPEATABLE READ | Snapshot isolation | Good |
| SERIALIZABLE | Full serializability | Safe |

## Features

| Feature | Description |
|---------|-------------|
| **Savepoints** | Partial rollback within transaction |
| **Distributed 2PC** | Two-phase commit across nodes |
| **XA Transactions** | External transaction coordinator support |
| **Deadlock Detection** | Automatic deadlock resolution |
| **Lock-Free MVCC** | High concurrency without blocking |

## Related

- **MVCC**: `/docs/features/mvcc/`
- **Deadlock Prevention**: `/docs/guides/user/DEADLOCK_PREVENTION_OPERATIONS_GUIDE.md`

---
