10 Beyond REST
This chapter covers
- Overview of some REST notable drawbacks
- GraphQL introduction (pros and cons)
- Implementing GraphQL using HotChocolate
- Overview of Google Remote Procedure Call (gRPC)
- Implementing a gRPC server and client using Grpc.AspNetCore
- Other REST alternatives
As we know since Chapter 1, the REST architectural paradigm has been the most popular Web API architecture for several years, mostly thanks to its scalability, flexibility, and portability – not to mention the huge adoption of the JSON data exchange format by the IT world.
However, if we could take a closer look at all the REST Web APIs in use nowadays, we could likely see how only a fraction of them is actually RESTful. As a matter of fact, most REST implementations only adhere with some of the guiding constraints defined by Roy Fielding which we reviewed back in Chapter 3 and then implemented throughout this book. Nonetheless, all of them have been developed having the REST standard in mind.
This indisputable success is more than justified: when it comes to designing and implementing a web service, REST is almost always a great choice, especially if we are looking for simplicity, versatility, and performance – the top reasons why it has replaced SOAP almost everywhere. However, it’s also important to understand that REST is not the only choice we have, nor the best possible alternative in any given circumstance.