Avro Rest API As The Evolution Of JSON Based Communication Between Microservices

Avro Rest API As The Evolution Of JSON Based Communication Between Microservices

Avro Rest API As The Evolution Of JSON Based Communication Between Microservices. The article shows a way of evolution of standard JSON APIs based on the author’s experience. Solution based on Avro format significantly reduces time and network traffic in communication between microservices.

The article shows an evolution of standard JSON APIs based on the author’s experience. The solution is based on the Avro format, which significantly reduces time and network traffic in communication between microservices. The article includes the results of benchmarks comparing JSON API with variations of Avro APIs and implementation details in C## .NET Core.

Introduction

I am a software developer working in C## .NET environment, focused mostly on the backend side of the applications. That means I am delivering the data. Fetching the data. Synchronizing the data. Downloading the data. Checking data quality. Pulling the data. Mixing together data from various sources to provide new data. I think you know what I am talking about.

Fortunately, I am living in a microservice world, where the data is well organized. The flagship project of my company is built of 40-50 services which exposes about 500 endpoints in total. Even my side project is built of 6 services (20 APIs). I am using third party APIs and open APIs. During this everyday job, I noticed how to improve the most popular JSON APIs.

Believe me or not, services love to talk to each other. They do this all the time and that’s good. My customers are able to see the data, manipulate it, and delete it. Background jobs are generating reports, documents, or whatever they want. The problem starts, when the communication slows the services down and they are not able to do their job properly.

The problem

Some time ago developers in my company were asked to limit calls performed against on-premise microservices, as surprisingly the problem was the local internet bandwidth throughput. Local servers were connected by 100 Mb/s network and were unable to handle heavy traffic.

A few days later I heard a conversation between my colleague and his Product Owner. The PO asked If there is any quick-win on how to improve the response time of his service. The colleague started to explain what is the root cause of the problem: His service was fetching data from API A, then B, C, D, and E. The final response time was strongly dependent on connected services.

Then the colleague, who is a great professionalist started to enumerate possible solutions: cache part of the data, go in the direction of CQRS and Event Sourcing - start pre-generating view models as soon as the data changes. His answers were right, but caching in live-APIs is sometimes impossible. Implementation of Event Sourcing is very, very expensive both in terms of implementation as well as changing developers’ approach in the existing environment.

microservices

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Testing Microservices Applications

In this article, look at different ways to test microservices and how you can have a suitable testing strategy to begin with.

Microservices and Data Management - DZone Microservices

This article describes the nature of microservices applications, contrasts them with monolithic apps, and talk about microservices in data management.

Microservices and Data Management - DZone Microservices

This article describes the nature of microservices applications, contrasts them with monolithic apps, and talk about microservices in data management.

Microservices and Data Management - DZone Microservices

This article describes the nature of microservices applications, contrasts them with monolithic apps, and talk about microservices in data management.

The Service Mesh in the Microservices World - DZone Microservices

In this article, take a look at the service mesh in the microservices world. The software industry has come a long journey and throughout this journey, Software Architecture has evolved a lot. Starting with 1-tier (Single-node), 2-tier (Client/ Server), 3-tier, and Distributed are some of the Software Architectural patterns we saw in this journey.