Skip to content

Architecture ​

This section covers system design decisions for Redis-based applications.

For Developers ​

TopicDescription
Key NamingNaming conventions and patterns
Multi-TenancyTenant isolation strategies
GuaranteesWhat is and isn't guaranteed
Failure ModesGraceful degradation patterns
Connection ManagementPools, timeouts, retries

For Operations ​

TopicDescription
DeploymentSingle vs Cluster vs Sentinel
TuningConfiguration profiles
SecurityTLS, ACL, data classification

Design Principles ​

1. Explicit Over Implicit ​

typescript
// Explicit key naming
@Cached({ key: 'user:{0}:{1}' })

// Explicit TTL
@Cached({ ttl: 3600 })

// Explicit failure behavior  
@WithLock({ onLockFailed: 'throw' })

2. Sensible Defaults ​

All plugins work with zero configuration:

typescript
// Works immediately
new CachePlugin()
new LocksPlugin()
new RateLimitPlugin()

3. Observable by Design ​

Every operation is traceable:

typescript
// Automatic metrics
cache_hits_total{key_pattern="user:*"}

// Automatic tracing
cache.get user:123 [2ms, hit=true, layer=L1]

Architecture Decision Records ​

DecisionChoiceRationale
Cache libraryCustom L1 + ioredisFull control, two-tier support
Lock algorithmSingle-node RedlockSimpler, sufficient for most cases
Rate limit storageRedis sorted setsEfficient sliding window
SerializationJSON (default)Human-readable, debuggable

Next Steps ​

Start with the topic most relevant to your design:

Released under the MIT License.