Assignment 1
Assignment 1
Brief Description
In this assignment, you will develop a distributed application for managing bank accounts using
gRPC and Python. A proto file defining the gRPC service and message structures is provided.
The server will manage account information, while the clients will interact with the server to
perform operations such as account creation, deposits, withdrawals, and interest calculations.
This assignment aims to familiarize you with gRPC, Python, Redis, and handling concurrency in
distributed systems.
Requirements
1. gRPC Server (server.py)
2. Redis Integration
• Use Redis to store and manage account information. Redis will serve as a key-value
store:
o Key: Account ID.
o Value: Account data (e.g., account type, balance).
• Redis should handle the following fields:
o account_id: Unique identifier for each account.
o account_type: Specifies if the account is "savings" or "checking."
o balance: Current balance of the account.
3. Client Application
• Implement a client application in Python that connects to the gRPC server and performs
operations using the RPC methods defined in the proto file.
• The client application should:
o Provide the following functions that interact with the gRPC server:
▪ create_account(account_id: str, account_type: str) -> str:
Creates a new account on the server and returns a confirmation message.
▪ get_balance(account_id: str) -> float: Retrieves the balance for
the specified account ID.
▪ deposit(account_id: str, amount: float) -> str: Deposits the
given amount into the specified account and returns a confirmation
message.
▪ withdraw(account_id: str, amount: float) -> str: Withdraws the
given amount from the specified account and returns a confirmation
message.
▪ calculate_interest(account_id: str, annual_interest_rate:
float) -> str: Applies the specified annual interest rate to the account
balance and returns a confirmation message.
4. Concurrency Handling
5. Error Handling