> For the complete documentation index, see [llms.txt](https://docs.zongsoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zongsoft.com/framework/externals/projects/redis.md).

# Redis (redis)

Redis 项目的能力范围、部署产物、接入入口与使用边界。

把 Redis 接入缓存、序号、分布式锁、消息流、配置和可靠消息存储。各项能力共用基础设施，但有不同的契约与一致性边界。

| 项目项  | 值                                           |
| ---- | ------------------------------------------- |
| 源码目录 | `externals/redis`                           |
| 主包   | `Zongsoft.Externals.Redis`                  |
| 配套主题 | [缓存与分布式协作](/framework/externals/caching.md) |

## 部署与使用入口

将主包追加到已有宿主的[部署清单](/references/deploy-files.md)，并保留包中的插件清单、程序集及附属运行资源：

{% code title="Application.deploy（追加片段）" %}

```ini
[plugins zongsoft externals redis]
nuget:Zongsoft.Externals.Redis
```

{% endcode %}

普通连接位于 `/Externals/Redis/ConnectionSettings`，驱动及提供者别名为 `Redis`。例如 “连接名@Redis” 由 Redis 提供者按指定连接名取得实例。

## 接入步骤

1. 按缓存专题配置独立测试连接，使用唯一键验证读写和清理。
2. 核对实际连接选择、数据库编号与键前缀，再按所需能力验证序号或锁。
3. 需要消息存储时，另按可靠性专题配置与 Broker 严格同名的连接及稳定存储身份。

具体配置、调用示例和相关基础概念见[缓存与分布式协作](/framework/externals/caching.md)。

## 项目边界

{% hint style="info" %}
💡 普通提供者可能回退默认连接，消息存储工厂则严格匹配 Broker 名。共享实例不应按请求释放或修改命名空间；键空间通知断线不重放，不能替代可靠事件日志。
{% endhint %}

## 继续阅读

[按项目浏览扩展](/framework/externals/projects.md) · [缓存与分布式协作](/framework/externals/caching.md) · [源码与项目说明](https://github.com/Zongsoft/framework/tree/main/externals/redis)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zongsoft.com/framework/externals/projects/redis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
