Name: | Description: | Size: | Format: | |
---|---|---|---|---|
4.45 MB | Adobe PDF |
Authors
Advisor(s)
Abstract(s)
Software systems are constantly evolving, and traditional approaches such as REST API and GraphQL have been, and still are, crucial for implementing public-facing interfaces. However, gRPC allows for greater efficiency in managing multiple requests and responses through a single connection, enhancing application performance. Technology has followed a similar trajectory, leading to challenges in traditional implementations due to the complexity of systems and diverse needs. These challenges have prompted the implementation of methods to ensure that results only contain relevant information for a given system, thereby eliminating unnecessary data. The Netflix example illustrates and implements a solution that adapts responses using gRPC and Protobuf field mask [1]. With the increasing need to make systems responsive to various devices, there is a growing inclination to use standards that offer greater flexibility and modularity in development.
Protobuf, which is agnostic, allows the production of a foundation across different languages without modification requirements. The main advantage highlighted in using Protobuf is performance, while the main disadvantage is its diminutive ecosystem. Subsequently, samples show how it is possible to eliminate
irrelevant attributes in both REST with GraphQL and gRPC using the Protobuf field mask. These examples demonstrate that the latter option is more accessible and flexible. After, a systematic review is conducted using the PRISMA method to define a flexible API, identify software patterns that allow better flexibility when providing and using applications, and understand API performance and its significance. A migration is accomplished for GraphQL and gRPC, which is performance-tested later using k6 scripts. We execute the scripts, and the metrics are subsequently collected and compared. A flexibility test is achieved by adding, changing, and removing previously implemented methods and checking the effects of the modifications.
The results show that, on average, gRPC is quicker than GraphQL, although latency peeks occur. These spikes are significantly reduced when using streams. As for the flexibility test, gRPC is more flexible due to having a well-established contract with other APIs. These contracts are then easily adapted when using field masks through their field ID.
Description
Keywords
Flexible API gRPC Performance Patterns Migration