CDS pluginCDS plugintypeInstalls into a CAP project and extends the runtime. CAP loads it through cds.requires or the plugin hook.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

cds-data-federation

A data federation plugin for SAP CAP applications that declares delegation, caching and replication on a consumption view through CDS annotations, instead of hand-written handlers.

A CAP service that needs data from another system leaves you choosing between calling out on every request and copying the data in, and then writing the handlers for whichever you picked. This plugin declares both on the consumption view: @federation.delegate forwards reads, and optionally writes, to the remote at query time, including cross-service $expand and navigation, while @federation.replicate registers scheduled sync jobs that copy remote data into the local database. Either can be cached, at response level through cds-caching or as entity-level snapshots. Replication and entity-level caching require the separate cds-data-pipeline package; delegation alone does not, and both packages install on @sap/cds 9 and 10 with Node 22 or later.

Facts

Latestv0.4.0ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
Data federationCAPData federationcapabilityReading data that lives in another system as if it were local — by federating the query, by copying the rows, or by caching what was read. Three different answers to one question, and the choice is about how stale you can afford to be.CachingCAPCachingcapabilityHolding the result of an expensive read so the next one is cheap. This spans four different things people call caching — HTTP response caching, query result caching, remote service response caching, and application-level memoisation. They are not interchangeable, and picking the wrong one is the usual cause of stale-data bugs in multitenant apps.Service integrationCAPService integrationcapabilityUsing a service that runs somewhere else as if it were one of your own: its API imported into the model, a proxy that turns a local query into the remote protocol, and a mock that stands in for it on a laptop. Distinct from [destinations](capability:destinations), which is how the address and the credentials are found, and from [replication](capability:replication), which is holding the data locally.
Flavors
Requires
@sap/cds≥ 9@sap/cdsartifactThe peer range, as published.cds-cachingcds-cachingartifactFor response caching.cds-data-pipelinecds-data-pipelineartifactFor entity caching and replication.@cap-js/sqlite@cap-js/sqliteartifactFor the entity-cache strategy.

Who is behind it

Mike ZaschkaMike ZaschkaPersonMaintains this
In the atlas: maintains 6, contributes to 9, wrote 12
@mikezaschka
maintainer

Before choosing this

Conditions

LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
  • § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
  • § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
  • § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
SAP Developer License Agreement 3.2 CAP →

Also, from Data federation§ 1: Section 1 restricts mass extraction to a non-SAP product and states a scoped interoperability exception. That boundary is central to a replication design and must be checked against the actual use.

What it declares

Every artifact

Type
CDS plugin
Origin
Independently maintained
Runtime
Node.js

As a CDS plugin

Declared for
>=9
Distributed through
npm

For data federation

Approach
Delta handlingWrites reach the source
Strategy
federatecopycache
Refresh
on readon expiryscheduled
Reads from
ODataREST
Writes to
local databaseSQLite
property statedstated nonot said

For caching

Caching layer
Federated responses or whole-entity snapshots
Freshness control
Response: tags/TTL; entity: TTL and reload on miss; no automatic CUD invalidation

Tasks this contributes to2Beta

Cache a remote service responseA read that would call out to a remote service on every request is answered from a retained response until it expires.Node.jsCovers, under conditionsfederated read adapter
What it does

On a delegated entity the response strategy routes the federated read through cds-caching, so the retaining is declared on the consumption view rather than written into a handler. The entity strategy answers a different shape of the same wish: it stores a snapshot of the remote projection in secondary SQLite and serves reads from there until the ttl runs out.

Conditions

cache.strategy is left at its default of response; cds-caching is installed, which the page names as an optional peer dependency

Remaining work

Install the peer dependency and annotate the view. The strategy selects a cache, it is not a second one; the entity strategy brings cds-data-pipeline and @cap-js/sqlite with it.

All options on the Caching page →
Refresh cached reads after a writeA read answered from a cache reflects a write to the underlying data within a bound the application sets.Node.jsStated not supportedfederated read adapter
What it does

