This project explores the implementation of a client-centric consistency model within a distributed banking application, using FastAPI as the backbone for our system. By focusing on the principles of remote procedure calls, logical clocks, and client-centric consistency, we aim to ensure that all read and write operations performed by a customer across different branch processes are accurately tracked and synchronized.
- Client-Centric Consistency: Ensures that a customer's write operations in one branch are immediately visible to their subsequent read operations, regardless of the branch.
- Distributed Transactions: Allows customers to perform banking transactions like deposits and withdrawals across multiple branches while maintaining data integrity and consistency.
- Dynamic Interaction: Customers can interact with any branch, performing operations that reflect in real-time across the system.
The application provides a seamless banking experience for customers, utilizing distributed system concepts to maintain consistency across multiple branches. Whether depositing money at one branch or querying their balance at another, the system guarantees that the customer's view is always up-to-date and consistent with their actions.
This project represents a significant step forward in the practical application of distributed systems concepts to solve real-world challenges in the financial sector.
Installation Steps:
- Install Python 3.11.X
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt update
$ sudo apt install python3
To verify the installation
$ python3 --version
- Install Python Package manager
$ sudo apt install python3-pip
- Install Python virtual environment and activate it
$ sudo apt install python3-virtualenv
$ virtualenv venv
$ source venv/bin/activate
> (venv) user@user: ~path
$ python -m pip install --upgrade pip
-
Install requirements
- After activating your virtual environment run the following commands
$ pip3 install -r requirements.txt
-
Run the script using from file
main.py
$ python3 main.py <file_path>
Example:
$ python3 main.py input.json
This starts the server and all the Branch and Customer objects are instantiated with the data provided in
input.json
and the processes are started. -
Results are stored
- Customer outputs →
customer_outputs.json
- Branch outputs →
branch_outputs.json
- Event outputs →
event_outputs.json
- Customer outputs →
-
Customer processes debug logs are stored in
customerDebug.txt
-
Branch processes debug logs are stored in
branchDebug.txt