From 945cc5c4fb70b833936d084afd665bb083a57c45 Mon Sep 17 00:00:00 2001 From: David Mueller Date: Tue, 14 Jan 2025 09:59:16 -0500 Subject: [PATCH] Update rest-alternatives.adoc #7661 --- modules/ROOT/pages/rest-alternatives.adoc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/ROOT/pages/rest-alternatives.adoc b/modules/ROOT/pages/rest-alternatives.adoc index da92cd7a6..dea3677bd 100644 --- a/modules/ROOT/pages/rest-alternatives.adoc +++ b/modules/ROOT/pages/rest-alternatives.adoc @@ -1,4 +1,4 @@ -// Copyright (c) 2020,2021 IBM Corporation and others. +// Copyright (c) 2020,20225 IBM Corporation and others. // Licensed under Creative Commons Attribution-NoDerivatives // 4.0 International (CC BY-ND 4.0) // https://creativecommons.org/licenses/by-nd/4.0/ @@ -13,12 +13,18 @@ :page-type: general = Alternatives to REST for client-server communications -Although REST is a widely adopted pattern for communications among microservices, Open Liberty supports alternative options that might be better suited for some application scenarios. These alternatives include GraphQl, gRPC, and WebSocket. +Although REST is a widely adopted pattern for communications among microservices, Open Liberty supports alternative options that might be better suited for some application scenarios. These alternatives include GraphQL, gRPC, and WebSocket. -Despite the ubiquity of REST-style communication among microservices, REST comes with tradeoffs in capability and performance that can make it a less than ideal solution for some use cases. Issues such as over-fetching and under-fetching of data, lack of real-time communication, and tight coupling between client and server can lead to performance and maintenance concerns for certain types of applications. To address these issues, developers can use alternative protocols and technologies that specifically address the shortcomings of REST. +REST comes with tradeoffs in capability and performance that can make it a less than ideal solution for some use cases. Issues such as over-fetching and under-fetching of data, lack of real-time communication, and tight coupling between client and server can lead to performance and maintenance concerns for certain types of applications. To address these issues, you can use alternative protocols and frameworks that specifically address the shortcomings of REST. -For example, xref:microprofile-graphql.adoc[GraphQL] is an open source data query and manipulation language for APIs that directly addresses problems with over-fetching and under-fetching of data that might occur with REST APIs. Similarly, the xref:web-socket.adoc[WebSocket] protocol enables real-time bidirectional communication between a server and one or more clients, which is not feasible in REST architecture. High-performance applications that require high throughput and low latency can benefit from the efficient data serialization and multiplexing capabilities that xref:grpc-services.adoc[gRPC] provides. +* xref:microprofile-graphql.adoc[GraphQL]: This open source data query and manipulation language for APIs directly addresses problems with over-fetching and under-fetching of data that might occur with REST APIs. +* xref:web-socket.adoc[WebSocket]: This protocol enables real-time bidirectional communication between a server and one or more clients, which is not feasible in REST architecture. +* xref:grpc-services.adoc[gRPC]: This framework provides efficient data serialization and multiplexing capabilities for high-performance applications that require high throughput and low latency. It also enables efficient communication between services and applications in various languages and platforms. -Ultimately, the framework you choose depends on the specific needs of your application, including factors like performance requirements, data complexity, and the technologies you're already using. +Ultimately, the framework that you choose depends on the specific needs of your application, including factors like performance requirements, data complexity, and the technologies you're already using. + +== See also + +link:/guides/#rest_alternatives[Guides: REST alternatives] // assisted by watsonx with latest GenAI contribution: Granite-3-8b-instruct