- Low-latency entitlement evaluations
- Local caching of entitlements and current usage
- Subscription to real-time updates for entitlement and usage changes
Node.js applications using the GraphQL-based Node.js SDK (
@stigg/node-server-sdk) do not require the Sidecar. It provides full feature parity with the Sidecar, including low-latency entitlement checks, caching, and real-time updates. If you use the REST-based TypeScript SDK, point it at the Sidecar to cache entitlement checks.Benefits for your application host
Key benefits of using the Sidecar:- In-memory caching for every SDK: entitlement checks are answered from a local cache, whatever language or client you use, including plain REST
- Persistent cache: back the cache with Redis so it survives restarts and can be shared across instances
- Reduced CPU and memory usage in the host application compared to embedding the SDK directly
- Can be scaled together with the main application or as an independent, shared service
What the Sidecar caches
Requests for entities that aren’t cached are proxied to the Stigg API.
Fail-safe resilience goals
The main design goal of the Sidecar is to remain operational during network issues while still returning valid read responses. Under normal conditions, reads resolve instantly from the local Redis cache. When the upstream Stigg API becomes unreachable, cached responses are returned directly from Redis. When Redis itself is down, Sidecar attempts a live upstream API call if it is still reachable. If that also fails, it falls back to configurable static default values as a final safety layer. Write paths, such asPOST /api/v1/usage and POST /api/v1/events in the REST API or ReportUsage and ReportEvents over gRPC, do not return fallback values. Errors are returned explicitly and should be handled by your own observability and logging layer using try/catch and structured logging.