6
Designing Effective APIs
While gRPC is performant, it is easy to make mistakes that will cost you in the long term or at scale. In this chapter, we are going to see the considerations that are important in order to design efficient APIs in gRPC. Since we are talking about API design, the considerations are going to be linked to Protobuf because, as you know by now, we define our types and endpoints in Protobuf.
In this chapter, we are going to cover the following topics:
- How to choose the right integer type
- Understanding the impact of field tags on the size of serialized data
- How to use field masks to solve the over-fetching problem
- Understanding how repeated fields can lead to a bigger payload than expected
Technical requirements
For this ...
Get gRPC Go for Professionals now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.