Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@gooddata/sdk-backend-base
Advanced tools
GoodData.UI SDK - Base for backend implementations
This package is a part of the GoodData.UI SDK. To learn more, check the source monorepo.
This package contains foundational, reusable code useful for building new or decorating existing Analytical Backend 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.
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 for further documentation on how to create your own decorators. Or additionally look at existing decorator implementations for inspiration.
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:
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.
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:
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.
import { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
import { withNormalization } from "@gooddata/sdk-backend-base";
const realBackendImplementation = ...;
const enhancedBackend: IAnalyticalBackend = withNormalization(realBackendImplementation);
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.
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:
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.
(C) 2017-2022 GoodData Corporation
This project is under MIT License. See LICENSE.
FAQs
GoodData.UI SDK - Base for backend implementations
The npm package @gooddata/sdk-backend-base receives a total of 0 weekly downloads. As such, @gooddata/sdk-backend-base popularity was classified as not popular.
We found that @gooddata/sdk-backend-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 45 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.