cds-federation-synonyms
An experimental CAP plugin for CAP-to-CAP data federation over SAP HANA synonyms, so one project reads another's tables without the rows being copied.
Facts
Where it sits
Who is behind it
In the atlas: maintains 34@cap-jsmaintainerSteffen WeinstockContributes to this
In the atlas: contributes to 14@stewsk1 contributor
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.
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.
PracticalFunctional boundary
When your adoption policy excludes experimental dependencies: the maintainer’s README explicitly labels this plugin experimental.
What it declares
Every artifact
- Type
- CDS plugin
- Origin
- By SAP
As a CDS plugin
- Distributed through
- npm
For data federation
- Approach
- Delta handlingWrites reach the source
- Strategy
- federate
- Refresh
- on read
- Reads from
- CAP serviceSAP HANA schema
- Writes to
- SAP HANA synonym
Connections
Reading data from another system as if it were local
Using native SAP HANA database objects beside the generated model
Token validation and security context for XSUAA and IAS
Managed SAP HANA database service on BTP
Download
Learn more
- CAP-level Data FederationCAP-level Data FederationA Devtoberfest 2026 session (CAP-31) on letting one CAP application read another's data as if it were local. The modelling half is the same for both answers, which is why the two technical edges hold: the provider defines an API service and exports it with CDS export as an npm package carrying the model, mock data and translated texts, the consumer imports it and puts consumption views on top, and only then is it wired either as service-level replication that copies the rows into local tables each time the server starts, or over the SAP HANA synonyms that cds-federation-synonyms generates, with HDI grants on the provider side and a service replacement that redirects each synonym from its mock table to the provider's container. It is worked through on xflights and xtravels, including the local run where CDS watch mocks the imported service from the CSV files inside the package.SAP Developers, published 2026-10-02SAP Developers, YouTube — SAP Developers playlists
Where it sits in your app
Download
README
quoted from cap-js/cds-federation-synonyms under Apache-2.0, readWelcome to @cap-js/cds-federation-synonyms
About this project
CDS plugin for SAP HANA synonym-based data federation.
This plugin is still experimental.
For CAP applications using SAP HANA as database, this plugin enables CAP-to-CAP data federation by integration on the database layer via synonyms.
In the database schema of the application that consumes the data ("consumer"), the imported entities are represented as synonyms that point to the respective tables or views in the database schema of the application that provides the data ("provider"). Acess to the producer is read-only.
Visit CAP-level Data Federation to learn about the basics.
Requirements
- @sap/cds-dk version 9.9 or higher.
- Both "provider" and "consumer" are CAP apps, using SAP HANA as database.
- Both "provider" and "consumer" run in the same SAP HANA instance, and, if Native Multitenancy in SAP HANA Cloud is switched on, live in the same tenant.
The plugin uses two components which are under SAP properity licesenses. You need to review and accept them if you consume the plugin:
Usage
Install the plugin both in the provider and in the consumer app. If the consumer uses multi-tenancy, install the plugin in the consumer's MTX sidecar, too.
npm install git+https://github.com/cap-js/cds-federation-synonyms.git
Provider
Define an API package with a data service annotated with @data.product: 'via-synonym' and export it.
For more information on API packages, see
CAP-level Data Federation.
Consumer
Import the API package, define consumption views on top of the imported entities and use them in your app's CDS model as described in CAP-level Data Federation.
On HANA, the entities in the imported data service are represented by synonyms that can either point to local mock tables (synonyms are "unconnected"), or to the respective tables/views in the provider app (synonyms are "connected").
The choice between connected and unconnected is made on service level. For a single tenant app, it is a deployment decision. For the tenants of a multi tenant app, you can use a static configuration or the synonyms can alternatively also be switched between connected and unconnected during runtime via an API provided by the plugin.
Schematic example
Consumer app:
// --- consumption view
@federated entity consumption.Books as projection on datasrv.Books { /* ... */ }
// --- imported API
@data.product: 'via-synonym' @cds.external
service datasrv {
@readonly entity Books { /*...*/};
// ...
}
Provider app:
// --- API definition / data service
@data.product: 'via-synonym'
service datasrv {
@readonly entity Books as projection on bookshop.Books
// ...
}
// --- base entity
entity bookshop.Books {
// ...
}
Database objects:
In the producer app, table bookshop.Books is exposed in service datasrv via the synonym technique.
For access control, a HANA role datasrv is generated that grants SELECT privileges
to all entities in the service.
In the consumer app, the imported entity datasrv.books is represented by a synonym.
The synonym can point to a local mock table ("unconnected") or to the corresponding view
in the producer app ("connected").
Walkthrough
For a detailed example, go to Walkthrough.
Support, Feedback, Contributing
This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
Security / Disclosure
If you find any bug that may be a security problem, please follow the instructions found in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.
Code of Conduct
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.
Licensing
Copyright 2026 SAP SE or an SAP affiliate company and cds-federation-synonyms contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
History
Others providing
- SAP Master Data IntegrationSAP Master Data IntegrationA multi-tenant cloud service that replicates master data between two or more clients, giving a hybrid landscape a consistent view of it, with filters set through SAP Business Data Orchestration service.sap official, btpCloud service replicating master data across a hybrid landscapefrom BTP/BAIP
- @cap-js-community/common@cap-js-community/commonSix independent features for CAP services in one package: replication cache, migration check, rate limiting, a Redis client broker, a local HTML5 repository and a CDM builder.community org, capSix CAP features in one package, from replication cache to rate limitsfrom CAP
- cds-data-federationcds-data-federationA 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.independent, capData federation for CAP via delegation, caching and replicationfrom CAP
- cds-data-pipelinecds-data-pipelineDeclarative scheduled pipelines between CAP services — each one a linear READ, MAP, WRITE from a single source to a single target, with tracking, retry, delta support and a management API.independent, capScheduled READ, MAP, WRITE pipelines between CAP servicesfrom CAP
- @sap/cds@sap/cdsThe CAP Node.js runtime, which compiles the CDS model, serves the services declared in it, answers generic requests before any handler runs, and loads every cds-plugin.sap official, capCAP Node.js runtimefrom CAP
- @sap/cds-dk@sap/cds-dkThe command line client and development toolkit for CAP projects, with the commands cds build, cds deploy, cds watch and cds add among them.sap official, capCommand line client and development toolkit for CAPfrom CAP
- @sap/cds@sap/cdsThe CAP Node.js runtime, which compiles the CDS model, serves the services declared in it, answers generic requests before any handler runs, and loads every cds-plugin.sap official, capCAP Node.js runtimefrom CAP
- @sap/hdi-deploy@sap/hdi-deployThe Node.js deployer for SAP HANA Deployment Infrastructure: it writes a database module's design-time files into an HDI container as a delta, and it is what cds deploy runs for SAP HANA.sap official, capNode.js deployer for SAP HANA Deployment Infrastructure containersfrom CAP
- SAP-samples/hana-developer-cli-tool-exampleSAP-samples/hana-developer-cli-tool-exampleA developer-centric command line for SAP HANA, built for local development outside SAP tooling and connecting to a local, cloud or remote HANA instance the same way.sap official, btpDeveloper-centric command line for SAP HANAfrom BTP/BAIP
Details
Sources
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
Flavors
“npm install git+https://github.com/cap-js/cds-federation-synonyms.git” — cap-js/cds-federation-synonyms — README
Contributors
History in the atlas
- When your adoption policy excludes experimental dependencies: the [maintainer’s README](https://github.com/cap-js/cds-federation-synonyms#about-this-project) explicitly labels this plugin experimental.
- CAP-to-CAP data federation over SAP HANA synonyms, so one project reads another's tables without the rows being copied.
- First seen.
For your agent
- Ref
artifact:cap-js-cds-federation-synonyms- JSON
- /artifacts/cap-js-cds-federation-synonyms.json
- MCP
- Connecting an agent