Fading Coder

One Final Commit for the Last Sprint

Running Redis with Sentinel for High Availability on Linux

Launching Redis with Sentinel on Linux Redis is a popular in‑memory data store used for caching and improving application performance. To maintain uptime and automatically handle failures, the Sentinel system provides monitoring, notification, and automatic failover for Redis instances. This article...

Redis Data Types and Their Practical Application Scenarios

Redis offers a rich set of data types, each designed for specific use cases. Understanding when to применять each type is crucial for building efficient applications. This comprehensive guide explores the practical scenarios where each Redis data type shines, from basic string operations to advanced...

Redis List Data Structure Operations

Redis List Data Structure Redis lists are string-based collections that maintain insertion order. Elements can be added to either the head (left) or tail (right) of a list. A Redis list can hold up to 2^32 - 1 elements, enabling storage of more than 4 billion items per list. Getting Help for List Co...

Managing Redis Cache Issues and Monitoring Key Metrics

Overview of Four Common Redis Cache Problems Problem Symptom Mitigation Approach Remarks Cache Warm-Up Service crashes shortly after launch Load hot entries first; accelerate loading; sync master-slave data Requires routine hot-entry analysis Cache Avalanche Mass expiration of keys → DB overload Mul...

Redis Connection Pooling and Cache Operations in .NET

This example demonstrates a production-ready Redis integration in C# using connection pooling and generic cache operations. The implementation separates concerns across three core components: connection management, cache abstraction, and application usage. Application Entry Point namespace RedisDemo...

Java Development: RocketMQ Consumer Message Idempotent Deduplication

A production-ready generic utility class for RocketMQ consumer message idempotent deduplication, with no additional configuration overhead beyond basic setup. Core Capabilities Supports using Redis or MySQL as the idempotent record storage layer Flexible deduplication key options: use business prima...

Understanding and Managing Redis Memory Fragmentation

Defining Memory FragmentationWhen Redis deallocates memory, the freed space is not immediately returned to the operating system. Instead, it remains under the control of the underlying memory allocator. A critical issue arises when these released blocks are non-contiguous. While technically free, th...

Implementing a Red Packet Rain System with Redis and Lua

In 2018, live quiz shows like Wang Sicong's "Chongding Dahui," Xigua Video's "Million Heroes," and Inke's "Cheese Superman" became wildly popular. An e-commerce company I worked for joined this trend, and the tech team developed a live quiz feature. After a quiz ended,...

Implementing Redis Caching in Django

Establishing a Redis Connection Pool To efficiently manage connections to a Redis server, it's best practice to use a connection pool. This avoids the overhead of establishing a new connection for every request. import redis # Define the Redis connection pool configuration redis_pool = redis.Connect...

Implementing Automatic Master-Slave Failover for Redis High Availability on Two Servers

Redis Deployment Options When deploying Redis, several common approaches are available: Approach Advantages Disadvantages Single Server Simple deployment, only one server required Service unavailable if the server fails Sentinel Mode Can continue service when less than half of nodes are unreachable...