github.com/SinghCoder/ShoppingCart-Cloud ↗
Assignment done as part of course Cloud Computing. Implemented a distributed shopping cart system with leaderless replication
An animated visualization of SinghCoder/ShoppingCart-Cloud's Git history from November 2020 to December 2020, built by 3 contributors. The codebase reached 10,647 lines, mostly Python. The video runs 12 seconds.
Render your own repo
Turn any GitHub repository into a video like this — free sample in seconds.
Open this visualization on its own page →
Language
Python
Contributors
3
Lines of Code
10,647
From
2020-11-26
To
2020-12-05
Advertisement
About SinghCoder/ShoppingCart-Cloud
This project implements a distributed shopping cart system built entirely in Python as part of a cloud computing course. It demonstrates key distributed systems concepts including leaderless replication, data partitioning, and eventual consistency. The system consists of database nodes that store shopping cart and product data using TinyDB, a gateway API layer that coordinates requests, and Zookeeper for managing node registration and discovery.
The architecture uses the CRUSH hash function to map products and users to database nodes, with read quorum operations to ensure data consistency across replicas. Version vectors track data versions across nodes, enabling read-repair mechanisms when stale data is detected. The gateway handles all client requests by routing them to the appropriate database nodes based on consistent hashing, then performing read-repair operations to reconcile inconsistencies—for products it takes the minimum quantity across latest versions, while for user carts it takes the maximum quantity per product. Flask provides the REST API endpoints for both the database nodes and the gateway.
The system is containerized using Docker Compose, allowing users to easily scale the number of database nodes. The implementation covers the full lifecycle of distributed data management including product and user creation, cart operations, and consistency guarantees across a leaderless replicated system with eventual consistency semantics.
Advertisement