2x Highly performant Microservices using gPRC/http2

  • IDL (Interface definition language) — Describe once and generate code for any supported languages, which makes it language-agnostic ;) just like love needs no language
  • Service Contract like any other service-oriented framework, you need to define and agree upon contracts on both sides to communicate. ProtoBuff is no different principally, In your .proto file you define, Service method and request/response structure. Think gRPC Service as Controller and method as Action if you are .net MVC developer
  • Wire Format is a binary format for network transmission, actual serialization is based upon binary format to gain performance which it does so no complaints
  • HTTP HOL blocking issue, as you all know HTTP had a serious issue of Head-of-line (HOL) blocking issue which means it doesn’t allow subsequent requests until the previous one is processed on the same connection.
  • HTTP 1.1 alleged to handle this issue but not really, as it allows multiple connections but responses only processed in order, means if 6 requests are made concurrently like request A, B and request B is first one to be completed, its response will not be returned until request A processed and returned.
  • HTTP 2 Multiplexing resolve this issue in an almost real manner, there is a reason I am being sarcastic about it, as with TCP based connection it’s not purely solved as one lost packet could hold the stream until packet resent and processed completely but with UDP and certain framework helps HTTP 2 could be pure solution for HOL problem. Don’t want to bore you with so many details nor this topic is about HTTP
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Google.Protobuf" Version="3.9.1" /> <PackageReference Include="Grpc.Net.ClientFactory" Version="2.23.2" /> <PackageReference Include="Grpc.Tools" Version="2.23.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> </ItemGroup> <ItemGroup> <Protobuf Include="..\GrpcService1\Protos\greet.proto" GrpcServices="Client"> <Link>Protos\greet.proto</Link> </Protobuf> </ItemGroup> </Project>



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
M Adnan A

M Adnan A


Love writing, learning, sharing and love being sarcastic :)