Automatic clearing on a write. A write through a writable delegate does not clear the cache under either strategy, and the documentation records that as a stated behaviour with the alternative named.

Remaining work

Clear the entry from the write path, or shorten the ttl so the window is the staleness the application accepts.

All options on the Caching page →

Connections6

cds-data-federation connectionscds-data-federationPROVIDES→ provides3provides stated Caches federated responses through [cds-caching](artifact:cds-caching), or retains entity snapshots through [cds-data-pipeline](artifact:mikezaschka-cds-data-pipeline). Writable delegates require manual invalidation or a shorter TTL. cds-data-federation — Caching Federated Entities: https://mikezaschka.github.io/cds-data/federation/integration/caching.html cds-data-federation — Caching Federated Entities: https://mikezaschka.github.io/cds-data/federation/integration/caching.htmlCachingprovides stated Declares on a consumption view whether a remote entity is delegated to at query time, replicated into a local table on a schedule through cds-data-pipeline, or cached; the handlers and the query translation are registered at boot from the annotation. cds-data-federation — README: https://github.com/mikezaschka/cds-data/blob/main/packages/cds-data-federation/README.mdData federationprovides stated Delegates a consumption view to its remote service from an annotation, with the query translated, writes opt-in, and $expand and navigation across the local and remote boundary handled in the plugin rather than in a handler per scenario. cds-data-federation — README: https://github.com/mikezaschka/cds-data/blob/main/packages/cds-data-federation/README.md cds-data-federation — README: https://github.com/mikezaschka/cds-data/blob/main/packages/cds-data-federation/README.mdService integrationNEEDS→ needs3needs stated For the entity-cache strategy. cds-data-federation — Caching Federated Entities: https://mikezaschka.github.io/cds-data/federation/integration/caching.html@cap-js/sqliteneeds stated For response caching. cds-data-federation — Caching Federated Entities: https://mikezaschka.github.io/cds-data/federation/integration/caching.htmlcds-cachingneeds stated For entity caching and replication. cds-data — README: https://github.com/mikezaschka/cds-datacds-data-pipeline

Install

npm add cds-data-federation

Derived from the package name. No recipe recorded; the README has the configuration.

Learn more2

Readings
  1. Federating, Replicating, and Caching Remote Data in CAP — Part 2Mike Zaschka, SAP Community
  2. The Full Picture: Federating, Replicating, and Caching Remote Data in CAP — Part 1Mike Zaschka, SAP Community
What changed
  1. v0.3.0

    The plugin's default service names and configuration keys moved to kebab-case, including the default name of the entity-cache service, and a configured entity-cache serviceName is honoured.

    Makes stale:

    Configuration written for 0.2 that names the plugin's services or keys in their earlier spelling.

README

quoted from mikezaschka/cds-data under MIT, read
mikezaschka/cds-data/packages/cds-data-federation/README.mdOn GitHub

cds-data-federation

npm version monthly downloads CI License: MIT SAP CAP Documentation

Documentation · npm

The annotation-driven SAP CAP plugin for integrating external services into your application's data model — declarative, no handler code. Composes cds-data-pipeline for scheduled sync.

Beyond CAP

CAP gives you the right concepts — consumption views, projection chains, cds.connect.to, remote.run(req.query) — and you rarely need much code per entity. But you still maintain that wiring in every project: on('READ') handlers, rename maps, replication loops, and schedule setup copied from samples such as xtravels or the S/4 mashup sample. Cross-service $expand and navigation are especially brittle — intercepting incoming OData requests and CQN, stripping expand items, batch-fetching from the right service, and stitching results by foreign key adds up fast.

This plugin needs zero wiring code. Annotate the consumption view; handlers, query translation, and pipeline binding are registered at boot.

BenefitWhat you get
Zero handler code@federation.delegate / @federation.replicate on the projection — no per-entity srv files to maintain
Consumption-view contractField and association renames, column restriction, static where — inferred from the projection, not hand-written maps
Cross-service mashups$expand and navigation across local ↔ remote boundaries handled inside the plugin — not manual request interception per scenario
Scheduled replicationFull/delta sync into local tables via cds-data-pipeline — retry, concurrency guard, run history, REST sources
Optional cachingPer-query (cds-caching) or full-entity SQLite snapshots on delegate
ObservabilityFederation-bound pipelines in /pipeline and the Pipeline Console

