{"id":29072743,"url":"https://github.com/praying/prism","last_synced_at":"2025-06-27T14:08:47.476Z","repository":{"id":298439872,"uuid":"999578674","full_name":"Praying/prism","owner":"Praying","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-11T04:58:59.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-11T05:35:38.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Praying.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-10T13:17:09.000Z","updated_at":"2025-06-11T04:58:04.000Z","dependencies_parsed_at":"2025-06-11T05:35:50.007Z","dependency_job_id":"dd62b0c6-d90c-49d7-a70c-43eb3a740b4d","html_url":"https://github.com/Praying/prism","commit_stats":null,"previous_names":["praying/prism"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Praying/prism","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praying%2Fprism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praying%2Fprism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praying%2Fprism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praying%2Fprism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Praying","download_url":"https://codeload.github.com/Praying/prism/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praying%2Fprism/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262270426,"owners_count":23285165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-27T14:08:46.551Z","updated_at":"2025-06-27T14:08:47.463Z","avatar_url":"https://github.com/Praying.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prism\n\n```\n  ____  _     _     _     __  __\n |  _ \\| |__ (_) __| | __|  \\/  |\n | |_) | '_ \\| |/ _` |/ _` |\\/| |\n |  __/| | | | | (_| | (_| |  | |\n |_|   |_| |_|_|\\__,_|\\__,_|  |_|\n\n```\n\nA lightweight, high-performance, and powerful cache proxy for Redis and Memcache, written in Rust.\n\n[![GitHub Actions Status](https://github.com/Praying/prism/actions/workflows/rust.yml/badge.svg)](https://github.com/Praying/prism/actions)\n[![Crates.io](https://img.shields.io/crates/v/prism-proxy.svg)](https://crates.io/crates/prism-proxy)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n\nPrism is a versatile cache proxy that supports multiple protocols and proxying models, designed to be a drop-in replacement for services like [Twemproxy](https://github.com/twitter/twemproxy) with added features and superior performance.\n\n## 🌟 Features\n\n*   **High Performance:** Built with Rust, offering exceptional speed and low resource consumption.\n*   **Multiple Protocols:** Supports Memcache, Redis (standalone), and Redis Cluster protocols.\n*   **Flexible Proxy Models:**\n    *   **Proxy Mode:** Standard proxying, compatible with Twemproxy.\n    *   **Cluster Mode:** Allows non-cluster Redis clients to seamlessly connect to a Redis Cluster. (Inspired by [Corvus](https://github.com/eleme/corvus))\n*   **Connection Pooling:** Efficiently manages connections to backend servers.\n*   **Health Checking:** Actively pings backend nodes and can automatically eject failed nodes.\n*   **Read from Slave:** Supports read balancing from slave nodes in a Redis setup.\n*   **Configuration Hot-Reload:** Configuration can be reloaded without service interruption.\n\n## 🚀 Getting Started\n\n### Prerequisites\n\nYou need to have the Rust toolchain installed. If you don't have it, you can install it via [rustup](https://rustup.rs/).\n\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n### Build \u0026 Run\n\n1.  Clone the repository:\n    ```bash\n    git clone https://github.com/path-to-your-repo/prism.git\n    cd prism\n    ```\n\n2.  Build the project in release mode:\n    ```bash\n    cargo build --release\n    ```\n\n3.  Run Prism with a configuration file:\n    ```bash\n    RUST_LOG=info RUST_BACKTRACE=1 ./target/release/prism default.toml\n    ```\n    *   `RUST_LOG=info`: Sets the logging level.\n    *   `RUST_BACKTRACE=1`: Shows a backtrace on panic.\n\n## ⚙️ Configuration\n\nPrism uses a TOML file for configuration. Here is an example demonstrating the main options.\n\n```toml\n# default.toml\n\n# You can define multiple clusters. Each will listen on a different port.\n[[clusters]]\n# A unique name for the cluster.\nname = \"test-redis-cluster\"\n\n# The address and port for the proxy to listen on.\nlisten_addr = \"0.0.0.0:9001\"\n\n# The type of backend cache.\n# Supported values: \"memcache\", \"redis\", \"redis_cluster\"\ncache_type = \"redis_cluster\"\n\n# Backend server list. The format depends on `cache_type`.\n#\n# For `cache_type = \"redis_cluster\"`, list seed nodes:\nservers = [\"127.0.0.1:7000\", \"127.0.0.1:7001\"]\n#\n# For `cache_type = \"redis\"` or `\"memcache\"`, use the format \"${addr}:${weight} ${alias}\":\n# servers = [\n#     \"127.0.0.1:7001:10 redis-1\",\n#     \"127.0.0.1:7002:10 redis-2\",\n# ]\n\n# Number of worker threads. It's recommended to set this to the number of CPU cores.\nthread = 4\n\n# Socket read timeout in milliseconds.\nread_timeout = 2000\n\n# Socket write timeout in milliseconds.\nwrite_timeout = 2000\n\n\n############################\n# Cluster Mode Configuration\n############################\n# (Only for `cache_type = \"redis_cluster\"`)\n\n# How often to fetch cluster topology information, in seconds. Default is 600.\nfetch = 600\n\n# Enable to allow read commands to be sent to slave nodes for load balancing.\nread_from_slave = true\n\n\n##########################\n# Proxy Mode Configuration\n##########################\n# (Only for `cache_type = \"redis\"` or `\"memcache\"`)\n\n# The node will be ejected after this many consecutive ping failures.\n# Set to 0 to disable health checking and ejection.\nping_fail_limit = 3\n\n# The interval for pinging backend nodes, in milliseconds.\nping_interval = 10000\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue.\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgements\n\nPrism is a fork of and inspired by [aster](https://github.com/wayslog/aster), originally created by [wayslog](https://github.com/wayslog). We are grateful for their foundational work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpraying%2Fprism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpraying%2Fprism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpraying%2Fprism/lists"}