Stateful Service Cloud‑Native Practices: Kuaishou’s Redis on Kubernetes
This article examines the challenges and benefits of running stateful services such as Redis on Kubernetes, presents Kuaishou’s practical experience with cloud‑native migration, evaluates risks and performance impacts, and details the custom workloads, operators, federation and KubeBlocks solutions that enable large‑scale, reliable stateful service orchestration.
Kuaishou’s infrastructure has moved most stateless services to Kubernetes, but migrating stateful services like Redis raises questions about suitability, implementation, and risk management.
The article outlines the benefits of running stateful workloads on K8s—improved resource utilization, operational efficiency, and cost reduction—while acknowledging risks such as performance degradation, stability concerns, and increased operational complexity.
To address these challenges, Kuaishou evaluates native Kubernetes primitives (StatefulSet) and finds them insufficient for complex topologies, then adopts custom workloads and operators, notably the open‑source KubeBlocks operator, which abstracts database management and supports role‑aware service discovery.
KubeBlocks introduces new workload types (InstanceSet, Component, Shard, Cluster) and a federated architecture (Fed‑InstanceSet) that distributes Redis clusters across multiple Kubernetes clusters, ensuring global ordering, unique instance IDs, and coordinated change control via DAG‑based policies.
Performance testing shows containerized Redis incurs less than a 10% overhead, while stability is enhanced through admission webhooks (kube‑shield) and fine‑grained scheduling. Operational complexity is mitigated by clear division of responsibilities between Redis and cloud‑native teams.
In summary, Kuaishou’s Redis cloud‑native journey demonstrates that, despite the inherent challenges of stateful service migration, a combination of custom operators, federation, and robust governance can deliver sustainable performance, reliability, and cost benefits.
Kuaishou Tech
Official Kuaishou tech account, providing real-time updates on the latest Kuaishou technology practices.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.