API Architectural Styles: REST, GraphQL, RPC

Lesson 12 of 4013 min readPremium lesson preview
In this lesson1 sections

API Architectural Styles: REST, GraphQL, RPC

Compare resource-oriented HTTP APIs, GraphQL queries, and gRPC service methods. Evaluate client needs, schema evolution, caching, failure handling, and measured workload costs before choosing an interface.

An API is a contract between independently changing components. A mobile app may need a compact view assembled from several data sources, while a backend worker may need a typed streaming interface.

The interface shape affects how clients request data and how teams evolve the service. It does not determine database efficiency or reliability on its own.

REST is an architectural style, GraphQL is a query language and execution specification, and gRPC is an RPC framework. They are useful alternatives to compare, but they are not identical categories of technology.

What is an architectural style?

An architectural style describes constraints on components and their interactions. Those constraints can support useful properties, but do not guarantee efficiency merely by being adopted. In this lesson, compare the concrete interface and operational choices each approach provides.

When determining an architectural style, we must evaluate the characteristics that suit our design problem. Each style essentially serves as a template with constraints, so we must determine which one suits our requirements.

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.