MATIH Platform is in active MVP development. Documentation reflects current implementation status.
2. Architecture
Data Stores
Redis

Redis

Redis 7 serves as the platform's caching layer, session store, pub/sub messaging system, and rate limiting backend. It is one of the most widely used infrastructure components, with 16 services depending on it for low-latency data access and real-time communication.


Role in the Platform

AspectDetails
Version7
DeploymentKubernetes StatefulSet via Helm
Services using it16 services
Multi-tenancyTenant-prefixed key namespacing

Use Cases

Use CasePatternKey Format
Query result cachingRead-through cache{tenant_id}:query:{hash}
Session storageKey-value with TTL{tenant_id}:session:{session_id}
Configuration broadcastPub/SubChannel: config:changes
AI response streamingPub/SubChannel: ai:stream:{session_id}
Rate limitingSliding window counterratelimit:{tenant_id}:{window}
Dashboard refreshPub/SubChannel: dashboard:refresh:{id}
Token blacklistSet with TTLblacklist:{jti}

Tenant-Aware Cache Manager

The TenantAwareCacheManager in commons-java ensures all cache keys include the tenant prefix:

public class TenantAwareCacheManager {
    private String buildKey(String key) {
        String tenantId = TenantContext.getCurrentTenantIdOrDefault("system");
        return tenantId + ":" + key;
    }
}

This prevents cross-tenant cache pollution, as keys from different tenants can never collide.


Pub/Sub Channels

Channel PatternPublisherSubscriberPurpose
config:changesConfig ServiceAll servicesZero-downtime config updates
ai:stream:{sessionId}AI ServiceWebSocket bridgeStreaming AI response tokens
dashboard:refresh:{id}BI ServiceFrontend WebSocketLive dashboard data updates
health:status:{namespace}All servicesObservability APIReal-time health status

Configuration

ParameterDevelopmentProduction
Max memory256Mi2Gi
Eviction policyallkeys-lruallkeys-lru
PersistenceDisabledAOF with 1-second fsync
Replicas13 (1 primary + 2 replicas)

Related Pages