HTTP Deep-Dive With Ballerina: Client Communication

Introduction

In this article, we’re going to cover HTTP request and response processing using the Ballerina programming language. This will take an in-depth look at how HTTP clients are created, and how its functionality is used effectively. 

Creating HTTP Clients

An HTTP client in Ballerina is created by instantiating an http:Client object while providing the host and client configuration. The client configuration has a default value of {}, and the default values of its fields can be found at the http:ClientConfiguration record definition.

How Choosing the Right Protocol Could Boost Your Profit

Introduction

High egress cost often comes out as a surprise. As David explains, egress cost could potentially go unnoticed at the initial stages of estimating expenses for a solution. In 2017, Apple paid more than $50 million as egress cost according to the post. Hence it is clear the size of the data matters for the cost-effectiveness of a solution. Data is transmitted between two or more systems via protocols. Since the early 90s protocols such as HyperText Transfer Protocol (HTTP) have been evolving. Further new protocols emerged over the years i.e gRPC, Thrift, Websockets, NATs, etc. There will be instances where multiple protocols would be compatible with a given paradigm, giving the option for solution designers to make a choice i.e if intended to send binary data between systems, one could choose HTTP as well as gRPC, Thrift, etc. This choice could be critical. This article would unveil the influence protocols have towards the data size by first evaluating a few selected protocols for similarities (since similarities give the option to choose between them). Subsequently will evaluate how these protocols differ semantically and articulate some hidden advantages they bring to reduce the data size transmitted over the network. Finally will present how reduced data size could increase revenue, discuss some of the roadblocks that would lead to making the wrong choice of protocol and possible ways to overcome them. 

Protocols Comparison

Differences make life easy, narrow down the scope, and gives a clear idea on the potential of the protocol. When things look similar it is up to the solution designer to choose the protocol. The familiarity of a protocol could influence giving precedence to it. “If everything is an apple, I’ll rather use the apple in my own tree”. While this choice would allow building a working solution, it might not be the most optimum. As a result, businesses would lose tons of revenue. The next sections in the article will elaborate on this.