This repository contains a demo that simulates an Order Management Transaction System using Volt Active Data. It demonstrates high-concurrency, ACID-compliant transactions leveraging VoltDB's partitioning and in-memory processing.
This demo is structured into three main components:
- Defines the necessary database tables required for the simulation.
- Includes a partitioned stored procedure definition to optimize transaction processing.
The PlaceOrderProcedure is a VoltDB stored procedure responsible for handling order transactions atomically. The procedure performs the following steps in a single transaction:
- Checks stock availability before processing an order.
- Reduces stock count if the order is successful.
- Credits the respective product’s wallet with the order amount.
- Inserts an order record with a timestamp.
- Ensures atomic execution of all these steps to maintain consistency and integrity.
A Java-based client that interacts with VoltDB to simulate real-time order processing at scale. This client:
- Connects to VoltDB to execute transactions.
- Initializes warehouse stock with predefined product data.
- Simulates high-concurrency order placements using multiple threads.
This simulation replicates a warehouse-based e-commerce system where users place orders, and stock updates happen in real time.
-
Initialize VoltDB Client & Product List
- Sets up the connection and loads initial warehouse data.
-
Connect to VoltDB Cluster
- Establishes connections to multiple VoltDB nodes.
-
Initialize Warehouse Database
- Loads product inventory and initializes account balances.
-
Simulate E-commerce Orders
- Runs multiple threads to simulate users placing orders.
- Each order is processed using the
PlaceOrderProcedure, ensuring ACID compliance.
-
Shutdown & Cleanup
- After the simulation runs for a set duration, resources are released, and the client disconnects.
- High-Concurrency Processing – Supports thousands of simultaneous transactions.
- VoltDB Partitioning – Ensures fast and efficient order execution.
- ACID Compliance – Transactions are atomic, consistent, isolated, and durable.
- Scalable & Fault-Tolerant – Can handle large-scale, real-time workloads.
- Java Development Kit (JDK)
- VoltDB Server running on the specified hosts.
- Tables & Stored Procedures: Ensure the required schema and procedure definitions are loaded.
- Compile and run the Java client.
- Ensure the necessary stored procedure is deployed in VoltDB. (You can compile the PlaceOrderProcedure.java file into a jar and then using that jar file you can Load the classes into VoltDB)
- Execute simulated e-commerce transactions.
- Monitor transaction logs and performance metrics.
This demo highlights how VoltDB efficiently handles high-speed, high-concurrency transactions for an e-commerce simulation. 🚀
Feel free to contact me at biplabec18@gmail.com if you want to clarify something on this or know about Volt Active Data in General