sys-d
// distributed systems lab
Fixed Window CounterSliding Window LogSliding Window CounterToken BucketLeaky Bucket
Circuit BreakerRetry with BackoffTimeout WrapperBulkheadHedged RequestsFallback Strategy
LRU CacheLFU CacheTTL CacheCache AsideWrite-Through/BackCache StampedeBloom Filter
Round RobinWeighted Round RobinLeast ConnectionsIP HashingConsistent Hashing
In-Memory QueuePub/Sub BrokerAt-Most-OnceAt-Least-OnceDead Letter QueueConsumer GroupsPartitioned Log
Distributed LockLeader ElectionHeartbeat MonitorService RegistryService Discovery
Primary-ReplicaRead/Write QuorumVector ClocksCRDT Counters
Two Phase CommitThree Phase CommitSimplified Raft
Key-Value StoreAppend-Only LogWrite Ahead LogSSTableLSM Tree
Metrics CollectorHistogramStructured LoggerTrace ID Propagation
JWT ValidationAPI Key ValidationIdempotency KeyHMAC Verification
v1.0 · MIT
security

Security Patterns

Authentication, integrity verification, and safe request handling for distributed services.

// concept

Security in distributed systems involves verifying identity (authn), integrity (HMAC), and ensuring safe retries (idempotency) — all without centralized coordination.

JWT Validation

Decode and verify JSON Web Tokens. Validate signature, expiry, issuer, and claims without shared state.

API Key Validation

Authenticate requests via API keys. Simple, stateless auth for service-to-service communication.

Idempotency Key

Deduplicate requests using a unique key. Safely retry operations without causing duplicate side effects.

HMAC Verification

Verify message integrity and authenticity using a shared secret. Detect tampering in webhooks and APIs.