{"id":15127500,"url":"https://github.com/rahul-dhar-e5609/scaling-web-app","last_synced_at":"2026-01-19T05:32:39.236Z","repository":{"id":133262052,"uuid":"184304529","full_name":"rahul-dhar-e5609/scaling-web-app","owner":"rahul-dhar-e5609","description":"A repository for learning how to scale a web application, concentrates over using docker containers over a bridge network for application instances that are being load balanced using the Round Robin algorithm. The application instances interact with a data service and a logging service that run in their separate containers. ","archived":false,"fork":false,"pushed_at":"2019-05-25T20:24:01.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T19:18:40.375Z","etag":null,"topics":["container","docker","dockerfile","go","golang","load-balancer","microservice"],"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/rahul-dhar-e5609.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":"2019-04-30T17:31:44.000Z","updated_at":"2022-01-09T19:26:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"fffc059a-ca92-4fbf-afc7-6bb7ebba11a3","html_url":"https://github.com/rahul-dhar-e5609/scaling-web-app","commit_stats":null,"previous_names":["iamrdhar/scaling-web-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rahul-dhar-e5609/scaling-web-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-dhar-e5609%2Fscaling-web-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-dhar-e5609%2Fscaling-web-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-dhar-e5609%2Fscaling-web-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-dhar-e5609%2Fscaling-web-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahul-dhar-e5609","download_url":"https://codeload.github.com/rahul-dhar-e5609/scaling-web-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-dhar-e5609%2Fscaling-web-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28561858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["container","docker","dockerfile","go","golang","load-balancer","microservice"],"created_at":"2024-09-26T02:04:36.128Z","updated_at":"2026-01-19T05:32:39.221Z","avatar_url":"https://github.com/rahul-dhar-e5609.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scaling a web app\n\nA repository for learning how to scale a web application, concentrates over using docker containers over a bridge network for application instances that are being load balanced using the Round Robin algorithm. The application instances interact with a data service and a logging service that run in their separate containers. \n\n## Installation\n### Create subnet\n\u003e Subnet makes service discovery easier, as all the microservices are gonna run on this subnet, and it will be easier to manually assign ip addresses.\n- `docker network create --subnet=172.18.0.0/16 scalenet`\n\n### Building image for the dataservice\n- `docker build -f .docker/dataservice.dockerfile -t scale/dataservice .`\n\n### Building image for the loadbalancer\n- `docker build -f .docker/loadbalancer.dockerfile -t scale/loadbalancer .`\n\n### Building image for cache service\n- `docker build -f .docker/cacheservice.dockerfile -t scale/cacheservice .`\n\n### Building image for log service\n- `docker build -f .docker/logservice.dockerfile -t scale/logservice .`\n\n### Building image for web backend\n- `docker build -f .docker/web.dockerfile -t scale/web .`\n\n### Create containers\n- Containers:\n    ```\n    docker run --name dataservice --ip=172.18.0.10 --net=scalenet -p 4000:4000 --rm -it -d scale/dataservice\n    docker run --name loadbalancer --ip=172.18.0.12 --net=scalenet -p 2000:2000 --rm -it -d scale/loadbalancer\n    docker run --name cacheservice --ip=172.18.0.13 --net=scalenet -p 5000:5000 --rm -it scale/cacheservice\n    docker run --name logservice --ip=172.18.0.14 --net=scalenet -p 6000:6000 --rm -it -v /Users/rahuldhar/log:/log scale/logservice\n    docker run --net=scalenet --ip=172.18.0.2 -p3000:3000 --name webtest --rm -it scale/web --dataservice=https://172.18.0.10:4000 --loadbalancer=https://172.18.0.12:2001 --cachingservice=https://172.18.0.13:5000 --logservice=https://172.18.0.14:6000\n    ```\n- Check that both the containers are up and running using the below-mentioned commands:\n    ```\n    docker ps\n    docker network inspect scalenet\n    ```\n\u003e   The docker network inspect command should show both the containers in the Containers object of the configuration, see the eg below\n- An output for docker network inspect scalenet\n    ```\n    Rahuls-MacBook-Pro:scaling-web-app rahuldhar$ docker network inspect scalenet\n    [\n        {\n            \"Name\": \"scalenet\",\n            \"Id\": \"01f8a6ee533b66b0775b4ad6fb99c825dbafd8aba963459d00fb835940ae9eab\",\n            \"Created\": \"2019-04-30T19:45:53.380381186Z\",\n            \"Scope\": \"local\",\n            \"Driver\": \"bridge\",\n            \"EnableIPv6\": false,\n            \"IPAM\": {\n                \"Driver\": \"default\",\n                \"Options\": {},\n                \"Config\": [\n                    {\n                        \"Subnet\": \"172.18.0.0/16\",\n                        \"Gateway\": \"172.18.0.1\"\n                    }\n                ]\n            },\n            \"Internal\": false,\n            \"Attachable\": false,\n            \"Ingress\": false,\n            \"ConfigFrom\": {\n                \"Network\": \"\"\n            },\n            \"ConfigOnly\": false,\n            \"Containers\": {\n                \"a7c1fe39219c3eb41f69ef6965dd8b0911eb69067cc22e8171e30958f47d1cf5\": {\n                    \"Name\": \"dataservice\",\n                    \"EndpointID\": \"e3696f2c570ac122526c94e82fe258faa58d58a2f669e513b3c433c8f2b81df2\",\n                    \"MacAddress\": \"02:42:ac:12:00:0a\",\n                    \"IPv4Address\": \"172.18.0.10/16\",\n                    \"IPv6Address\": \"\"\n                },\n                \"c7bffd2989d8534671005e43f23b9ad45fc2d67d351a6828c12a049bfceacc6d\": {\n                    \"Name\": \"webtest\",\n                    \"EndpointID\": \"000995e02495a6ea1455588af0747a9423bafba6761dddffd7f31513eab1c571\",\n                    \"MacAddress\": \"02:42:ac:12:00:02\",\n                    \"IPv4Address\": \"172.18.0.2/16\",\n                    \"IPv6Address\": \"\"\n                },\n                \"f402bfa13e2491a5de1e08af880c80a59ffd2c4919400cf9c9a841f17202925c\": {\n                    \"Name\": \"loadbalancer\",\n                    \"EndpointID\": \"b8d56b9813d55ddcac5a12853ccd14ba2b911b4c8609537519b1c56d85904f9e\",\n                    \"MacAddress\": \"02:42:ac:12:00:0c\",\n                    \"IPv4Address\": \"172.18.0.12/16\",\n                    \"IPv6Address\": \"\"\n                }\n            },\n            \"Options\": {},\n            \"Labels\": {}\n        }\n    ]\n    ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul-dhar-e5609%2Fscaling-web-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahul-dhar-e5609%2Fscaling-web-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul-dhar-e5609%2Fscaling-web-app/lists"}