Full positioning against CAP samples and other approaches: Comparison with CAP.

Install

# Replicate or entity cache:
npm add cds-data-federation cds-data-pipeline

# Delegate-only:
npm add cds-data-federation
PackageVersionRequired when
@sap/cds>= 9Always — CDS 9 and CDS 10
@sap-cloud-sdk/http-client, @sap-cloud-sdk/resilience^4OData remote services
cds-data-pipelinepeer@federation.replicate, cache.strategy: 'entity', custom pipeline hooks
cds-caching>= 1cache.strategy: 'response' (default cache strategy)
@cap-js/sqlite>= 2cache.strategy: 'entity' (2.x on CDS 9, 3.x on CDS 10)

The plugin auto-activates on load via cds-plugin.js. Setup: Installation.

Choosing a strategy

I need…Use
Live data, writes to system of record@federation.delegate
Same remote queries repeated; tolerate TTL staleness@federation.delegate + cache: { strategy: 'response' }
Arbitrary filters/sorts on one entity; tolerate TTL@federation.delegate + cache: { strategy: 'entity' }
SQL joins with local tables, analytics, offline resilience@federation.replicate (+ cds-data-pipeline)
Plain REST JSON API (no CDS model on remote)@federation.replicate + rest: { … }

Start with delegate; add cache for latency/load; replicate when you need SQL power or offline resilience.

Full decision tree, limitations, and OData caveats: Choosing a strategy.

Features

The consumption view IS the federation contract — the @federation.* annotation declares runtime behavior; entity X as projection on remote.Y declares schema, renames, and column restriction. See Consumption views.

AreaHighlightsDocs
DelegateLive proxy, query translation, opt-in CUD, server-driven pagingAnnotations
ReplicateFull/delta sync, UPSERT, replicated aspect, pipeline hooksFirst replication
CachingPer-query (response) or full-entity SQLite (entity)Caching
Cross-service$expand and navigation across local ↔ remote boundariesCross-service scenarios

Full capability list: Features.

Examples

using { ProviderService as remote } from '../srv/external/ProviderService';

@federation.delegate
entity Customers as projection on remote.Customers;

@federation.delegate
entity Products as projection on remote.Products {
    ID    as productId,
    name  as productName,
    price as unitPrice
};

@federation.replicate: { mode: 'delta', schedule: 600000, delta: { field: 'modifiedAt' } }
entity ReplicatedProducts as projection on remote.Products { ... };

All annotation options: Annotations reference.

Role of cds-data-pipeline

At boot, federation scans @federation.replicate (and entity-cache) annotations and calls addPipeline({ ... }) via pipeline-binding.js. You use annotations, not the engine API, unless you need custom PIPELINE.* hooks. Replicate pipelines appear in the shared /pipeline management API and Pipeline Console.

const pipelines = await cds.connect.to('data-pipeline');
pipelines.before('PIPELINE.MAP', 'ReplicatedPartners', async (req) => {
    req.data.sourceRecords = req.data.sourceRecords.filter(r => !r.blocked);
});

See pipeline features and first replication.

Pipeline Console

When management.reuse.console is enabled on cds-data-pipeline, federation-bound pipelines (replicate jobs, entity-cache entries) show up automatically:

Pipeline landscape — federation replicate and cache pipelines grouped by service

Pipeline detail — replicate run history and schedule controls

Enable: Feature activation.

Documentation

Multi-tenancy: CAP MTX.

AI assistants

Coming soon. Agent guidance (AGENTS.md) and task skills for coding assistants will ship in a future release.

MIT, read

History

Latest

v0.3.3

Fixes 1

