All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2025-12-02
Added
Core Features
- Initial implementation of TCC (Try-Confirm-Cancel) protocol
TCCmodule with pipe-friendly APITCC.Transactionmodule for transaction coordinationTCC.Actionmodule for individual action execution- Support for three-phase transactions: Try, Confirm, Cancel
- Automatic rollback on Try phase failures
- Sequential execution of Try and Confirm phases
- Reverse-order execution of Cancel phase (LIFO)
Reliability Features
- Automatic retry logic for Confirm and Cancel phases with exponential backoff
- Configurable timeout per transaction and per action
- Configurable retry limits (default: 3 retries)
- Idempotency support through retry mechanism
- Effects accumulator for tracking transaction state
Observability
- Telemetry integration with events:
[:tcc, :transaction, :start]- Transaction started[:tcc, :transaction, :stop]- Transaction completed[:tcc, :action, :start]- Action phase started[:tcc, :action, :stop]- Action phase completed[:tcc, :action, :exception]- Action phase exception
- Comprehensive metadata for all telemetry events
- Transaction ID generation for tracking
API
TCC.new/1- Create new transaction with optionsTCC.run/5- Add action to transactionTCC.run_with_opts/6- Add action with custom optionsTCC.execute/2- Execute transaction synchronouslyTCC.async_execute/2- Execute transaction asynchronouslyTCC.actions/1- Get list of actions in transactionTCC.options/1- Get transaction options
Configuration Options
:timeout- Maximum time for entire transaction (default: 30_000ms):retry_limit- Number of retries for confirm/cancel (default: 3):async- Async execution mode (default: false):telemetry_prefix- Custom telemetry event prefix (default:[:tcc])
Documentation
- Comprehensive README with usage examples
- Quick Start Guide (QUICKSTART.md)
- Architecture documentation (ARCHITECTURE.md)
- API documentation with @moduledoc and @doc
- Doctests for core functionality
Examples
examples/simple_transfer.ex- Money transfer between accounts with in-memory databaseexamples/e_commerce.ex- Complete e-commerce order processing:- Payment service with reservation and confirmation
- Inventory management
- Shipping arrangement
examples/demo.exs- Interactive demo script
Testing
- Comprehensive test suite with ExUnit
- Unit tests for TCC, Transaction, and Action modules
- Integration tests for complete transaction flows
- Test coverage for:
- Successful transactions
- Failed transactions with rollback
- Effects accumulation
- Retry logic
- Concurrent execution
- Custom options
Technical Details
Dependencies
telemetry ~> 1.0- For observabilityex_doc ~> 0.29- For documentation generation (dev only)
Inspired By
- Apache Seata's TCC mode for protocol design
- Sage library for API design patterns
- Industry best practices for distributed transactions
Known Limitations
- Sequential execution only (no parallel Try operations)
- No persistent transaction log (in-memory only)
- No distributed coordinator (local transactions only)
- No automatic timeout deadline enforcement across all actions
Breaking Changes
- N/A (initial release)
Deprecated
- N/A (initial release)
Security
- No known security issues
- Timeout limits prevent resource exhaustion
- No sensitive data logged in telemetry by default
[Unreleased]
Planned Features
- Parallel execution of independent Try operations
- Persistent transaction log for audit and recovery
- Distributed transaction coordinator support
- Saga pattern integration
- Circuit breaker integration
- Transaction visualization tools
- Enhanced error recovery mechanisms
- Automatic deadline management
- Performance benchmarks