This project provides a multi-language implementation of the LMAX Disruptor architecture for building high-performance trading platforms. The LMAX architecture is a low-latency, high-throughput system designed for handling millions of trades per second. It is an in-memory, event-sourced system using a pattern known as Disruptor to achieve high concurrency without the need for traditional locks.
**PHP (Laravel): **Full implementation of LMAX architecture. **C# (.NET): **Full implementation of LMAX architecture.
LMAX is a highly efficient architecture, designed to process a high volume of transactions in financial trading systems. The core components include:
- In-memory Business Logic Processor: Handles all business logic in a single-threaded manner for simplicity and speed.
- **Disruptor Pattern: **A high-performance concurrency framework that replaces traditional queues with a lock-free ring buffer.
- Event Sourcing: All changes are captured as a series of events, making the system resilient to failures by replaying events from a durable store.
- In-memory processing: All transactions are processed in memory, reducing I/O overhead and increasing speed.
- Event Sourcing: Ensures system state can always be rebuilt by replaying events.
- Concurrency: Utilizes the Disruptor pattern to handle concurrent tasks without the need for locks.
- Multi-language support: Current implementations in:
- PHP (Laravel)
- C# (.NET)
/Laravel-PHP: Contains the LMAX implementation using the Laravel framework in PHP. /.NET-C#: Contains the LMAX implementation using .NET in C#.
Each language folder contains its own implementation, including the core architecture and a sample application demonstrating how LMAX can be used for handling high-frequency transactions.
- Clone the repository.
- Navigate to the /Laravel-PHP
- Install the dependencies:
composer install
4.Configure your .env file. 5.Run the migrations: php artisan migrate
php artisan migrate
6.Run the application:
php artisan serve
- Clone the repository.
- Navigate to the csharp-dotnet/ directory.
- Restore the dependencies:
dotnet restore
4.Build and run the application:
dotnet run
If you’d like to contribute to this project, please feel free to submit a pull request or open an issue.