GraphQL, REST, gRPC, and SOAP are four different approaches to designing and implementing APIs (Application Programming Interfaces) for communication between client and server applications. Each has its own set of characteristics, benefits, and drawbacks.
We currently support GraphQL and REST, as they are the best for applications like ours and the majority of our users are familiar with one or both of these.
GraphQL, Supported by MCe API:
Developed by Facebook in 2012 and released as an open-source project in 2015.
Query language for APIs, allows the client to request exactly the data it needs, reducing the amount of over- or under-fetching.
Uses a single endpoint for all requests, regardless of the types or number of resources being requested.
Supports real-time updates via subscriptions.
Self-documenting and strongly typed, which makes it easier to understand and work with.
Works well with complex and hierarchical data structures.
Most modern programming languages have available tooling for GraphQL.
REST (Representational State Transfer), Supported by MCe API:
Architectural style introduced by Roy Fielding in his 2000 doctoral dissertation.
Based on standard HTTP methods (GET, POST, PUT, DELETE, etc.) for interaction with resources.
Each resource has its own unique URL (Uniform Resource Locator), which represents the resource's state.
Stateless, meaning that each request from a client must contain all the necessary information for the server to process it.
Cacheable, which can improve performance by storing and reusing responses to identical requests.
Works best with simple and flat data structures, and when performance is a priority.
Most programming languages have available tooling for REST
gRPC (gRPC Remote Procedure Call) Not Supported by MCe API:
Developed by Google and released as an open-source project in 2015.
A modern, high-performance RPC (Remote Procedure Call) framework based on HTTP/2 and Protocol Buffers, a language-agnostic binary serialization format.
Uses a contract-first approach with strongly typed service contracts defined using Protocol Buffers.
Supports multiple programming languages and platforms.
Provides features such as bidirectional streaming, flow control, and built-in support for load balancing, authentication, and monitoring.
Generally more performant than REST, as it uses binary encoding and HTTP/2, which reduces overhead and latency.
Ideal for microservices architectures and high-performance use cases, like real-time communication and large-scale distributed systems.
SOAP (Simple Object Access Protocol) Not Supported by MCe API:
Developed by Microsoft in the late 1990s as a protocol for exchanging structured information.
Based on XML (Extensible Markup Language), which makes it heavier and more verbose compared to JSON, the format used by REST and GraphQL.
Supports multiple communication protocols, including HTTP, SMTP (Simple Mail Transfer Protocol), and TCP (Transmission Control Protocol).
Enforces strict rules and formal specifications, including the use of WSDL (Web Services Description Language) for defining the interface of a web service.
Built-in error handling and support for advanced security features, such as WS-Security.
Very popular among older Java programmers
In summary, GraphQL is a flexible and efficient query language that works well with complex data structures, REST is a lightweight and simple architectural style that's suitable for most web applications, gRPC is a high-performance RPC framework ideal for microservices and large-scale distributed systems, and SOAP is a robust and formal protocol that's well-suited for Java programmers