Skip to content

Latest commit

 

History

History
104 lines (78 loc) · 3.75 KB

README.md

File metadata and controls

104 lines (78 loc) · 3.75 KB

Awesome Accord: ACID Transactions in Apache Cassandra

Welcome to the Awesome Accord repository! This guide provides resources and examples for implementing ACID transactions in Apache Cassandra. Learn how to leverage distributed transactions for building reliable applications.

What's Inside

  • Quick Start with Docker: Single-node deployment for immediate testing
  • Lab Environment: Multi-node cluster setup for development
  • Use Cases & Examples: Production-ready implementations
  • Learning Resources: Documentation and best practices

⚠️ Warning and Disclaimer ⚠️

Accord is in active development and still a feature branch in the Apasche Cassandra® Repo. You will find bug. What we ask is that you help with a contribution of a bug report.

You can use the Github discussions bug report forum for this or use the Planet Cassandra Discord channel for accord listed below. A bug report should have the folowing:

  • The data model used
  • Actions to reproduce the bug
  • Full stack trace from system.log

If you have suggestions about syntax or improving the overall developer expirience, we want to hear about that to! Add it as a suggestion or feature request using Github discussions or let us know in the Planet Cassandra Discord.

Now, on to the fun!

Quick Start Options

Option 1: Docker (Single Node)

docker pull pmcfadin/cassandra-accord
docker run -d --name cassandra-accord -p 9042:9042 pmcfadin/cassandra-accord

Option 2: Multi-Node Lab Environment

brew tap rustyrazorblade/rustyrazorblade
brew install easy-cass-lab

Featured Use Cases

  • Banking Transactions: Account transfers with ACID guarantees
  • Inventory Management: Race-free inventory tracking
  • User Management: Multi-table atomic operations

Community

Repository Structure

/
├── docker/              # Docker configuration and setup
├── easy-cass-lab/      # Multi-node testing environment
├── examples/           # Implementation examples
│   ├── banking/       # Financial transaction examples
│   ├── inventory/     # Stock management examples
│   └── user-mgmt/     # User operations examples
└── docs/              # Guides and documentation

Documentation

Our documentation includes:

  • Comprehensive setup instructions
  • Transaction patterns and implementations
  • Performance optimization guides
  • Troubleshooting and best practices

Getting Started

  1. Choose your deployment option:
  2. Follow the Quick Start Guide
  3. Explore example implementations
  4. Connect with our Discord community
  5. Feedback! Github Discussions

Example Code

BEGIN TRANSACTION
    LET fromBalance = (SELECT account_balance 
                      FROM ks.accounts 
                      WHERE account_holder='alice');
    
    IF fromBalance.account_balance >= 20 THEN
        UPDATE ks.accounts 
        SET account_balance -= 20 
        WHERE account_holder='alice';
        
        UPDATE ks.accounts 
        SET account_balance += 20 
        WHERE account_holder='bob';
    END IF
COMMIT TRANSACTION;

License

Apache License 2.0