Documentation v1.0.0

pardnchiu/go-redis-fallback

[!NOTE] This README was generated by SKILL, get the ZH version from here.


KEEP READING WHEN REDIS GOES DOWN!

Go Reference Release License Coverage


A Go library with three-tier read fallback, health-check auto-recovery, and TTL-preserving Redis resync

Table of Contents

Features

go get github.com/pardnchiu/go-redis-fallback · Documentation

Architecture

Full Architecture

graph TB
    Get[Get] --> Mode{Health State}
    Mode -->|Normal| Mem1[Memory Cache]
    Mem1 -->|Miss| Redis[(Redis with MaxRetry)]
    Mem1 -->|Hit| Repair[Background write-back to Redis]
    Redis -->|Retries exhausted| Fallback[Switch to Fallback Mode]
    Mode -->|Fallback| Mem2[Memory Cache]
    Fallback --> Mem2
    Mem2 -->|Miss| File[Local JSON File]
    Fallback --> Checker[Health-Check Ticker]
    Checker -->|Ping OK| Recover[Resync Redis and Remove Files]

License

This project is licensed under the MIT LICENSE.

Author

Just open an issue to share an idea.

go-redis-fallback contributors

©️ 2025 邱敬幃 Pardn Chiu

中文