Board State Cache

Overview

Redis cache for board state, task positions, and real-time WebSocket connections supporting collaborative board editing.

Caching Strategy

Board State

  • Task Positions: Current task order in columns
  • Active Filters: Per-user active filters
  • Board Presence: Who’s viewing each board
  • Optimistic Locks: Prevent concurrent edit conflicts

Real-time Data

  • WebSocket Sessions: Active connections per board
  • Presence Heartbeats: User activity timestamps
  • Pending Updates: Queued board changes

Technical Details

Specifications:

  • Version: Redis 7.x
  • Memory: 16 GB
  • Persistence: AOF enabled for durability
  • Replication: Primary with 2 read replicas
  • Pub/Sub: Enabled for WebSocket scaling

Performance:

  • Latency: P99 < 2ms
  • Throughput: 50,000 ops/second
  • Pub/Sub Latency: < 10ms
  • Connections: Max 5,000

Data Structures

Board State

board:{board_id}:state -> Board state (hash)
- column_1: [task_1, task_3, task_5]
- column_2: [task_2, task_4]
TTL: 1 hour

Presence

board:{board_id}:presence -> Active users (sorted set)
Score: Last heartbeat timestamp
TTL: 5 minutes

WebSocket Pub/Sub

Channel: board:{board_id}:updates
Messages: Board update events

Monitoring

  • Memory Usage: Alert at 80%
  • Pub/Sub Lag: Monitor message latency
  • Connection Count: Track WebSocket connections
  • Presence TTL: Monitor stale presence data