Skip to content

cds-data-federation

Live delegation and scheduled replication on consumption views — declarative, annotation-driven.

cds
using { API_BUSINESS_PARTNER as remote } from './external/API_BUSINESS_PARTNER';

@federation.delegate
entity Partners as projection on remote.A_BusinessPartner {
    BusinessPartner         as ID,
    BusinessPartnerFullName as name,
    BusinessPartnerCategory as category
};

@federation.replicate: { schedule: 600000 }
entity ReplicatedPartners as projection on remote.A_BusinessPartner {
    BusinessPartner         as ID,
    BusinessPartnerFullName as name,
    BusinessPartnerCategory as category
};

Delegate forwards reads (and optional writes) to the remote at request time. Replicate runs scheduled sync into your local database via cds-data-pipeline. Optional caching: cache.strategy: 'response' (cds-caching) or cache.strategy: 'entity' (SQLite snapshot + pipeline on demand).

Install: npm add cds-data-federation cds-data-pipeline — runs on both CDS 9 and CDS 10 (@sap/cds >= 9).

CDS 10 (June 2026): delegate and replicate benefit automatically from CAP's HCQL protocol on CAP-to-CAP hops, and federated entities are reachable by AI agents through the MCP adapter — no annotation changes. See CDS 10, HCQL and MCP.

Released under the MIT License.