A production-grade, horizontally scaled URL shortener utilizing an asymmetric architecture: powered by a stateless application tier behind Kong API Gateway, an optimal Redis LRU caching layer, and a highly available, masterless 3-node ScyllaDB ring cluster.
This architecture transforms a basic web application into a resilient, fault-tolerant enterprise system engineered for high-throughput link management and real-time telemetry extraction.
-
Routing & API Gateway Tier (Kong Gateway)
Reverse Proxying: Acts as the single entry point for all client traffic, obscuring the underlying server ports and topology.
Edge Governance: Handles critical middleware protocols seamlessly—including SSL/TLS termination, request forwarding, dynamic URI prefix matching (/api/v1), and distributed rate-limiting to prevent brute-force attacks on vulnerable shortcode generating routes.
-
Stateless Compute Tier (Horizontally Scaled Application Nodes)
Scalability: Employs multiple decoupled application server containers running concurrently to distribute processing workloads.
Stateless Consistency: Because compute nodes do not preserve session details locally, any node can drop off or spin up instantly behind the API gateway's round-robin balancer, maximizing horizontal elasticity.
-
Low-Latency Caching Layer (Redis Memory Management)
Performance Layering: Operates as a fast-lookup volatile buffer to keep repetitive read lookups from saturating database storage disk operations.
Resource Optimization: Enforces a rigid 2GB maximum limit utilizing an explicit allkeys-lru (Least Recently Used) eviction schema. When bounds are neared, older, inactive shortcodes automatically degrade out of memory to secure pipeline headroom.
Overhead Telemetry: Accurately balances base internal framework overhead (~1.66MB idling allocations used for socket connection tracking buffers and index map generation) against real-time variable client key weights.
-
High-Availability Storage Core (ScyllaDB Ring Topology)
Decentralized Execution: Bypasses legacy primary-secondary replication failure points. Operates as a masterless peer-to-peer ring layout where every single node manages read and write streams synchronously.
Data Topography: Distributes hash keys partitions evenly across a 64-bit Murmur3 token boundary architecture with a strict Replication Factor of 3 (RF=3) across distinct virtual racks.
Peer Synchronization: Leverages background Gossip network status loops to dynamically assess node accessibility and perform non-blocking active topology discoveries.