# @gooddata/sdk-backend-base

> GoodData.UI SDK - Base for backend implementations

Latest version **11.64.0** (published 2026-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gooddata/sdk-backend-base
pnpm add @gooddata/sdk-backend-base
yarn add @gooddata/sdk-backend-base
bun add @gooddata/sdk-backend-base
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 11.64.0 |
| Published | 2026-10-22 |
| First published | 2020-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 11 |
| Unpacked size | 713.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 73 |
| Author | GoodData |
| Maintainers | rodri360, ivan.mjartan, lupko, tomas.kratochvil, rodrigo.balsells, stanislavhacker, vojtasii, pbenes, gooddata-ci, nikolacech, petrjanu, hung.cao, xmort, bich.nguyen, no23reason, matyas.kandl, romanrakus, tu.bui, my.duong, hang.ngo, scavnickyj, thao-luong, thuong.nguyen, huyen.nguyen, nestor_encinas, tmuchka, gdjan, phong.nguyen, tuan.tran_gd, mkoldus, martin.milicka, pjiranek, martozar, david.zoufaly, agrebnevs-gd, vasek.zmrhal, hkad98, hoaimy, lukas.ther, ondrejvelisekgd, amilieta, andrenanninga-gooddata, pavelzrk, ilianchik, dusan-kovacik-profiq, khuongnguyen, matej.pavlik, jenny_gooddata, goodkuba, armhaj, bertold8, jyn.nguyen, mara3l, ondrej.maca, lukashlavacek, petr.veprek, jan.tychtl.gooddata, sommedamgd, guigooddata, peter-lorn, adampenaz, jakub.schenk, timurmuh, danieldoktor, jkbm, jmat_gd, ellavo, wendy.nguyen, milan.dufek, maitrieuphilong, jkbm_gd, zdenekornst, jiri.staroba, henry.nguyen.gooddata, adam.prchal, frankhuynh, macekond, martinnaj, peter.koza, sandrasus, pjar, jan.svager.gooddata, minh.ho.gooddata, maiphuong.bui, jakubz_good, pavelcerny, mvarhalik |

## Links

- npm: https://www.npmjs.com/package/@gooddata/sdk-backend-base
- Repository: https://github.com/gooddata/gooddata-ui-sdk
- Homepage: https://github.com/gooddata/gooddata-ui-sdk#readme
- Issues: https://github.com/gooddata/gooddata-ui-sdk/issues
- npm.io page: https://npm.io/package/@gooddata/sdk-backend-base

## Dependencies (11)

- [uuid](https://npm.io/package/uuid.md) 11.1.1
- [tslib](https://npm.io/package/tslib.md) 2.8.1
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.23
- [lru-cache](https://npm.io/package/lru-cache.md) 11.1.0
- [spark-md5](https://npm.io/package/spark-md5.md) ^3.0.0
- [ts-invariant](https://npm.io/package/ts-invariant.md) 0.10.3
- [@gooddata/util](https://npm.io/package/@gooddata/util.md) 11.64.0
- [@gooddata/sdk-model](https://npm.io/package/@gooddata/sdk-model.md) 11.64.0
- [json-stable-stringify](https://npm.io/package/json-stable-stringify.md) 1.3.0
- [@braintree/sanitize-url](https://npm.io/package/@braintree/sanitize-url.md) ^6.0.0
- [@gooddata/sdk-backend-spi](https://npm.io/package/@gooddata/sdk-backend-spi.md) 11.64.0

## Recent versions

- 11.64.0 (latest) — 2026-10-22
- 11.65.0-alpha.0 (prerelease) — 2026-10-22
- 9.9.3-beta.6 (betarelease) — 2026-09-24
- 9.9.2 (patch) — 2025-03-19
- 10.0.0-alpha.2.fix.0 (hotfix) — 2024-03-28
- 11.64.0-alpha.6 — 2026-10-22
- 11.64.0-alpha.4 — 2026-10-21
- 11.64.0-alpha.3 — 2026-10-21
- 11.64.0-alpha.2 — 2026-10-21
- 11.64.0-alpha.1 — 2026-10-20
- 11.63.1 — 2026-10-19
- 11.64.0-alpha.0 — 2026-10-19
- 11.63.0 — 2026-10-19
- 11.63.0-alpha.5 — 2026-10-19
- 11.63.0-alpha.4 — 2026-10-19
- … 3898 more at https://npm.io/package/@gooddata/sdk-backend-base/versions

## README

# Analytical Backend SPI - infrastructure and foundations

[![npm version](https://img.shields.io/npm/v/@gooddata/sdk-backend-base)](https://www.npmjs.com/@gooddata/sdk-backend-base)&nbsp;
[![npm monthly downloads](https://img.shields.io/npm/dm/@gooddata/sdk-backend-base)](https://npmcharts.com/compare/@gooddata/sdk-backend-base?minimal=true)&nbsp;
![typescript](https://img.shields.io/badge/typescript-first-blue?logo=typescript)

This package is a part of the [GoodData.UI SDK](https://sdk.gooddata.com/gooddata-ui/docs/about_gooddataui.html).
To learn more, check [the source monorepo](https://github.com/gooddata/gooddata-ui-sdk).

This package contains foundational, reusable code useful for building new or decorating existing
[Analytical Backend](https://www.npmjs.com/package/@gooddata/sdk-backend-spi) implementations. This is lower-level, infrastructural code which may be useful
when building larger, more complex applications.

The notable contents of this package are documented below.

## Backend Decorators

Low level infrastructure to build your own Analytical Backend decorators. The decorators are used
to seamlessly enrich existing backend implementation with additional functionality - without
the need to touch the backend implementation itself.

See code comments in [base classes](src/decoratedBackend/index.ts) for further documentation on how
to create your own decorators. Or additionally look at existing decorator implementations for
inspiration.

## Eventing Backend

This decorator allows you to enhance any backend implementation with support for eventing. The eventing
is at the moment limited to the execution part of the Analytical Backend SPI.

Backend decorated with eventing can be created as follows:

```typescript
import { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
import { IExecutionDefinition, IDataView } from "@gooddata/sdk-model";
import { withEventing } from "@gooddata/sdk-backend-base";

const realBackendImplementation = ...;
const enhancedBackend: IAnalyticalBackend = withEventing(realBackendImplementation, {
    beforeExecute: (def: IExecutionDefinition) => {
        console.log("about to trigger execution with definition:", def);
    },
    successfulResultReadAll: (dataView: IDataView) => {
        console.log("retrieved all data for backend execution");
    }
});
```

You can then pass the `enhancedBackend` to the various React components offered by the SDK and be
notified.

## Normalizing Backend

This decorator addresses the fact that two execution definitions may lead semantically same results but differ just
in view-only details or technicalities. Before the execution is sent to the underlying backend this decorator will:

- Strip alias, measure format and title from measures
- Strip alias from attributes
- Remove any noop filters
- Normalize local identifiers

The normalized execution is sent to the backend and before the results and data are passed back to the caller code,
the decorator performs denormalization and restores the original values all in the right places in the result and
data structures. To the caller, all of this optimization remains transparent and everything looks like the original
execution actually executed.

```typescript
import { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
import { withNormalization } from "@gooddata/sdk-backend-base";

const realBackendImplementation = ...;
const enhancedBackend: IAnalyticalBackend = withNormalization(realBackendImplementation);
```

## Caching Backend

This decorator implements a naive client-side execution result caching with bounded cache size.
The execution results will be evicted only if cache limits are reached using LRU policy. Browser ‘Refresh’ cleans the cache.

If your app must deliver a snappy experience without too many loading indicators AND the data freshness is not a
critical requirement, then this decorator can speed your application immensely.

```typescript
import { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
import { withCaching, RecommendedCachingConfiguration } from "@gooddata/sdk-backend-base";

const realBackendImplementation = ...;
const enhancedBackend: IAnalyticalBackend = withCaching(realBackendImplementation, RecommendedCachingConfiguration);
```

The withCaching accepts configuration which you need to use to tweak the size of the different caches. You can use RecommendedCachingConfiguration
available in this package.

The caching plays well with normalization:

```typescript
import { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
import { withCaching, withNormalization, RecommendedCachingConfiguration } from "@gooddata/sdk-backend-base";

const realBackendImplementation = ...;
const enhancedBackend: IAnalyticalBackend = withNormalization(withCaching(realBackendImplementation, RecommendedCachingConfiguration));
```

This way the normalization first wipes any differences that are unimportant for the backend, effectively dispatching
just the really unique executions to the underlying backend - the caching decorator. This greatly increases client-side
cache hits for applications that dynamically change view-only properties of LDM objects.

## License

(C) 2017-2022 GoodData Corporation

This project is under MIT License. See [LICENSE](https://github.com/gooddata/gooddata-ui-sdk/blob/master/libs/sdk-backend-base/LICENSE).

---
_Source: https://npm.io/package/@gooddata/sdk-backend-base · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
