DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Building Production-Grade GenAI on GCP with Vertex AI Agent Builder
  • The Hidden Bottlenecks That Break Microservices in Production
  • The LLM Selection War Story: Part 4 - Your Production Failure Testing Suite
  • The Dual Write Problem: What Looks Safe in Code but Breaks in Production

Trending

  • Edge Computing in Utility IoT: Two Architecture Patterns That Actually Work
  • Optimizing High-Volume REST APIs Using Redis Caching and Spring Boot (With Load Testing Code)
  • The Hidden Cost of Overprivileged Tokens: Designing Messaging Platforms That Assume Compromise
  • Dear Micromanager: Your Distrust Has a Job; It’s Just Not the One You’re Doing

gRPC For Production

I have gone through all the pain to collect all available materials and decided to create a library that provides the core reqs for a production-ready gRPC communication.

By 
Alexsandro Souza user avatar
Alexsandro Souza
·
Jun. 06, 21 · Presentation
Likes (2)
Comment
Save
Tweet
Share
3.8K Views

Join the DZone community and get the full member experience.

Join For Free

When starting with gRPC there are many resources setting out what gRPC is, where it originated from and how to create basic service and client. All those tutorials do a very good job in helping the developers to get started using gRPC in their projects. We can find materials talking about gRPC server, stub client, interceptors, protobuf, encrypted connection, load balancing but hardly we find all this together and prepared for a real production scenario. Deployments to production are not discussed and available resources are sparse.

There are some projects that provide a collection of handy features that can help you to set up gRPC communication in a reliable way but they are all generic building blocks without an initial structure that you can evolve from.

Project Overview

I have gone through all this pain to collect all available materials and decided to create a library that provides the core requirements for a production-ready gRPC communication. As a natural open-source contributor, I could not make all this hard work available to the community and hopefully save people time.

This project abstracts away the details of the gRPC server and client configuration. Here are the main features:

  • Health check service — We use the grpc_health_probe utility which allows you to query the health of gRPC services that expose service status through the gRPC Health Checking Protocol.
  • Shutdown hook — The library registers a shutdown hook with the GRPC server to ensure that the application is closed gracefully on the exit.
  • Keep alive params — Keepalives are an optional feature but it can be handy to signal how the persistence of the open connection should be kept for further messages.
  • In memory communication between client and server, helpful to write unit and integration tests. When writing integration tests we should avoid having the networking element from your test as it is slow to assign and release ports.
  • Server and client builder for uniform object creation.
  • Ability to recover the system from a service panic.
  • Ability to add multiple interceptors in sorted order.
  • Client tracing metadata propagation.
  • Handy Server interceptors (Authentication, request canceled, execution time, panic recovery).
  • Handy Client interceptors (Timeout logs, Metadata propagation).
  • Secure communication (TLS).

Conclusion

As you can see, the gRPC Server project has some handy features and it can save you time not having to write your own gRPC server bootstrap. If you are a developer or architect looking to create a new gRPC project with Golang or Java these projects will be very helpful.

Enough talking, check out the project in either Golang or Java.

Production (computer science)

Published at DZone with permission of Alexsandro Souza. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Building Production-Grade GenAI on GCP with Vertex AI Agent Builder
  • The Hidden Bottlenecks That Break Microservices in Production
  • The LLM Selection War Story: Part 4 - Your Production Failure Testing Suite
  • The Dual Write Problem: What Looks Safe in Code but Breaks in Production

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook