Practical API Design Using gRPC at Netflix – InfoQ.com

Attend QCon Plus (November 1-12) and stay ahead of the tech that matters to keep your skills fresh. Register
Facilitating the spread of knowledge and innovation in professional software development


Engineering The Digital transformation leverages manufacturing’s successful track record of improving productivity and quality and organizational change management principles. It’s a training program designed to reduce the barriers to change, enable teams to understand good design patterns, and ultimately allow organizations to create a systematic approach to continuous improvement.
Katharina Probst discusses some of the best practices to build, evolve, and operate microservices, learnings from containers, service meshes, DevOps, Chaos & load testing, and planning for growth.
In the podcast, Rosaria Silipo talks about the emerging trends in deep learning, with focus on low code visual programming to help data scientists apply deep learning techniques without having to code the solution from scratch.
In this podcast Shane Hastie, Lead Editor for Culture & Methods, spoke to Will Burns of IdeasicleX about creativity and idea generation in remote teams.
The role of the Application Security Manager (ASM) should be the driving force of the overall code review process. An ASM should know about development processes, information security principles, and have solid technical skills. To get a good ASM you can either use experts from a service provider or grow an in-house professional from developers or security specialists.
Turn advice from 64+ world-class professionals into immediate action items. Attend online on Nov 1-12.
Learn from practitioners driving innovation and change in software. Attend in-person on April 4-6, 2022.
InfoQ Homepage News Practical API Design Using gRPC at Netflix
This item in japanese
Sep 21, 2021 1 min read
by
Vasco Veloso
A two-part series of articles about API design at Netflix was recently published in the company's technology blog. It describes how they solved the problem of ignoring irrelevant message fields in their backend API requests and responses by using the special Protocol Buffers (Protobuf) message FieldMask.
Alex Borysov and Ricky Gardiner, senior software engineers at Netflix, note that API clients often do not use all the fields present in the responses to their requests. This transmission and computation of irrelevant information for one specific request can waste bandwidth and computational resources, increase the error rate, and increase the overall latency.
The authors argue that such waste can be avoided when API clients specify which fields are relevant to them with every request. They point out that this feature is present out of the box with API standards such as GraphQL and JSON:API and question whether Netflix's wide usage of gRPC in the backend could benefit from an identical mechanism.
They found that a particular message called FieldMask is defined in Protobuf, the underlying message encoding of gRPC. When included in API requests, it allows clients to list which fields are relevant and can be applied to both read and modify operations.
Selecting a few fields from a large message body.
Source: https://netflixtechblog.com/practical-api-design-at-netflix-part-1-using-protobuf-fieldmask-35cfdc606518
The authors also describe the pattern chosen for managing the evolution of each API's data model while maintaining some degree of backward compatibility. Old fields are deprecated in favour of new ones, and they advocate for requiring a valid field mask or a version number with every update operation.
The need to optimise the overall footprint of API traffic is also felt in different domains. Others have also concluded that it is beneficial to allow clients to control which data is transmitted. As the consultant Adam DuVander points out in his earlier article about API request flexibilisation, "a bit too much or too little data may seem trivial, but in aggregate they can have a huge impact". DuVander shows how different API implementations addressed this issue.
Detailed code and Protobuf message examples are provided in the article to illustrate how FieldMask messages are used at Netflix.

Try NGINX Plus and NGINX App Protect – Free for 30 Days.
A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.
You need to Register an InfoQ account or or login to post comments. But there’s so much more behind being registered.
Get the most out of the InfoQ experience.
Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.
Focus on the topics that matter in software development right now.
Deep-dive with 64+ world-class software leaders. Discover how they are applying emerging trends. Learn their use cases and best practices.
Stay ahead of the adoption curve and shape your roadmap with QCon Plus online software development conference.
InfoQ.com and all content copyright © 2006-2021 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we’ve ever worked with.
Privacy Notice, Terms And Conditions, Cookie Policy

source