Notes
Bug Fixes
  • service-resolution: update service type check to include isAppService property
  1. v0.3.2

    Docs 2

    Notes
    Documentation
    • add Beyond CAP section and slim strategy picker
    • refresh package READMEs and add Pipeline Console screenshots
  2. v0.3.1

    Fixes 1

    Notes
    Bug Fixes
    • recognize join-based derived read models in scanner
  3. v0.3.0dated in the atlas

    Breaking 1, Features 1, Fixes 1, Docs 3

    Notes
    ⚠ BREAKING CHANGES
    • align plugin service and config keys to kebab-case defaults
    Features
    • always set a meaningful pipeline description
    Bug Fixes
    • honor configured entity-cache serviceName; rename default to kebab-case
    Documentation
    • add CQN transform examples and debug logging
    • mark AI assistant guidance as coming soon
    • add shields.io badges to root and package READMEs
  4. v0.2.1

    Features 1, Fixes 1

    Notes
    Features
    • resolve remote→local navigation path $filters
    Bug Fixes
    • extract renames from as select from consumption views
  5. v0.2.0

    Features 2

    Notes
    Features
    • refactor entity cache and add HCQL and MCP integration
    • add Pipeline Console launchpad to mcp-federation example
142downloads per week, npm
Weekly downloads for cds-data-federation26 complete calendar weeks from 2026-04-27 to 2026-10-25; the latest total is 142.27 Apr – 3 May: 04 May – 10 May: 011 May – 17 May: 018 May – 24 May: 025 May – 31 May: 01 Jun – 7 Jun: 08 Jun – 14 Jun: 015 Jun – 21 Jun: 022 Jun – 28 Jun: 029 Jun – 5 Jul: 06 Jul – 12 Jul: 61813 Jul – 19 Jul: 24620 Jul – 26 Jul: 4127 Jul – 2 Aug: 213 Aug – 9 Aug: 1910 Aug – 16 Aug: 5717 Aug – 23 Aug: 11324 Aug – 30 Aug: 5331 Aug – 6 Sept: 677 Sept – 13 Sept: 3414 Sept – 20 Sept: 45621 Sept – 27 Sept: 65028 Sept – 4 Oct: 1,3105 Oct – 11 Oct: 74112 Oct – 18 Oct: 34219 Oct – 25 Oct: 142

Others providing9

Data federation
  1. cds-federation-synonymsCAP-to-CAP data federation over SAP HANA synonyms
  2. @cap-js-community/commonSix CAP features in one package, from replication cache to rate limits
  3. cds-data-pipelineScheduled READ, MAP, WRITE pipelines between CAP services
  4. @sap/cdsCAP Node.js runtime
Caching
  1. Redis on SAP BTP, hyperscaler optionManaged Redis from the hyperscaler via a BTP service binding
  2. @cap-js-community/commonSix CAP features in one package, from replication cache to rate limits
  3. cds-cachingCAP caching plugin for query results and remote service responses
  4. @sap/cdsCAP Node.js runtime
Service integration
  1. com.sap.cds:cds-feature-remote-odataRemote Services for consuming OData V2 and V4 APIs in CAP Java
  2. capire/s4Prebuilt SAP S/4HANA integration package for CAP projects
  3. @sap/cds-dkCommand line client and development toolkit for CAP
  4. @sap/cdsCAP Node.js runtime

Details

Sources5
npm registrydiscovered herechecked
The discovery passdiscovered herechecked
npm registry, cds-data-federationversion, releases, installschecked
github.com/git+https://github.com/mikezaschka/cds-data.gittree, pushes, contributors, CIchecked
packages/cds-data-federation/README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesnode
declared for>=9
latestv0.4.0
first release
releases and cadence7, ~1d median
discovered vianpm registry, The discovery pass
first seen in the atlas
ecosystem and domaincap, data-and-persistence
Flavors1
Node.js
“The plugin auto-activates on load via `cds-plugin.js`.” — mikezaschka/cds-data — READMEchecked
History in the atlas2
  1. Added caching relationship, strategy facets and conditional dependencies
  2. First seen.
For your agent
Ref
artifact:mikezaschka-cds-data-federation
JSON
/artifacts/mikezaschka-cds-data-federation.json
MCP
Connecting an agent