{"id":19014217,"url":"https://github.com/rui-exe/cloud-shopping-list","last_synced_at":"2025-07-19T11:02:49.494Z","repository":{"id":212720468,"uuid":"704418957","full_name":"rui-exe/Cloud-Shopping-List","owner":"rui-exe","description":"High availability distributed system for a cloud-based shopping list application, using CRDTs and consistent hashing.","archived":false,"fork":false,"pushed_at":"2023-12-10T23:45:28.000Z","size":25685,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-08T19:34:00.646Z","etag":null,"topics":["cloud","consistent-hash-algorithm","consistent-hashing","crdt","crdts","distributed-systems","go","golang","high-availability","load-balancer"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rui-exe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-13T08:08:52.000Z","updated_at":"2024-05-14T15:50:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"3954a5a1-3d49-423a-91e2-efab865a91af","html_url":"https://github.com/rui-exe/Cloud-Shopping-List","commit_stats":null,"previous_names":["rui-exe/cloud-shopping-list"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rui-exe%2FCloud-Shopping-List","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rui-exe%2FCloud-Shopping-List/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rui-exe%2FCloud-Shopping-List/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rui-exe%2FCloud-Shopping-List/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rui-exe","download_url":"https://codeload.github.com/rui-exe/Cloud-Shopping-List/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232131331,"owners_count":18476942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","consistent-hash-algorithm","consistent-hashing","crdt","crdts","distributed-systems","go","golang","high-availability","load-balancer"],"created_at":"2024-11-08T19:28:24.541Z","updated_at":"2025-01-01T22:24:42.272Z","avatar_url":"https://github.com/rui-exe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloud Shopping List - Distributed Systems Project\n\n## SyncShopSquad\n\n### Overview\n\nThis project, implemented by the SyncShopSquad team, focuses on building a distributed system for a cloud-based shopping list application. \n\n### Components\n\n#### 1. Consistent Hashing Implementation (`consistent.go`)\n\n- Defines a `Ring` structure for consistent hashing.\n- Contains a `Node` structure representing a server/node in the ring.\n- Provides methods for adding nodes to the ring, getting a node for a given key, putting an item in the ring, and printing the nodes.\n- Implements virtual nodes to improve load balancing.\n- Data is replicated on the next two nodes in the ring to improve fault tolerance.\n\n#### 2. Load Balancer (`load_balancer.go`)\n\n- Implements a basic load balancer using the consistent hashing ring from `consistent.go`.\n- Defines a `LoadBalancer` structure that contains an instance of the `Ring`.\n- Provides methods for adding nodes to the ring and handling HTTP connections for both nodes and shopping list operations.\n- Starts an HTTP server for the load balancer on port 8080.\n\n#### 3. Server (`server.go`)\n\n- Represents a simple server that connects to the load balancer.\n- Generates a random node UUID and connects to the load balancer with retries.\n- Handles incoming HTTP messages, specifically for shopping list operations.\n- Stores the shopping list on its own database.\n\n### Running the System\n\nBefore running the system, make sure you have Go installed on your machine. You can download Go [here](https://golang.org/dl/).\nChange your working directory to the `src` folder.\n\n1. **Start the Load Balancer:**\n    - Execute `go run load_balancer.go` to start the load balancer on port 8080.\n\n2. **Start Servers:**\n    - Execute `go run server.go \u003cport\u003e \u003cname\u003e` to start a server on the specified port with the specified name.\n\n3. **Connect Servers to Load Balancer:**\n    - Servers automatically connect to the load balancer with retries.\n4. **Start Client:**\n    - Execute `go run client.go` to start the client.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frui-exe%2Fcloud-shopping-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frui-exe%2Fcloud-shopping-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frui-exe%2Fcloud-shopping-list/lists"}