Skip to content

Commit 1ebff7d

Browse files
committed
Data Federation Guide, part I -> ready for Jan release
1 parent ee3b5cb commit 1ebff7d

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

guides/integration/_menu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# [ CAP-level Service Integration ](calesi.md)
3-
# [ CAP-level Data Federation ](data-federation.md) <!-- UNRELEASED -->
3+
# [ CAP-level Data Federation ](data-federation.md)
44
# [ Inner Loop Development ](inner-loops.md) <!-- UNRELEASED -->
55
# [ Reuse & Compose ](reuse-and-compose.md)
66
# [ Service Bindings ](service-bindings.md) <!-- UNRELEASED -->

guides/integration/data-federation.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ CAP applications can integrate and federate data from multiple external data sou
44
{.abstract}
55

66

7-
## Introduction
7+
## Introduction & Motivation
88

99
Displaying external data in lists commonly requires fast access to that data. Relying on live calls to remote services per row is clearly not an option, as that would lead to poor performance, excessive load on server, and a nightmare regarding resilience. Instead, we somehow need to ensure that all required data is available locally, so that it can be accessed fast and reliably by UIs, using good old SQL JOINs.
1010

11-
For example, we saw the need for that already in the [CAP-level Service Integration](calesi.md#coding-required) guide, where the `Customer` field in the travel requests list is populated from the remote S/4 Business Partner service, but missing when running the services separately:
11+
For example, we saw the need for that already in the [CAP-level Service Integration](calesi.md#integration-logic-required) guide, where the `Customer` field in the travel requests list is populated from the remote S/4 Business Partner service, but missing when running the services separately:
1212

1313
1. First run these commands **in two separate terminals**:
1414

@@ -80,16 +80,28 @@ In addition, when we again look into the log output, we see some bulk requests l
8080
```
8181
</span>
8282
83-
In the xtravels app we accomplished that with a simple, yet quite effective data replication solution, which automatically replicates data as follows...
83+
84+
## Get The XTravels Sample
85+
86+
In the [`@capire/xtravels`](https://github.com/capire/xtravels) app we accomplished that with a simple, yet quite effective data replication solution, which automatically replicates data as documented below.
87+
88+
Clone the project from GitHub and open it in VS Code to follow along:
89+
90+
```shell
91+
git clone https://github.com/capire/xtravels.git cap/samples/xtravels
92+
code cap/samples/xtravels
93+
```
8494
8595
8696
## Federated Consumption Views
8797
88-
Tag [consumption views](calesi#consumption-views) with the `@federated` annotation, to express your intent to have that data federated, i.e. in close access locally, for example:
98+
Tag [consumption views](calesi#consumption-views) with the `@federated` annotation, to express your intent to have that data federated, i.e. in close access locally. For example, we did so in out consumption view for S/4 Business Partners:
8999
90-
```cds :line-numbers=4
100+
::: code-group
101+
```cds :line-numbers=4 [apis/capire/s4.cds]
91102
@federated entity Customers as projection on S4.A_BusinessPartner { ... }
92103
```
104+
:::
93105
94106
> [!tip] Stay Intentional -> <i>What, not how!</i> -> Minimal Assumptions
95107
>
@@ -98,7 +110,7 @@ Tag [consumption views](calesi#consumption-views) with the `@federated` annotati
98110
99111
## Generic Implementation
100112
101-
Here's the complete code, placed in file `srv/data-federation.js`:
113+
Here's the complete code, as found in [`srv/data-federation.js`](https://github.com/capire/xtravels/blob/main/srv/data-federation.js):
102114

103115
::: code-group
104116
```js:line-numbers [srv/data-federation.js]
@@ -155,7 +167,7 @@ Let's have a closer look at this code, which handles these main tasks:
155167
> We work with **database-agnostic** and **protocol-agnostic** [CQL queries](../../cds/cql) both for interacting with the local database as well as for querying remote services. In effect, we got a fully generic solution for replication, i.e., it works for **_any_** remote service that supports OData, or HCQL.
156168
157169
158-
### Test Drive Locally
170+
## Test Drive Locally
159171
160172
Let's see the outcome in action: to activate the above data federation code, edit `srv/server.js` file and uncomment the single line of code in there like this:
161173
@@ -216,16 +228,13 @@ Finally, open the Fiori UI in the browser again, and see that customer data from
216228
![XTravels Fiori details view showing a travel requests, now with flight data again.](assets/xtravels-bookings.png)
217229
218230
219-
220-
## Service-level Replication
221-
222-
### Initial Loads
223-
### Delta Loads
224-
### On-Demand Replication
225-
### Event-driven Updates
226-
227-
## HANA Virtual Tables
228-
229-
## HANA Synonyms
230-
231-
## HANA Data Products
231+
<!--
232+
## Service-level Replication
233+
### Initial Loads
234+
### Delta Loads
235+
### On-Demand Replication
236+
### Event-driven Updates
237+
## HANA Virtual Tables
238+
## HANA Synonyms
239+
## HANA Data Products
240+
-->

0 commit comments

Comments
 (0)