Skip to content

Commit d2d3d93

Browse files
authored
Fixed #30, Add more introduction to README_CN.md (#36)
1 parent 2558079 commit d2d3d93

File tree

2 files changed

+52
-14
lines changed

2 files changed

+52
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Dify for MySQL
1+
# Dify on MySQL
22

33
English | [简体中文](README_CN.md)
44

5-
## Why fork
5+
## Backgroud
66

77
Beginning in October 2024, we initiated a collaboration with the Dify Team. Given that MySQL is one of the most widely used databases worldwide, many users have expressed a strong desire for Dify to support MySQL. At the same time, owing to OceanBase’s high compatibility with MySQL, we submitted a pull request to the Dify project to introduce MySQL support. However, due to the Dify team’s ongoing commitments to their internal development milestones, they were unable to incorporate this contribution at the time.
88

@@ -26,7 +26,7 @@ OceanBase, as a distributed database, offers seamless scalability by allowing ne
2626
### AI enhancement
2727
Given that OceanBase also functions as a vector database, it offers powerful hybrid search capabilities. This enables support for multiple data types—including vector data, scalar data (traditional structured data in relational tables), GIS, and full-text content—within a single query.
2828

29-
Such integration enhances both the accuracy and performance of AI-driven queries, making it particularly valuable for Retrieval-Augmented Generation (RAG) systems.
29+
Such integration enhances both the accuracy and performance of AI-driven queries(Consolidate multiple past queries into a single query and leverage the optimizer to select the optimal execution path), making it particularly valuable for Retrieval-Augmented Generation (RAG) systems.
3030

3131
### Reduce Cost
3232
By replacing all databases currently used in Dify—including PostgreSQL, Weaviate, and Redis—with OceanBase, users can achieve more efficient resource utilization and significantly reduce hardware costs.

README_CN.md

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,63 @@
1-
# Dify for MySQL
1+
# Dify on MySQL
22

33
[English](README.md) | 简体中文
44

