Friday, 18 March 2022

Protobuf ?

Hello friends this is a follow-up to my earlier post related to gRPC Vs Restconf and as promised below is a quick summary on Protobuf (the idea that made gRPC look so good). 



Before I summarize Protobuf, let's revisit what serialization is?  Serialization is taking a complex data structure and serializing it into a string that can be sent over a connection. The recipient will use the de-serialization process to recover the original data structure. Serialization is also required when you want to save data structure to a file. Some popular forms of serialization are JSON, YAML, XML, and protocol buffers(Protobuf).

Protobuf is a method of serializing data that can be transmitted over wire or be stored in a file. 

Two keywords to remember when we talk about Protobuf - Protobuf is platform-neutral and highly optimized for microservices architecture. 

As of 2019, Google has over 48000 Protobuf message types in 12000 .proto files.

Speed:

Protobuf is faster than XML/JSON serialization as it offloads the description of data in a proto file. 

20-100x times faster than XML 

Network bandwidth:

Protobuf utilizes binary transmission format over string used by JSON/XML thus less bandwidth is required during transmission. 

3-10X smaller than JSON/XML



Throughput:

Protobuf payload size is ~60% smaller than JSON. 

JSON is self-contained while Protobuf utilizes schema(.proto) files to keep a record of data types and schema.

Courtesy: Geoffery Hunter

Backward compatibility: 

Super easy, if the new change does not work move to your last known good proto file schema.

Polyglot support:

Protobuf support many popular programming languages like C#, Go, python, Java, Javascript.

Engineer productivity :

Protobuf support automatic client code generation using code generators, just specify the proto file with the target language.


However, there are times when JSON is a better fit:

 1) Data to be human readable(protobuf is binary)

 2) Data is consumed directly by a web browser(right now there is no support in web-browser for protobuf)

 3) When your server-side application is in javascript.

 4) JSON is self-contained (protobuf needs a proto file) 


Next post gRPC :)


References:

Serialization formats - Geoffrey Hunter

My earlier post on gRPC Vs Restconf




Friday, 11 March 2022

gRPC Vs RESTCONF

Hello friends this is the follow-up post of my previous post on Netconf Vs Restconf and in this post, I have tried to compare gRPC with RESTCONF implementation. I hope this shall provide an answer to "why gRPC". 

Microservices-based architecture is the contemporary software design and development practice and gRPC is the best option because of its unmatched performance and polyglot(many programming languages) support. 

Per google gRPC is 

"a modern, bandwidth and CPU efficient, low latency way to create massively distributed systems that span data centers, as well as power mobile apps, real-time communications, IoT devices and APIs"


Let's summarize the main difference between gRPC and RESTCONF


What could be the limitations of using gRPC?

1. Higher ramp-up time of development teams 

2. You cannot call a gRPC service from a web browser (because of HTTP/2) and need a proxy 

Next post let's deal with protobuf  :) Happy reading


References:

Google blog - gRPC

My earlier post on NETCONF Vs RESTCONF 

A short youtube video(Why gRPC ?)


Thursday, 3 March 2022

NETCONF Vs RESTCONF

Hello friends, last week many of my colleagues asked me about Netconf, Restconf & gRPC, specifically what is the difference among them. 

At a high level, my colleagues understand that these protocols were developed to minimize "vendor-lockin" and build vendor-agnostic network management & monitoring applications for a specific technology. 

Let me try to summarize(as succinctly as possible):

1. Both NETCONF and RESTCONF have CONF in common, which means these interfaces can be used to retrieve the device configuration and manipulate the device configuration. 

2. Both NETCONF and RESTCONF use YANG data models which define the schema/template of the information that is pushed and retrieved from device/s.

3. Why do we need RESTCONF: RESTful APIs were very famous in the software industry, many processes, and integration were already done using RESTful APIs, keeping this in mind RESTCONF was promoted as another technique(apart from NETCONF) to work with YANG data models.

Let's compare the major difference/s:


A quick summary of major differences

Comparison of operations between Netconf and Restconf:


Netconf  layers(from RFC):

gRPC in another post and will link it to this post, Happy reading! 

References:




Protobuf ?

Hello friends this is a follow-up to my earlier post related to gRPC Vs Restconf and as promised below is a quick summary on Protobuf (the...