Git Product home page Git Product logo

cu-dist-sys's Introduction

Directory structure:

$ tree -I data
 .
└── ass1
    ├── README.md
    ├── buyer
    │   ├── Dockerfile
    │   ├── __init__.py
    │   ├── client_buyer.py
    │   ├── server_buyer.py
    │   └── server_buyer_helper.py
    │   └── sessions_manager.py
    |
    ├── docker-compose.yaml
    ├── init_dbs.sh
    ├── postgres
    │   ├── __init__.py
    │   ├── credentials.json
    │   ├── customer_database.py
    │   └── product_database.py
    ├── seller
    │   ├── Dockerfile
    │   ├── __init__.py
    │   ├── client_seller.py
    │   ├── server_buyer.py
    │   ├── server_buyer_helper.py
    │   └── server_seller.py
    │   └── sessions_manager.py
    ├── sql
    │   ├── init_customer.sql
    │   └── init_product.sql
    └── todo.md   

Instructions to run:

pip install zeep spyne lxml pytz protobuf grpcio grpcio-tools prettytable psycopg2-binary  --break-system-package
sudo apt install git python3 python3-pip docker.io
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
  • docker-compose up to get postgresql up and running. init_customer and init_product scripts are run on startup(check docker-compose.yaml) The system comprises of 6 components:
  • Buyer server: Go to the parent of the directory and run: python -m buyer.server_buyer
  • Seller server: Go to the parent of the directory and run: python -m seller.server_seller
  • Buyer client: Go to the buyer directory and run: python client_buyer.client_buyer.py
  • Seller client: Go to the buyer directory and run: python seller_buyer.seller_buyer.py
  • Customer Database: Go to the buyer directory and run: python customer_database.server.py
  • Product Database: Go to the buyer directory and run: python product_database.server.py

System Design - The 6 components are running on separate servers to simulate a distributed systems environment. The code is written in python. REST API is implemented for communicating between the client and the server. gRPC is implemented for communication between server and database. PostgreSQL is implemented for the database backend. The server uses SOAP to communicate with the financial transcations. The servers and the databases are hosted on the GCPcloud.Also the client side is stateless frontend design, where state information is maintained in the backend databases.

Current State of the System - All the APIs for seller and buyer are working as stated in this assignment. The Finance transaction is operational right now. It also includes the purchases API done by the buyer to purchase items from the saved cart.

Assumptions - The password for client and seller is plain text. Currently no security measures are taken like authentication mechanisms to ensure secure transfer of data between the client and the server. None of the data is stored on the server as cache. Therefore if the database stops responding, the server will not recvieve any data to process client's request and the entire system will crash.

cu-dist-sys's People

Contributors

shriprajwalk avatar son0fposeidon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.