{"id":20764000,"url":"https://github.com/umutsevdi/service-discovery","last_synced_at":"2025-09-10T03:33:10.037Z","repository":{"id":112736499,"uuid":"490733082","full_name":"umutsevdi/service-discovery","owner":"umutsevdi","description":"Service Discovery \u0026 Load Balancing service implementation using UDP broadcasting and TCP","archived":false,"fork":false,"pushed_at":"2022-05-22T13:06:24.000Z","size":178443,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T10:50:29.626Z","etag":null,"topics":["broadcast","broadcast-receiver","java","java-socket","java-socket-programming","service-discovery","service-discovery-patterns","tcp-client","tcp-server","udp"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umutsevdi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-05-10T14:28:50.000Z","updated_at":"2025-01-08T14:41:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9c3496f-27c8-4ea7-89ee-6c5122fce658","html_url":"https://github.com/umutsevdi/service-discovery","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/umutsevdi/service-discovery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fservice-discovery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fservice-discovery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fservice-discovery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fservice-discovery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umutsevdi","download_url":"https://codeload.github.com/umutsevdi/service-discovery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fservice-discovery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269922906,"owners_count":24496999,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["broadcast","broadcast-receiver","java","java-socket","java-socket-programming","service-discovery","service-discovery-patterns","tcp-client","tcp-server","udp"],"created_at":"2024-11-17T10:48:17.287Z","updated_at":"2025-08-11T17:07:08.603Z","avatar_url":"https://github.com/umutsevdi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/umutsevdi/service-discovery\"\u003e\n    \u003cimg src=\"doc/assets/computer-networks.png\" alt=\"Logo\" height=\"64\"\u003e\u003c/a\u003e\n\u003ch3 align=\"center\"\u003e Service Discovery and Load Balancing Service\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e Service Discovery \u0026 Load Balancing service implementation using UDP broadcasting and TCP \n  \u003cbr /\u003e\n    \u003ci\u003eDeveloped by \u003ca href=\"https://github.com/umutsevdi\"\u003e Umutcan Sevdi\u003c/a\u003e, \u003ca href=\"https://github.com/ismetgngr\"\u003eİsmet Güngör\u003c/a\u003e, \u003ca href=\"https://github.com/MetinUsta\"\u003eMetin Usta\u003c/a\u003e and \u003ca href=\"https://github.com/emrearslanoglu\"\u003eEmre Arslanoğlu\u003c/a\u003e.\u003c/i\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"doc/AgTeknolojileriServiceDiscovery.pdf\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\u003ca href=\"#project_definition\"\u003eProject Definition\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#system_architecture\"\u003eSystem Architecture\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#structure\"\u003eProject Structure\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#performance\"\u003ePerformance Analysis\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#screenshots\"\u003eScreenshots\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"doc/AgTeknolojileriServiceDiscovery.pdf\"\u003eDocumentation\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"LICENSE\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\u003cp id=\"project_definition\"\u003e\n\n## 1- Project Definition\n\nService providing systems generally start as small-sized projects. However, over\ntime they need methods to scale their systems to keep up with the incoming demand.\nSometimes these scaling mechanisms are improved throughout the lifecycle of the application.\n\nSystems require additional tools and structures for the future to keep providing\nservices. One of these mechanisms is called Service Discovery. When the registry\nhandling and the discovery are done by an additional server, it is called\nserver-side service discovery.\n\nWithin the scope of our project, we will implement a server that combines the Service\nRegistry and the Load Balancer. However, instead of storing service provider addresses\nin a database-like system, we will use UDP broadcasting to discover them.\n\n\u003cp align=\"center\" \u003e\u003cimg src=\"doc/assets/system_architecture.png\"\u003e\u003c/p\u003e\n\n\u003cp id=\"system_architecture\"\u003e\n\n## 2- System Architecture\n\nThe server and the client communicate through TCP. But the communication\nbetween server and service applications are done through UDP.\n\nThe client requests a service using TCP to the server. When the server\nreceives the request sends a UDP broadcast message to all services.\nIf the application services type matches the client's request,\nthey respond to this message with their IP address, port number and a number\ncorresponding to their busyness, using TCP.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"doc/assets/data1.gif\" alt=\"data-animation\" width=512px\u003e\u003c/p\u003e\n\nThe server waits until the timeout and saves all responses during that time.\nAfter the timeout, the server analyzes all responses and selects the best service.\nThen sends its IP and port values to the client.\n\nAfter that, the service application and client communicate directly through TCP.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"doc/assets/data2.gif\" alt=\"data-animation\" width=512px\u003e\u003c/p\u003e\n\n\u003cp id=\"structure\"\u003e\n\n## 3- Structure\n\nThe project includes three applications:\n\n- \u003ca href=\"client/\"\u003eClient\u003c/a\u003e is the application that represents the\n  end-user. It sends the type of service application the user would like to\n  interact with to the server and connects to the best available server.\n  Then client application sends TCP requests to the application servers.\n- \u003ca href=\"server/\"\u003eServer\u003c/a\u003e is the load balancer and the service\n  discoverer. Upon receiving a TCP request from clients, searches given query using\n  UDP broadcast and registers incoming requests. Selects the best available server\n  and returns its address to the client.\n- \u003ca href=\"service/\"\u003eService\u003c/a\u003e is the service application. It represents\n  backend applications in which clients interact. Upon receiving a UDP broadcast\n  from the server, the service's UDP module responds to it with its load.\n  Then it executes application programs for the clients.\n\n```txt\nservice-discovery/\n├── client\n│   └── src\n│       ├── data\n│       │   └── Address.java\n│       └── Main.java\n├── server\n│   └── src\n│       ├── ApplicationServer.java\n│       ├── data\n│       │   ├── Address.java\n│       │   └── ServerResponse.java\n│       ├── exception\n│       │   ├── NoResponseException.java\n│       │   └── TimeoutException.java\n│       ├── Main.java\n│       └── UDPServer.java\n└── service\n    └── src\n        ├── data\n        │   ├── Address.java\n        │   └── UDPRequest.java\n        ├── exception\n        │   └── InvalidRequestException.java\n        ├── executor\n        │   ├── DateTime.java\n        │   ├── DNSLookup.java\n        │   ├── Encryptor.java\n        │   ├── EvaluateExpression.java\n        │   └── Executor.java\n        ├── GenericExecutionServer.java\n        ├── Main.java\n        └── UDPResponseServer.java\n```\n\n\u003cp id=\"performance\"\u003e\n\n## 4- Performance Analysis\n\nIn this section, we examined our system's performance.\n\nIt is hard to determine the efficiency of such a system with arithmetic\ncalculations. Using UDP broadcasting to determine services may look like\nit's creating an overhead. However, it also provides speed since it doesn't\nspend time on database transactions and data synchronizations.\n\nIt will also make adding new servers or removing existing ones easier.\nAdding new services will have little or no effect on the server's architecture.\n\n### 4.1- Alternative Scenerio\n\nWhen the system was initially designed, the server was also responsible for\n the data transfer between the client and the service. Although this creates anonymity\nover service applications, it was also causing an increase in the response time.\n\u003cp align=\"center\"\u003e\u003cimg src=\"doc/assets/arch_alt.jpg\" width=\"768px\"\u003e\u003c/p\u003e\n\n### 4.2- Revised System\n\nIn our system, the server is responsible for both server discovery and load\nbalancing. So adding data transfer would cause heavyweight. To reduce its\nload, we changed the way our system works. When the load balancer detects the\nservices, it returns its address information to the client. Then client\ndirectly connects to those services. This way server can perform data\ntransfers more efficiently.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"doc/assets/arch_final.jpg\" width=\"768px\"\u003e\u003c/p\u003e\n\n\u003cp id=\"screenshots\"\u003e\n\n## 5- Screenshots\n\n- DNS Lookup service running on MacOS.\n\n\u003cimg src=\"doc/assets/macdns.png\" alt=\"application-being-tested-on-macos\"\u003e\n\n- Encryption service running on MacOS.\n\n\u003cimg src=\"doc/assets/macosEncryption.png\" alt=\"application-being-tested-on-macos\"\u003e\n\n\n\u003cp id=\"installation\"\u003e\n\n### 6- Installation\n\n1. Clone the repo\n\n```sh\n   git clone https://github.com/umutsevdi/service-discovery.git\n```\n\n2. Run following command to create Load Balance and Discovery server.\n\n```sh\n    java -jar out/server.jar\n```\n\n3. Run following command on a seperate terminal to run client.\n\n```sh\n    java -jar out/client.jar\n```\n\n4. Run following command on a seperate terminal to execute a service.\n\n```sh\n    java -jar out/service.jar --port 8083 --service DNS_LOOKUP\n```\n\n## 7- Documentation\n\nRead the full documentation from \u003ca href=\"doc/AgTeknolojileriServiceDiscovery.pdf\"\u003ehere\u003c/a\u003e.\n\n## 8- License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003cp id=\"contact\"\u003e\n\n## 9- Contact\n\nYou can contact any developer of this project for any suggestion or information.\n\nProject: [umutsevdi/service-discovery](https://github.com/umutsevdi/service-discovery)\n\n\u003ci\u003eDeveloped by \u003ca href=\"https://github.com/umutsevdi\"\u003e Umutcan Sevdi\u003c/a\u003e, \u003ca href=\"https://github.com/ismetgngr\"\u003eİsmet Güngör\u003c/a\u003e, \u003ca href=\"https://github.com/MetinUsta\"\u003eMetin Usta\u003c/a\u003e and \u003ca href=\"https://github.com/emrearslanoglu\"\u003eEmre Arslanoğlu\u003c/a\u003e.\u003c/i\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumutsevdi%2Fservice-discovery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumutsevdi%2Fservice-discovery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumutsevdi%2Fservice-discovery/lists"}