Skip to content

Commit

Permalink
Add OceanBase to the list of supported metadata databases (juicedata#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wpleonardo authored Dec 2, 2024
1 parent 4826ace commit b63efb6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 121 deletions.
Binary file modified docs/en/images/juicefs-aliyun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 4 additions & 52 deletions docs/en/reference/how_to_set_up_metadata_engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ Additional parameters can be appended to the metadata URL. More details can be s

[MySQL](https://www.mysql.com) is one of the most popular open source relational databases, and is often preferred for web applications.

>[MariaDB](https://mariadb.org) is an open source branch of MySQL, maintained by the original developers of MySQL. Because MariaDB is highly compatible with MySQL, there is no difference in set up Meta engine, the parameters and settings are exactly the same.
>
>[OceanBase](https://en.oceanbase.com/) is a self-developed distributed relational database designed for processing massive data and high-concurrency transactions. It features high performance, strong consistency, and high availability. At the same time, OceanBase is highly compatible with MySQL, and there is no difference in the method of setting the metadata engine.
### Create a file system

When using MySQL as the metadata storage engine, you need to create a database manually before create the file system. The command with the following format is usually used to access the database:
Expand Down Expand Up @@ -316,58 +320,6 @@ juicefs mount -d "mysql://user:mypassword@(192.168.1.6:3306)/juicefs?tls=true" /

For more examples of MySQL database address format, please refer to [Go-MySQL-Driver](https://github.com/Go-SQL-Driver/MySQL/#examples).

## MariaDB

[MariaDB](https://mariadb.org) is an open source branch of MySQL, maintained by the original developers of MySQL.

Because MariaDB is highly compatible with MySQL, there is no difference in usage, the parameters and settings are exactly the same.

For example:

```shell
juicefs format \
--storage s3 \
... \
"mysql://user:mypassword@(192.168.1.6:3306)/juicefs" \
pics
```

```shell
juicefs mount -d "mysql://user:mypassword@(192.168.1.6:3306)/juicefs" /mnt/jfs
```

Passing passwords through environment variables is also the same:

```shell
export META_PASSWORD="mypassword"
juicefs format \
--storage s3 \
... \
"mysql://user@(192.168.1.6:3306)/juicefs" \
pics
```

```shell
juicefs mount -d "mysql://user@(192.168.1.6:3306)/juicefs" /mnt/jfs
```

To connect to a TLS enabled MariaDB server, pass the `tls=true` parameter (or `tls=skip-verify` if using a self-signed certificate):

```shell
export META_PASSWORD="mypassword"
juicefs format \
--storage s3 \
... \
"mysql://user@(192.168.1.6:3306)/juicefs?tls=true" \
pics
```

```shell
juicefs mount -d "mysql://user@(192.168.1.6:3306)/juicefs?tls=true" /mnt/jfs
```

For more examples of MariaDB database address format, please refer to [Go-MySQL-Driver](https://github.com/Go-SQL-Driver/MySQL/#examples).

## SQLite

[SQLite](https://sqlite.org) is a widely used small, fast, single-file, reliable and full-featured SQL database engine.
Expand Down
18 changes: 9 additions & 9 deletions docs/en/tutorials/aliyun.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The metadata is stored completely independently. Retrieval and processing of fil

This design can effectively reduce the cost of the object storage in terms of the number of requests. It also allows users to significantly experience the performance improvement brought by JuiceFS.

![JuiceFS-arch-new](../images/juicefs-arch-new.png)
![JuiceFS-arch-new](../images/juicefs-aliyun.png)

This document introduces how to use JuiceFS on Alibaba Cloud.

Expand Down Expand Up @@ -43,9 +43,9 @@ In terms of operating system, JuiceFS can be installed on all operating systems

### Cloud database

JuiceFS stores all the metadata corresponding to the data in a separate database, which currently supports Redis, MySQL, PostgreSQL, and SQLite.
JuiceFS stores all the metadata corresponding to the data in a separate database, which currently supports Redis, MySQL, PostgreSQL, SQLite, and OceanBase.

Depending on the database type, the performance and reliability of metadata are different. For example, Redis runs entirely in memory. While it provides the ultimate performance, it is difficult to operate and maintain and has low reliability. SQLite is a single-file relational database with low performance and is not suitable for large-scale data storage. However, it is configuration-free and suitable for a small amount of data storage on a single machine.
Depending on the database type, the performance and reliability of metadata are different. For example, Redis runs entirely in memory. While it provides the ultimate performance, it is difficult to operate and maintain and has low reliability. SQLite is a single-file relational database with low performance and is not suitable for large-scale data storage. However, it is configuration-free and suitable for a small amount of data storage on a single machine. In contrast, OceanBase is a distributed relational database that delivers high performance while ensuring data consistency and high reliability (RTO < 8 seconds). It is particularly well-suited for scenarios in industries such as finance, retail, and telecommunications, where transactional consistency and distributed capabilities are critical. By integrating with JuiceFS, OceanBase enhances the efficiency, reduces the latency, and improves the stability of handling massive metadata, meeting the demanding requirements of modern distributed storage systems for underlying databases.

If you just want to evaluate the functionality of JuiceFS, you can build the database manually on ECS. If you want to use JuiceFS in a production environment, and you don't have a professional database operation and maintenance team, the cloud database service is usually a better choice.

Expand All @@ -55,12 +55,12 @@ If you must access the database through the public network, you can enhance the

On the other hand, if you cannot successfully connect to the cloud database through the public network, you can check the whitelist of the database.

| Database | Redis | MySQL/PostgreSQL | SQLite |
| :-------------: | :-----------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| **Performance** | High | Medium | Low |
| **Management** | High | Medium | Low |
| **Reliability** | Low | Medium | Low |
| **Scenario** | Massive data, distributed high-frequency reads and writes | Massive data, distributed low- and medium-frequency reads and writes | Low-frequency reads and writes in single machine for small amounts of data |
| Database | Redis | MySQL/PostgreSQL | SQLite | OceanBase |
| :-------------: | :-----------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| **Performance** | High | Medium | Low | High |
| **Management** | High | Medium | Low | Medium |
| **Reliability** | Low | Medium | Low | High |
| **Scenario** | Massive data, distributed high-frequency reads and writes | Massive data, distributed low- and medium-frequency reads and writes | Low-frequency reads and writes in single machine for small amounts of data | Distributed scenarios, strong transaction consistency, and high reliability requirements |

**This document uses [ApsaraDB for Redis](https://www.alibabacloud.com/product/apsaradb-for-redis), and the following pseudo address is compiled for demonstration purposes only:**

Expand Down
Binary file modified docs/zh_cn/images/juicefs-aliyun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 4 additions & 52 deletions docs/zh_cn/reference/how_to_set_up_metadata_engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ juicefs format \

[MySQL](https://www.mysql.com) 是受欢迎的开源关系型数据库之一,常被作为 Web 应用程序的首选数据库。

>[MariaDB](https://mariadb.org) 是 MySQL 的一个开源分支,由 MySQL 原始开发者维护并保持开源,与 MySQL 高度兼容,在设置元数据引擎方法上也没有任何差别。
>
>[OceanBase](https://www.oceanbase.com/)是一款自主研发的分布式关系型数据库,专为处理海量数据和高并发事务而设计,具备高性能、强一致性和高可用性的特点。同时,OceanBase与 MySQL 高度兼容,在设置元数据引擎方法上也没有任何差别。
### 创建文件系统

使用 MySQL 作为元数据存储引擎时,需要提前手动创建数据库,通常使用以下格式访问数据库:
Expand Down Expand Up @@ -332,58 +336,6 @@ juicefs mount -d "mysql://user:mypassword@(192.168.1.6:3306)/juicefs?tls=true" /

更多 MySQL 数据库的地址格式示例,[点此查看](https://github.com/Go-SQL-Driver/MySQL/#examples)

## MariaDB

[MariaDB](https://mariadb.org) 是 MySQL 的一个开源分支,由 MySQL 原始开发者维护并保持开源。

MariaDB 与 MySQL 高度兼容,在使用上也没有任何差别,同样需要提前创建数据库,创建和挂载文件系统时,保持与 MySQL 相同的语法。

例如:

```shell
juicefs format \
--storage s3 \
... \
"mysql://user:mypassword@(192.168.1.6:3306)/juicefs" \
pics
```

```shell
juicefs mount -d "mysql://user:mypassword@(192.168.1.6:3306)/juicefs" /mnt/jfs
```

通过环境变量传递密码的方式也完全一致:

```shell
export META_PASSWORD="mypassword"
juicefs format \
--storage s3 \
... \
"mysql://user@(192.168.1.6:3306)/juicefs" \
pics
```

```shell
juicefs mount -d "mysql://user@(192.168.1.6:3306)/juicefs" /mnt/jfs
```

要连接到启用 TLS 的 MySQL 服务器,请传递 `tls=true` 参数(或 `tls=skip-verify` 如果使用自签名证书):

```shell
export META_PASSWORD="mypassword"
juicefs format \
--storage s3 \
... \
"mysql://user@(192.168.1.6:3306)/juicefs?tls=true" \
pics
```

```shell
juicefs mount -d "mysql://user@(192.168.1.6:3306)/juicefs?tls=true" /mnt/jfs
```

更多 MariaDB 数据库的地址格式示例,[点此查看](https://github.com/Go-SQL-Driver/MySQL/#examples)

## SQLite

[SQLite](https://sqlite.org) 是全球广泛使用的小巧、快速、单文件、可靠、全功能的单文件 SQL 数据库引擎。
Expand Down
16 changes: 8 additions & 8 deletions docs/zh_cn/tutorials/aliyun.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ JuiceFS 默认会占用不超过 1GB 的硬盘空间作为缓存,可以根据

### 二、云数据库

JuiceFS 会将数据对应的元数据全部存储在独立的数据库中,目前已开放支持的数据库有 Redis、MySQL、PostgreSQLSQLite。
JuiceFS 会将数据对应的元数据全部存储在独立的数据库中,目前已开放支持的数据库有 Redis、MySQL、PostgreSQLSQLite,以及 OceanBase

根据数据库类型的不同,带来的元数据性能和可靠性表现也各不相同。比如 Redis 是完全运行在内存上的,它能提供极致的性能,但运维难度较高,可靠性相对低。而 MySQL、PostgreSQL 是关系型数据库,性能不如 Redis,但运维难度不高,可靠性也有一定的保障。SQLite 是单机单文件关系型数据库,性能较低,也不适合用于大规模数据存储,但它免配置,适合单机少量数据存储的场景。
根据数据库类型的不同,带来的元数据性能和可靠性表现也各不相同。比如 Redis 是完全运行在内存上的,它能提供极致的性能,但运维难度较高,可靠性相对低。而 MySQL、PostgreSQL 是关系型数据库,性能不如 Redis,但运维难度不高,可靠性也有一定的保障。SQLite 是单机单文件关系型数据库,性能较低,也不适合用于大规模数据存储,但它免配置,适合单机少量数据存储的场景。相比之下,OceanBase 是一款分布式关系型数据库,能够在提供高性能的同时,确保数据的一致性和高可靠性(RTO < 8s)。它特别适合金融、零售、电信等对事务一致性和分布式能力要求较高的场景,使 JuiceFS 在处理海量元数据时可以实现更高效率、更低延迟和更强稳定性,从而满足现代分布式存储系统对底层数据库的苛刻要求。

如果只是为了评估 JuiceFS 的功能,你可以在 ECS 云服务器手动搭建数据库使用。当你要在生产环境使用 JuiceFS 时,如果没有专业的数据库运维团队,阿里云的云数据库服务通常是更好的选择。

当然,如果你愿意,也可以使用其他云平台上提供的云数据库服务。但在这种情况下,你只能通过公网访问云数据库,也就是说,你必须向公网暴露数据库的端口,这存在极大的安全风险,最好不要这样使用。

如果必须通过公网访问数据库,可以通过云数据库控台提供的白名单功能,严格限制允许访问数据库的 IP 地址,从而提升数据的安全性。从另一个角度说,如果你通过公网无法成功连接云数据库,那么可以检查数据库的白名单,检查是不是该设置限制了你的访问。

| 数据库 | Redis | MySQL、PostgreSQL | SQLite |
| :----------: | :----------------------: | :------------------------: | :--------------------: |
| **性能** || 适中 ||
| **运维门槛** || 适中 ||
| **可靠性** || 适中 ||
| **应用场景** | 海量数据、分布式高频读写 | 海量数据、分布式中低频读写 | 少量数据单机中低频读写 |
| 数据库 | Redis | MySQL、PostgreSQL | SQLite | OceanBase |
| :----------: | :----------------------: | :------------------------: | :--------------------: | :---------------------: |
| **性能** || 适中 |||
| **运维门槛** || 适中 || 适中 |
| **可靠性** || 适中 |||
| **应用场景** | 海量数据、分布式高频读写 | 海量数据、分布式中低频读写 | 少量数据单机中低频读写 | 分布式场景、强事务一致性、高可靠性要求 |

**本文使用了[云数据 Redis 版](https://www.aliyun.com/product/kvstore),以下连接地址只是为了演示目的编制的伪地址:**

Expand Down

0 comments on commit b63efb6

Please sign in to comment.