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

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Curious about the future of data-driven systems? Join our Data Engineering roundtable and learn how to build scalable data platforms.

Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.

Threat Detection: Learn core practices for managing security risks and vulnerabilities in your organization — don't regret those threats!

Managing API integrations: Assess your use case and needs — plus learn patterns for the design, build, and maintenance of your integrations.

Related

  • Maturing an Engineering Organization From DevOps to Platform Team
  • Aren’t We Transformed Yet? Why Digital Transformation Needs More Work
  • How to Avoid Defect Leakages in Software Testing
  • Optimizing Machine Learning Deployment: Tips and Tricks

Trending

  • Wow, pnpm, You’re Really Fast
  • Data Governance Essentials: Glossaries, Catalogs, and Lineage (Part 5)
  • Accelerating Connection Handshakes in Trusted Network Environments
  • Designing Scalable and Secure Cloud-Native Architectures: Technical Strategies and Best Practices

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.6K 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

  • Maturing an Engineering Organization From DevOps to Platform Team
  • Aren’t We Transformed Yet? Why Digital Transformation Needs More Work
  • How to Avoid Defect Leakages in Software Testing
  • Optimizing Machine Learning Deployment: Tips and Tricks

Partner Resources


Comments

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: