Why Use gRPC and Thrift for Remote Procedure Calls

Usually, whenever somebody wants to start building an HTTP API for their website, they pretty much exclusively use REST as the go-to architectural style. They prefer REST to alternative approaches such as RPC and GraphQL.

REST works well for most cases, especially if you build a monolithic application that does not have complex within-application communication. The problems come when you build an application that consists of dozens of backend services regularly communicating with each other. An example of such architecture can look like this.

Mutual TLS With gRPC Between Python and Go Services

This tutorial walks you through the process of connecting services written in Python and Go via the gRPC framework using mutual TLS authentication. I assume that the reader is somewhat familiar with Python/Django and Go development and so omit most of the boring stuff like bootstrapping virtualenv with the Django app or how to “manage.py runserver” it.
The final code can be found here.

Introduction

I have an old system in Python undergoing a significant overhaul. It’s a two-component system:

gRPC Compression Support in Go, Java, and Ballerina

In distributed applications, occasionally, we use compression methods to save the network bandwidth. gRPC supports message-level compression on both client and server sides. Different programming languages have different kinds of ways to enable/disable gRPC compression. This article describes how to use gRPC compression in several programming languages; Go, Java, and Ballerina. Gzip compression algorithm is the most commonly used compression algorithm in gRPC, and the samples in this article also use Gzip.

gRPC Compression in Go

In Golang, there are two different ways to enable compression on the client-side and server-side. On the client-side, we have to pass a relevant compressor as an option to the RPC call. On the server side, we have to import the gRPC Gzip package to enable message compression.

gRPC for .NET: Creating a gRPC Server Application

While working with Protobuf message format for one of my client projects, I recently came across a gRPC framework. After doing my analysis, gRPC seems pretty promising for inter-service communication, particularly in microservices architectures. gRPC is a language-agnostic, high-performance Remote Procedure Call (RPC) framework. 

gRPC is built on top of the HTTP/2 transport layer and therefore can support four types of gRPC methods (unary, client streaming, server streaming, and bi-directional streaming). It uses Protobuf for message exchange.

gRPC For Production

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.

Secure Your gRPC Services With SSL/TLS

Introduction

This tutorial will walk you through the process of protecting your gRPC services with encryption based on SSL/TLS. The tutorial will provide examples written in Java, but can easily be converted to Scala and Kotlin.

What is gRPC?

gRPC is a high-performance, open source RPC framework initially developed by Google. It helps in eliminating boilerplate code and helps in connecting polyglot services in and across data centers.

HTTP for Inter-Service Communication?

After the evolution of distributed systems, microservices-based applications attracted the interest of nearly every organization wanting to grow with time and survive the market competition. Microservices allows us to scale and manage systems easily. Development time reduced due to distributed effort among many teams and time-to-market new features reduced significantly.

Due to distributed nature, communication among different components is over the network. And there are so many factors that can affect communication, either it can be security, added latency, or abrupt termination of ongoing communication, leading to increased infrastructure cost. Hence either we can fix the network, which exists with numerous problems or we can architect our system to be resilient and reliable over time.

HTTP gRPC With spring-web

When we have done HTTP to gRPC transcoding with help of envoy gRPC-JSON transcoder, then we must have gone through the following steps:

  1. Use google.api.http to annotate gRPC services
  2. Configure protoc to generate proto descriptor set
  3. Configure envoy proxy filter_chains on another port

To facilitate this procedure, some automation scripts are needed. Not trivial considering processing generated code and descriptors, packaging and distributing them differently, and configurations. When we provide gRPC services with grpc-java anyway and use spring-web to knit components together, we can tremendously simplify the work required to transcode HTTP to gRPC, namely:

Supersonic, Subatomic gRPC Services With Java and Quarkus

gRPC is an open source remote procedure call (RPC) framework. It was released by Google in 2015 and is now an incubating project within the Cloud Native Computing Foundation. This post introduces gRPC while explaining its underlying architecture and how it compares to REST over HTTP. You'll also get started using Quarkus to implement and consume gRPC services.

Remote Method Calling in gRPC

Wait, what’s this? Did you say remote method calling? Isn’t that something we did in the ‘90s with things like CORBA, RMI, and XML-RPC/SOAP?

gRPC Client and Bi-directional Streaming with Ballerina Swan Lake

Resembling a graceful rendition of Tchaikovsky’s infamous ballet, the namesake Swan Lake release of the Ballerina (referred to as Ballerinalang in the article) programming language comes packed with a revamped gRPC library to provide a more elegant way of handling client and bi-directional streaming cases. This article aims to discuss this improved gRPC streaming functionality by referring to an example for better understanding. However, if you are new to gRPC in Ballerinalang and seeking in-detail knowledge on the basics and implementation of a Unary application, read this blog on Ballerina + gRPC.

Microservices Bill Calculator with Ballerinalang

Let’s look at a basic microservices-based bill calculator as an example. The client would stream the price and quantity (the input values) of various items to be included in the total bill, and the server would essentially multiply and add them together to return the total bill as a reply.

Blazor and Dragons! How to Consume gRPC-web From Blazor

Hi All! Today we’re going to talk about how to consume a gRPC service from a Blazor client. And we’re going to do it with Dungeons & Dragons!

People who know me, know that deep down, I’m a big nerd. I started playing D&D when I was a freshman in college and kept going for years. Eventually, I began writing my own campaigns, holding sessions as Dungeon Master, and even participating in competitions. And winning.

Unary Streaming via gRPC

If you want to get multiple responses and send multiple requests, it is time to use gRPC Streaming concepts. You can't do streaming with REST API, as REST API uses HTTP 1.1. In this blog, I will go through how you can do Unary Streaming via gRPC.

Types of APIs or Streaming in gRPC

gRPC supports four types of APIs to support streaming.

Preaching the API Gospel: An Interview With the API Evangelist, Kin Lane of Postman

In this interview, I speak with Kin Lane, Chief Evangelist at Postman and (as he's perhaps better known) The API Evangelist.

Kin joined Postman in September 2019, but it's not the first time he's been an evangelist for specific APIs. Before getting heavily involved in promoting the business of APIs, Kin was an evangelist for two different businesses: a print API in New York and a business directory in Hollywood. But, it just didn't feel right, so he began his API Evangelist journey in 2010, which would see him spend the next decade (and counting) eating, sleeping, and breathing the technology, business, and politics of APIs.

The Anatomy of a Microservice, One Service, Multiple Servers

The first article of this series, "Microservice Definition and Architecture", includes a high-level architecture diagram. Subsequent articles have covered the architecture’s first two layers. It’s (finally) time to look at the API Server layer and expose the business service to the outside world. As has been the case for this series, I’ll continue to demonstrate the solution through a sample project that can be found on GitHub at https://github.com/relenteny/microservice.

There are two API Servers; RESTful and gRPC. The source is located in the media-server module. Why two implementations? The transport mechanism does make a difference. By far, the most common protocol is REST. The protocol is easy to produce and consume. It leverages a very mature transport mechanism; HTTP 1.x. Its ubiquitous support across tech stacks really makes it the API Server de facto standard protocol.

Why gRPC for Inter-Microservice Communication

Hi folks! In this blog, we will understand why one should use gRPC for inter-service communication over other RESTful services.

What is gRPC?

It is a high performance, open-source, universal RPC framework. In simple words, it enables the server and client applications to communicate transparently and build connected systems. Google developed gRPC and made it available open-source. With it, a customer can directly call methods on a server application on a different machine as if it were a local object. gRPC is based on the foundations of conventional Remote Procedure Call (RPC) technology but implemented on top of the modern technology stacks such as HTTP2, protocol buffers, etc., to ensure maximum interoperability.

Testing a gRPC Service in Go With Table Driven Tests

Everyone knows that 100% of code coverage does not exist and adds no added value. In fact, every day, what we really want is to test our business logic, the intelligence of our application.

In this article, we are going to start from a small Go-based CLI application that does not yet have unit tests, and then, we will do some gRPC unit tests.

Identity, Microservices and Service Meshes

Find your identity with Microservices.


A lot of our customers are talking about microservices. Some are well on their way down the path, others are just getting started, and some are still wondering if microservices are the best choice for them.