Library Search
结果页redis
在 元器件 / 技术栈 / 知识库 中找到 11 个匹配结果。
技术栈
技术栈
5 个 Redis ## 目标
通过 `redis-cli` 和 Python `redis` 库,完成 Redis 五种核心数据结构的操作,体验缓存加速效果。
## 环境准备
```bash
redis-cli ping # 确保返回 PONG
pip install redis
```
## 第一步:redis-cli 方式
```bash
redis-cli
```
```redis
# === St… 3% Celery hon 版本**: 3.8 及以上(推荐 3.10+)
- **消息代理**: Redis(推荐)或 RabbitMQ
- **结果后端(可选)**: Redis / PostgreSQL / 等
## 安装命令
```bash
# 基础安装
pip install celery
# 安装 Celery + Redis 全套
pip install celery redis
# 安装监控面… 3% Docker ronment:
- ENV=production
- REDIS_URL=redis://redis:6379
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
networks:
- app-network
re… 3% FastAPI cpg://user:pass@db:5432/fastapi
- REDIS_URL=redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
db:
image: po… 3% Flask he
cache = Cache(config={"CACHE_TYPE": "RedisCache", "CACHE_REDIS_URL": "redis://localhost:6379/2"})
@main_bp.route("/hot-posts")
@cache.cached(timeout=300) # 缓存 5 分钟
def hot_posts():
return jso… 2%
知识库
知识库
6 个 Hello World ## 目标
通过 `redis-cli` 和 Python `redis` 库,完成 Redis 五种核心数据结构的操作,体验缓存加速效果。
## 环境准备
```bash
redis-cli ping # 确保返回 PONG
pip install redis
```
## 第一步:redis-cli 方式
```bash
redis-cli
```
```redis
# === St… 3% Python 常用数据结构实战 # Redis Python 常用数据结构实战
## 目标
演示 Redis 五大核心数据结构:String、Hash、List、Set、Sorted Set,以及分布式锁。
## 环境准备
```bash
pip install redis
# 确保 Redis 运行
docker run -d --name redis -p 6379:6379 redis:7-alpine
```
##… 3% Dockerfile 与 Compose 实战 ronment:
- ENV=production
- REDIS_URL=redis://redis:6379
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
networks:
- app-network
re… 3% 从零入门到缓存架构实战 ## 1. 什么是 Redis?
Redis(Remote Dictionary Server)是一个**内存中的数据结构服务器**。它不是关系型数据库,而是提供了 Key-Value 存储 + 丰富数据结构的内存中间件。
### 与传统数据库的区别
| 维度 | MySQL | Redis |
|------|-------|-------|
| 存储 | 磁盘(持久) | **内存**(… 3% 02-进阶实战-WebSocket-后台任务-部署 cpg://user:pass@db:5432/fastapi
- REDIS_URL=redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
db:
image: po… 3% 02-进阶实战-Celery异步任务与部署 he
cache = Cache(config={"CACHE_TYPE": "RedisCache", "CACHE_REDIS_URL": "redis://localhost:6379/2"})
@main_bp.route("/hot-posts")
@cache.cached(timeout=300) # 缓存 5 分钟
def hot_posts():
return jso… 2%