Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update orchestration header #6998

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 10 additions & 32 deletions docs/content/3.middleware/2.guides/4.orchestration.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Orchestration
# Data Integration and Orchestration

WojtekTheWebDev marked this conversation as resolved.
Show resolved Hide resolved
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:

Expand Down Expand Up @@ -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

Expand Down
Loading