- Accessing customer entitlements (P95 latency of 100ms)
- Reporting usage measurements (P95 latency of 200ms)
Accessible from anywhere
Stigg’s API is globally scalable and highly available by leveraging a content delivery network (CDN), where our code is executed at a location (regional edge) closest to the user. This means our services are accessible from anywhere in the world without compromising performance and latency. Due to the nature of this function-as-a-service (FaaS) architecture, our API can handle a large volume of concurrent requests by automatically scaling up and allocating new functions as much as needed.
Leveraging the CDN for improved performance and latency
Local caching and fallback strategy
Stigg SDKs support local caching, which means that customer entitlements are stored in-memory to prevent network trips for subsequent entitlement access checks. It also makes our API redundant in the case it is unreachable for any reason (like a network outage), and the SDK can continue to evaluate access checks even when it’s offline. The local cache is invalidated by frequently polling for updates, or by listening to real-time updates delivered by a WebSocket streaming connection to our API. By choosing the latter, changes are propagated almost instantaneously.Persistent cache
By default, the SDKs in-memory cache stores entitlements data for faster subsequent entitlement checks. Both server and client SDKs support this functionality. If you restart the process that is using the SDK or re-initialize the SDK, the local data will be lost. Usually, this behavior is acceptable because if the entitlements data is missing for a specific customer, the SDK will perform a network request and pull it from Stigg’s API. Alternatively, you can provide an external database to persist the customer entitlements data which can survive restarts and be accessed by multiple processes. If your processes are running on a serverless infrastructure, where each process is transient and can be de-provisioned after a limited period of time, it can greatly reduce cache misses. This can only be done using the Server SDK. Whenever an application that uses the client SDK restarts (or page reloads in the case of a web application), the entitlement data will always be fetched over the network from the Stigg API.
Retrieve data from persistent cache first, fetch over the network on cache miss
If you’re currently using a caching framework other than Redis, let us know and we’d be happy to explore ways to support it.