5-
这是一个 [https://github.com/langgenius/dify](https://github.com/langgenius/dify) 的 fork,我们基于原始的 Dify 项目进行了一些修改,使其能够使用 MySQL 作为基础数据库,同时可以使用mysql cache作为缓存。
5+
## 项目背景
66

7-
本分支基于历史版本 [https://github.com/oceanbase-devhub/dify](https://github.com/oceanbase-devhub/dify),自 Dify 1.1.0 开始更新,后续将在官方社区加入 MySQL 适配前进行定期发布。
7+
自2024年10月起,我们开始与 Dify 团队展开合作。考虑到 MySQL 是全球应用最广泛的关系型数据库之一,许多用户强烈希望 Dify 能够支持 MySQL。同时,由于 OceanBase 与 MySQL 具有高度兼容性,我们向 Dify 项目提交了支持 MySQL pull request。但由于 Dify 团队当时正专注于内部开发里程碑的工作,暂时无法处理这项贡献。
8+
9+
此外,通过与众多 Dify 用户的深入交流,我们发现市场对多项企业级功能存在强烈需求。幸运的是,OceanBase 能够提供这些能力。因此,我们持续自主维护并增强该分支功能,以满足这些企业级需求。
10+
11+
## 欢迎贡献
12+
13+
欢迎任何建议,并感谢所有的贡献。
14+
15+
## 核心优势
16+
17+
这个分支提供以下企业级特性:
18+
19+
### 高可用性
20+
21+
在生产环境中,系统必须提供 7x24 小时不间断服务。数据库作为整个系统的核心组件,其任何故障都可能严重影响服务可用性。
22+
23+
OceanBase 通过 Paxos 共识协议保障高可用性。在生产环境中以集群模式部署时,即使单台服务器甚至多台服务器发生故障,只要集群中多数派仍然运行,OceanBase 仍能始终保持服务状态,确保无任何数据丢失(RPO = 0),并实现故障恢复时间在8秒以内(RTO < 8)。
24+
25+
### 可扩展性
26+
27+
随着运行时间的累积,数据库中存储的数据量持续增长。在传统数据库系统中,一旦数据量超过单台机器的容量限制,扩展就变得极具挑战性。
28+
29+
OceanBase 作为一款流行的分布式数据库,通过向集群添加新的节点来提供无限扩展能力。系统实现了数据和负载的自动重新平衡,整个过程对应用程序完全透明。
30+
31+
### AI 增强
32+
33+
鉴于 OceanBase 也是一款流行的向量数据库,它提供了强大的混合查询能力。这使得在单个查询中可以同时处理多种数据类型,包括向量数据、标量数据(关系表中的传统结构化数据)、GIS 和全文索引。
34+
35+
这种混合查询能力不仅可以帮助提升 AI 查询性能(将过去的多次查询融合为单次查询, 并利用优化器选择最优执行路径),更为关键的是,通过混合查询可以提升查询的准确度(召回率),特别是在检索增强生成(RAG)系统中发挥更大的价值。
36+
37+
### 降低成本
38+
39+
通过用 OceanBase 替换当前 Dify 使用的所有数据库(包括 PostgreSQL、Weaviate 和 Redis),用户可以实现更高效的资源利用,并显著降低硬件成本。
40+
41+
此外,这种整合简化了数据库运维操作,从运维三套系统减少到只运维一套系统,从而大幅简化了维护工作并降低了操作复杂性。
42+
43+
### 多租户支持
44+
45+
由于 OceanBase 原生支持多租户,Dify 用户现在可以通过 OceanBase 的多租户功能在应用层面实现多租户,而不会影响 Dify 现有的多租户规则。
846

947
## 安装社区版
1048

1149
### 系统要求
1250

1351
在安装 Dify 之前,请确保您的机器满足以下最低系统要求:
1452

15-
- CPU >= 2 Core
16-
- RAM >= 4 GiB
53+
- CPU >= 2
54+
- 内存 >= 8 GiB
1755

1856
### 快速启动
1957

2058
启动 Dify 服务器的最简单方法是运行我们的 [docker-compose.yaml](docker/docker-compose.yaml) 文件。
2159

22-
在运行安装命令之前,请确保您的机器上安装了 [Docker](https://docs.docker.com/get-docker/)[Docker Compose](https://docs.docker.com/compose/install/)
60+
在运行安装命令之前,请确保您的机器上已安装 [Docker](https://docs.docker.com/get-docker/)[Docker Compose](https://docs.docker.com/compose/install/)
2361

2462
启动服务的操作如下:
2563

@@ -30,14 +68,14 @@ docker compose up -d
3068
```
3169

3270
说明:
33-
- setup-mysql-env.sh 是一个设置参数的辅助脚本,它会根据用户输入设置数据库连接信息,并设置 OceanBase 作为 Vector Store
34-
- Dify 1.x 开始引入了插件系统,安装插件的过程会根据插件配置执行类似 `python install -r requirements.txt` 的命令为了加快安装速度,脚本中设置了 `PIP_MIRROR_URL` 为清华大学 Tuna 镜像源网站
35-
- 对于中国大陆用户,可以参考 https://github.com/dongyubin/DockerHub 设置 docker 镜像加速,以获得更好的镜像加载速度。
71+
- `setup-mysql-env.sh` 是一个设置参数的辅助脚本,它会根据用户输入设置数据库连接信息,并配置 OceanBase 作为向量存储
72+
- Dify 1.x 开始引入了插件系统,安装插件的过程会根据插件配置执行类似 `python install -r requirements.txt` 的命令为了加快安装速度,脚本中设置了 `PIP_MIRROR_URL` 为清华大学 Tuna 镜像源
73+
- 对于中国大陆用户,可以参考 https://github.com/dongyubin/DockerHub 设置 Docker 镜像加速,以获得更好的镜像加载速度。
3674

37-
运行后,可以在浏览器上访问 [http://localhost/install](http://localhost/install) 进入 Dify 控制台并开始初始化安装操作。
75+
运行后,可以在浏览器中访问 [http://localhost/install](http://localhost/install) 进入 Dify 控制台并开始初始化安装操作。
3876

3977
更多关于 Dify 使用的信息请参考 [https://dify.ai](https://dify.ai)
4078

41-
## License
79+
## 许可证
4280

4381
本仓库遵循 [Dify Open Source License](LICENSE) 开源协议,该许可证本质上是 Apache 2.0,但有一些额外的限制。

0 commit comments

Comments
 (0)