{"id":22814461,"url":"https://github.com/aditya43/grpc","last_synced_at":"2026-04-18T01:02:48.313Z","repository":{"id":114670251,"uuid":"372792673","full_name":"aditya43/grpc","owner":"aditya43","description":"gRPC using Golang | My personal notes, projects and best practices.","archived":false,"fork":false,"pushed_at":"2021-07-07T07:20:53.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-23T10:53:44.508Z","etag":null,"topics":["api","crud","golang","grpc","grpc-go","mongodb","protobuf","rpc-framework"],"latest_commit_sha":null,"homepage":"","language":"Go","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/aditya43.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}},"created_at":"2021-06-01T10:38:36.000Z","updated_at":"2021-07-07T07:20:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b3d4e75-1f5a-480d-b70b-4a408324ed69","html_url":"https://github.com/aditya43/grpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aditya43/grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya43%2Fgrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya43%2Fgrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya43%2Fgrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya43%2Fgrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aditya43","download_url":"https://codeload.github.com/aditya43/grpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aditya43%2Fgrpc/sbom","scorecard":{"id":166640,"data":{"date":"2025-08-11","repo":{"name":"github.com/aditya43/grpc","commit":"abe25071a1348bad8d87f0ddb50abc2165c851f5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GO-2023-2153 / GHSA-m425-mq94-257g / GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T15:06:33.168Z","repository_id":114670251,"created_at":"2025-08-16T15:06:33.168Z","updated_at":"2025-08-16T15:06:33.168Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31952208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"ssl_error","status_checked_at":"2026-04-18T00:39:20.671Z","response_time":62,"last_error":"SSL_read: 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":["api","crud","golang","grpc","grpc-go","mongodb","protobuf","rpc-framework"],"created_at":"2024-12-12T13:09:00.535Z","updated_at":"2026-04-18T01:02:48.289Z","avatar_url":"https://github.com/aditya43.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPC Using Golang\nMy personal notes, projects and best practices.\n\n## Author\nAditya Hajare ([Linkedin](https://in.linkedin.com/in/aditya-hajare)).\n\n## Current Status\nWIP (Work In Progress)!\n\n## License\nOpen-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).\n\n-----------\n\n## What is gRPC?\n- gRPC is a free and open source framework developed by Google, Square and other companies.\n- gRPC is part of the Cloud Native Computation Foundation (CNCF). - like Docker and Kubernetes for example.\n- At a high level, gRPC allows us to define REQUEST and RESPONSE for RPC (Remote Procedure Calls) and handles all the rest for us.\n- gRPC is modern, fast and efficient, built on top of HTTP/2, low latency, supports streaming, language independent, and makes it super easy to plug in authentication, load balancing, logging and monitoring.\n- RPC is not a new concept (CORBA had this before).\n- With gRPC, RPC is implemented very cleanly and solves a lot of problems.\n- At the core of gRPC, we need to define messages and services using `Protocol Buffers`.\n- The rest of the gRPC code will be generated for us and we will have to provide an implementation for it.\n- One `.proto` file works for over 12 programming languages (server and client), and allows us to use a framework that scales to millions of RPC per second.\n\n-----------\n\n## Why Protocol Buffers over JSON:\n- gRPC uses Protocol Buffers for communication.\n- Payload size comparison: Protocol Buffers vs. JSON:\n```json\n// 55 bytes\n{\n    \"age\": 35,\n    \"first_name\": \"Aditya\",\n    \"last_name\": \"Hajare\"\n}\n```\n```proto\n// 20 bytes\nmessage Person {\n    int32 age = 1;\n    string first_name = 2;\n    string last_name = 3;\n}\n```\n- Looking at above comparison, we save in network bandwidth.\n- Parsing JSON is actually CPU intensive (because the format is Human Readable).\n- Parsing Protocol Buffers (Binary Format) is less CPU intensive because it's closer to how machine represents data.\n\n-----------\n\n## HTTP 2:\n- gRPC leverages HTTP/2 as a backbone for communication.\n- HTTP 1.1 opens a new TCP connection to a server for each request.\n- HTTP 1.1 does not compress headers (Headers are plaintext).\n- HTTP 1.1 only works with Request/Response mechanism (No server push).\n- HTTP 1.1 was originally composed of 2 commands:\n    * GET: to ask for content.\n    * POST: to send content.\n- HTTP 2 was released in 2015. It has been battle tested for many years. (And was before that tested by Google under the name SPDY).\n- HTTP 2 supports `multiplexing`:\n    * The client and server can push messages in parallel over the same TCP connection.\n    * This will greatly reduce latency.\n- HTTP 2 supports `server push`:\n    * Server can push streams (multiple messages) for one request from the client.\n    * This saves lot of round trips (latency).\n- HTTP 2 supports `headers compression`.\n- HTTP 2 is binary.\n- HTTP 2 is secure (SSL is not required but recommended by default).\n\n-----------\n\n## Types of APIs in gRPC:\n- **Unary API**: Classic Request/Response API.\n- **Server Streaming API**: Client will send `one` message to the server and will receive `many` responses from the server, possibly an infinite number.\n    * `Streaming Server API` are well suited for when the server needs to send a lot of data (big data).\n    * We can use `Streaming Server API` when the server needs to `PUSH` data to the client without having client `REQUEST` for the more. For e.g. Live Feed, Chat etc..\n- **Client Streaming API**: Client sends multiple chunks to server as in stream of requests and server responds with a single response.\n    * Thanks to HTTP/2.\n    * `Streaming Client API` is well suited when the client needs to send lot of data (big data).\n    * We can use `Streaming Client API` when the server processing is expensive and should happen as the client sends data.\n    * It is also useful when client needs to **PUSH** data to the server without really expecting a response.\n    * In gRPC, Client streaming calls are defined using the keywork `stream`.\n- **Bi-Directional Streaming API**: Client and server both sends and receives request/response chunks in stream.\n    * Thanks to HTTP/2.\n    * `Bi-Directional Streaming` is useful when the Client and Server needs to send a lot of data asynchronously.\n    * Also useful for implementing **Chat** protocol.\n    * They are also good for implementing long running connections.\n```proto\nservice GreetService {\n    // Unary API\n    rpc Greet(GreetRequest) returns (GreetResponse) {};\n\n    // Streaming Server API\n    rpc GreetManyTimes(GreetManyTimesRequest) returns (stream GreetManyTimesResponse) {};\n\n    // Streaming Client API\n    rpc LongGreet(stream LongGreetRequest) returns (LongGreetResponse) {};\n\n    // Bi-Directional Streaming API\n    rpc GreetEveryone(stream GreetEveryoneRequest) returns (stream GreetEveryoneResponse) {};\n}\n```\n\n-----------\n\n## Scalability in gRPC:\n- gRPC servers are Asynchronous by default.\n- That means they do not block threads on Request.\n- Therefore each gRPC server can serve millions of requests in parallel.\n- gRPC clients has a choice of being Asynchronous or Synchronous (blocking).\n- gRPC clients can perform client side load balancing.\n- Google has 10 Billion gRPC requests being made per second internally.\n\n-----------\n\n## Error Codes:\n- With gRPC, there are few error codes. More Info: [https://www.grpc.io/docs/guides/error](https://www.grpc.io/docs/guides/error/)\n- Complete reference for implementing error handling: [https://avi.im/grpc-errors](https://avi.im/grpc-errors/)\n- If an application needs to return extra information on top of an error code, it can use the `metadata` context.\n\n-----------\n\n## gRPC Deadlines:\n- Deadlines allows gRPC clients to specify how long they are willing to wait for an RPC to complete before the RPC is terminated with the error `DEADLINE_EXCEEDED`.\n- The gRPC documentation recommends setting deadline for all client RPC calls.\n- The server should check if the deadline has exceeded and if it is exceeded then server must cancel the work it is doing.\n- Deadlines in depth: [https://grpc.io/blog/deadlines](https://grpc.io/blog/deadlines/)\n- Deadlines are propagated across gRPC calls if the gRPC calls are chained. For e.g.\n    * `A ---\u003e B ---\u003e C`: Deadline for `A` is passed to `B` and then passed to `C`. i.e. `C` will be aware of Deadline of `A`.\n\n    -----------\n\n## gRPC SSL:\n- In production, gRPC calls should be running with encryption enabled.\n- This is done by generating SSL certificates.\n- SSL allows communication to be secure end-to-end and ensuring no Man-In-The-Middle attack can be performed.\n- Refer to: [https://github.com/aditya43/grpc/blob/main/ssl/steps.sh](https://github.com/aditya43/grpc/blob/main/ssl/steps.sh)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya43%2Fgrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faditya43%2Fgrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya43%2Fgrpc/lists"}