No description
Find a file
2025-10-14 10:32:40 -05:00
bank1 Tools to build Sqlite3 dbs 2025-10-09 20:31:43 -05:00
bank2 Vbank fully able to credit and debit 2025-10-09 18:23:36 -05:00
client Add test cases 2025-10-10 17:43:14 -05:00
shared feat: get acct balance 2025-10-10 17:28:42 -05:00
tools Improve Makefile 2025-10-09 22:47:07 -05:00
vbank feat: get acct balance 2025-10-10 17:28:42 -05:00
.gitignore Update .gitignore 2025-10-09 18:32:52 -05:00
Makefile Add test cases 2025-10-10 17:43:14 -05:00
README.md Update README.md 2025-10-14 10:32:40 -05:00
test_cases.sh Add test cases 2025-10-10 17:43:14 -05:00

Note to Readers

This project was a class assignment for CSC-4770 Distributed Systems and Cloud Computing. It was assigned on Oct 1 and due on Oct 10, 2025. This was hell. Please don't copy this verbatum and submit if you're working on this too.

Distributed Banking System Assignment

Introduction

In this lab, students will design and implement middleware for a distributed banking system using Remote Procedure Calls (RPC). The goal is to simulate a virtual banking environment where clients interact with multiple bank services through a unified interface.

Learning Objective

  • Understand the principles of RPC in distributed systems.
  • Design middleware that integrates multiple services.
  • Implement client-server communication using RPC.
  • Use SQLite3 for persistent storage in distributed services.

Project Overview

You will implement a distributed banking system with the following architecture:

image
  • A client can perform operations: credit, debit, and transfer.  Client use RPC to communication with the middleware.
  • A virtual bank middleware maps account numbers to banks and delegates operations to the correct bank.  Middleware acts as an RPC server to accept service calls from the client, and acts and an RPC client to request services from the bank.
  • BANK1 and BANK2 are individual RPC servers managing their own accounts.
image

Note that for the purposes of this assignment, the Bank should never let an account go negative. In such a case, the bank should return an error value indicating that the transfer, credit, or debit is not allowed.

Platform

  • Use the Course provided Debian VM (VirtualBox version for Intel users, UTM version for Apple Silicon users).

  • Install RPC tools: sudo apt-get install rpcbind\

  • Install SQLite3:\

    sudo apt install sqlite3
    sudo apt install libsqlite3-dev
    
  • A tutorial for programming SQLite3 in C++ follows: [sqlite3 tutorial{rel="noopener" target="_blank"}[]{.panorama-alternative-formats-button-container title="Alternative Formats for sqlite3_tutorial.html" style="width: 20px !important; height: 20px !important; margin-left: 5px;"}]{.pano-wrapper-div style="line-height: 1.9;" accessibility_injected="true"}

    ::: {.panorama-alternative-formats-button tabindex="0" role="button" panorama-document-type="file" style="width: 20px; height: 20px;" aria-label="Alternative Formats for sqlite3_tutorial.html"} :::

  • A tutorial for programming RPC in C++ follows: [rpc tutorial{rel="noopener" target="_blank"}[]{.panorama-alternative-formats-button-container title="Alternative Formats for rpc_tutorial.html" style="width: 20px !important; height: 20px !important; margin-left: 5px;"}]{.pano-wrapper-div style="line-height: 1.9;" accessibility_injected="true"}

    ::: {.panorama-alternative-formats-button tabindex="0" role="button" panorama-document-type="file" style="width: 20px; height: 20px;" aria-label="Alternative Formats for rpc_tutorial.html"} :::

Requirements

  • Implement all services in C/C++.
  • Use SQLite3 for persistent account storage.
  • The client reads commands from standard input.
  • Include a Makefile with the following targets:
    • all: builds client, virtual bank, BANK1, and BANK2.

    • clean: delete all generated file

    • test: initializes databases, runs services, and performs test operations:\

      credit A12345 100
      credit B12345 100
      transfer A12345 B12345 25
      transfer B12345 A12345 10
      transfer B12345 A12345 120
                          
      

      After tests, print contents of BANK1 and BANK2 databases using SQLite3 CLI.

Timeline

  • Estimated Effort: 6--8 hours

Rubric


Criteria Points Correct implementation of RPC services 30 Middleware logic and account mapping 20 SQLite3 integration and persistence 20 Makefile and test automation 15 Code quality and documentation 10 Proper client interaction 5 Total 100


Submission Procedure

Submit a single compressed archive (zip, 7z, or tar.gz) named:

yourMoodleId_a2.zip

Upload it to the iLearn dropbox associated with this assignment.  When the professor decompresses your submission on on his computer, it should create a directory call yourMoodleId_a2 with all of you source code in it.  Your source code will include the Makefile.