This is my university project and there is no guarantee to the quality of the system, please use for learning purpose only 🎓!
ThunderExchange is an exchange system build with mainstream technologies such as Spring cloud, Vertx, Disruptor etc. It features a gateway module which serves as the HTTP server for the front-end, a order collector and maching core which sits in a centralized location such as a colocation centre.
The system consists of two parts, the regional part is spread across the globe and function as a regional gateway to accept orders that are nearest to client location, the colocation part is where the exchange sits.
This two part design guarantees scalability, reliability and high performance in the following way:
- 👪 Scalability : To handle more client, just add more gateways and order collectors.
- 🍼 Reliability: Traffic surge resistance and very little service down-time enabled by RAFT mechanism.
- 🚀 High performance: Lockless multithreading with native thread-safe data structure provides blazing fast😻 order matching.
The System consists of 5 main parts, namely: App Service , Socket GateWay , Order Queue, Matching Engine and Publisher. Each of them serve a distinct function, with carefullly decoupled communications, they enable scability and high performance.
Build with Spring framework, which is a popular Java application framework. It provides a comprehensive set of features for building applications, including a lightweight container, support for dependency injection, and tools for managing transactions and data access. Spring makes it easy to create complex, enterprise-grade applications that are modular, reusable, and easy to test.
The App Service module handles request from Frontend through REST protocol, this includes accounting functions such as query account balance, trading functions such as placing orders, view positions etc. More importantly, it serve as a consumer of MQTT for trades that have been published by the publisher module.