Distributed Cache
Distributed Cache is Apinizer's cache infrastructure that stores shared data such as throttling, quota, OAuth2 tokens, and load balancing information. Cache Servers can now run in separate Kubernetes namespaces from Gateway pods, allowing for more flexible infrastructure management.
Cache Server Overview
Cache Server (apinizer-cache) is the environment where cache values required in Apinizer are stored. It uses Hazelcast technology for distributed caching and can be managed by Apinizer or connected to an existing remote Cache Server deployment.
Namespace Independence:
Cache Server pods can now run in a different Kubernetes namespace than Gateway pods. This provides more flexible infrastructure management and allows you to separate Gateway and Cache workloads. Gateway pods can access Cache Servers in other namespaces using Kubernetes service discovery (e.g., http://cache-http-service.apinizer-cache.svc.cluster.local:8090).
Cache Server Configuration
Deployment Type Selection
When creating a Cache Server, you need to select the deployment type:
Managed by Apinizer
Apinizer will automatically create and manage the cache deployment using Kubernetes API. Apinizer will create namespace, deployment, service, and all required Kubernetes resources automatically.
Use this option when:
- You want Apinizer to manage the entire cache lifecycle
- You need automatic resource provisioning and management
- You want simplified cache server management
Remote Cache Server
Connect to an existing Cache Server pod that was deployed manually via YAML. Apinizer will only register the connection details without managing the deployment.
Use this option when:
- You have an existing Cache Server deployment managed outside Apinizer
- You need custom cache configurations not supported by Apinizer
- You want to use a Cache Server deployed by another system
Remote Cache Server Requirements:
Make sure your Cache Server pod is running and accessible. Apinizer will only register the connection details without managing the deployment. You are responsible for maintaining the remote Cache Server deployment.
Namespace Configuration
Important: The namespace configuration cannot be changed after the Cache Server is created. Make sure to select the correct namespace during creation.
Create New Namespace
When creating a new namespace, you can specify a custom namespace name. The namespace must comply with RFC 1123 DNS label standards:
- Must be between 3 and 63 characters
- Only lower case alphanumeric characters (a-z, 0-9) or hyphens (-) are allowed
- Must start and end with a lower case alphanumeric character
- Examples:
my-namespace,prod-env,123-abc