diff --git a/docs/content/3.middleware/2.guides/4.orchestration.md b/docs/content/3.middleware/2.guides/4.orchestration.md index 1e238622b7..b3d474aff2 100644 --- a/docs/content/3.middleware/2.guides/4.orchestration.md +++ b/docs/content/3.middleware/2.guides/4.orchestration.md @@ -1,16 +1,15 @@ -# Orchestration +# Data Integration and Orchestration -Orchestration is a powerful way to optimize server requests. This guide will take you through the key aspects of using the orchestration feature, focusing on integrating extensions and how to get the best out of your frontend code. +Optimizing server requests through data integration and orchestration is essential for frontend performance. This guide introduces the orchestration feature, highlighting its role in integrating extensions and streamlining frontend code. -## Orchestration for Frontend Optimization +## Enhancing Frontend Performance through Data Orchestration -One of the primary advantages of orchestration is the ability to combine multiple requests into a single endpoint. This can drastically reduce the overhead on the frontend, especially in applications where numerous server requests might be initiated simultaneously. +Data orchestration allows for consolidating multiple server requests into a single endpoint, which significantly eases the burden on the frontend. This is particularly beneficial in scenarios involving numerous simultaneous server requests. -### Benefits: - -- Reduced Network Calls: Fewer calls to the server means reduced latency and faster performance. -- Simplified Frontend Logic: Grouping related server requests can help simplify frontend code and logic. -- Consistent Data Retrieval: With orchestration, you can ensure data from multiple integrations is fetched consistently and returned in a unified format. +### Advantages: +- **Minimized Network Traffic**: Fewer server calls lead to reduced latency and enhanced responsiveness. +- **Simplified Frontend Architecture**: By grouping related server requests, the frontend logic becomes less complex. +- **Uniform Data Collection**: Ensures that data fetched from different sources is consistent and provided in a standard format. ### Implementation: @@ -84,30 +83,9 @@ To call the orchestration endpoint, you need to send a POST request to the endpo When it comes to extending the Vue Storefront integrations like `sapcc` or `contentful`, you can use the SDK extension mechanism as described in the [Extending a Module](/sdk/advanced/extending-module) guide. -To extend the `sapcc-sdk` with our new `getPDP` method, we would need to create a new extension: - -```javascript [sapccExtension.ts] -import { client } from "@vsf-enterprise/sapcc-sdk"; - -export const sapccExtension = { - extend: { - getPDP: async (params: { id: string }) => { - const { product, content } = await client.post("/getPDP", params); - - return { - product, - content, - }; - }, - }, -}; -``` - -Of course, you can use another fetching mechanism, like `axios` or `fetch`, but the `client` is already configured with the correct URL and headers. - -## Examples +## Real-World Examples -Let's take a look at some examples of how you can use orchestration. +The examples provided demonstrate practical uses of data orchestration: ### Example 1: Fetching Custom Product Properties from Legacy Systems