Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,13 @@ Apache ShardingSphere 为不同的运行模式提供了不同的元数据持久

### 数据库持久化

`provider` 的可选值为 H2,MySQL,EmbeddedDerby,DerbyNetworkServer,HSQLDB。
`provider` 的可选值为 H2,MySQLHSQLDB。
由于第三方的 Vulnerability Report 时常误报 H2 Database,避免在 ShardingSphere Standalone Mode 使用 H2 Database 可能是一种选择。
讨论 `provider` 不为默认值 `H2` 的情况。

1. 若 `provider` 设置为 `MySQL`,则要求存在已就绪的 MySQL Server。classpath 应包含 `com.mysql:mysql-connector-j:9.0.0` 的 Maven 依赖。
2. 若 `provider` 设置为 `EmbeddedDerby`,则 Derby 数据库引擎将在与应用程序相同的 JVM 内运行。
classpath 应包含 `org.apache.derby:derby:10.17.1.0` 和 `org.apache.derby:derbytools:10.17.1.0` 的 Maven 依赖,
且要求编译或运行下游项目的 JDK 版本大于或等于 JDK19。可能的配置如下。

```yaml
mode:
type: Standalone
repository:
type: JDBC
props:
provider: EmbeddedDerby
jdbc_url: jdbc:derby:memory:config;create=true
username:
```

3. 若 `provider` 设置为 `DerbyNetworkServer`,则要求存在已就绪的 Derby Network Server。
Derby Network Server 不存在可用的 Docker Image,用户可能需要手动启动 Derby Network Server。
classpath 应包含 `org.apache.derby:derbyclient:10.17.1.0` 和 `org.apache.derby:derbytools:10.17.1.0` 的 Maven 依赖,
且要求编译或运行下游项目的 JDK 版本大于或等于 JDK19。
4. 若 `provider` 设置为 `HSQLDB`,则要求存在已就绪的采用 Server Modes 的 HyperSQL,或以 in-process database 的方式创建数据库。
2. 若 `provider` 设置为 `HSQLDB`,则要求存在已就绪的采用 Server Modes 的 HyperSQL,或以 in-process database 的方式创建数据库。
classpath 应包含 `classifier` 为 `jdk8` 的 `org.hsqldb:hsqldb:2.7.3` 的 Maven 依赖。
采用 Server Modes 的 HyperSQL 不存在可用的 Docker Image,用户可能需要手动启动 Server Modes 的 HyperSQL。
若使用 mem: protocol 的 HyperSQL,则可能的配置如下,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,13 @@ Apache ShardingSphere provides different metadata persistence methods for differ

### Database Repository

The optional values of `provider` are H2, MySQL, EmbeddedDerby, DerbyNetworkServer and HSQLDB.
The optional values of `provider` are H2, MySQL and HSQLDB.
Since third-party Vulnerability Reports often misreport H2 Database, avoiding the use of H2 Database in ShardingSphere Standalone Mode may be an option.
Discuss the case where `provider` is not the default value `H2`.

1. If `provider` is set to `MySQL`, a ready MySQL Server is required. The classpath should contain the Maven dependency of `com.mysql:mysql-connector-j:9.0.0`.
2. If `provider` is set to `EmbeddedDerby`, the Derby database engine will run in the same JVM as the application.
The classpath should contain Maven dependencies of `org.apache.derby:derby:10.17.1.0` and `org.apache.derby:derbytools:10.17.1.0`,
and the JDK version required to compile or run the downstream project is greater than or equal to JDK19. Possible configurations are as follows.

```yaml
mode:
type: Standalone
repository:
type: JDBC
props:
provider: EmbeddedDerby
jdbc_url: jdbc:derby:memory:config;create=true
username:
```

3. If `provider` is set to `DerbyNetworkServer`, a ready Derby Network Server is required.
There is no available Docker Image for Derby Network Server, and users may need to start Derby Network Server manually.
The classpath should contain Maven dependencies of `org.apache.derby:derbyclient:10.17.1.0` and `org.apache.derby:derbytools:10.17.1.0`,
and the JDK version required to compile or run the downstream project is greater than or equal to JDK19.
4. If `provider` is set to `HSQLDB`, a ready HyperSQL using Server Modes is required, or a database is created as an in-process database.
2. If `provider` is set to `HSQLDB`, a ready HyperSQL using Server Modes is required, or a database is created as an in-process database.
The classpath should contain the Maven dependency of `org.hsqldb:hsqldb:2.7.3` with `classifier` as `jdk8`.
There is no available Docker Image for HyperSQL using Server Modes, and users may need to manually start HyperSQL using Server Modes.
If HyperSQL using mem: protocol is used, the possible configuration is as follows,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11598,18 +11598,6 @@
},
"glob": "sql"
},
{
"condition": {
"typeReached": "org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader"
},
"glob": "sql/DerbyNetworkServer.xml"
},
{
"condition": {
"typeReached": "org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader"
},
"glob": "sql/EmbeddedDerby.xml"
},
{
"condition": {
"typeReached": "org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class JDBCRepositorySQLLoaderTest {
@Test
void assertLoad() {
assertThat(JDBCRepositorySQLLoader.load("MySQL").getType(), is("MySQL"));
assertThat(JDBCRepositorySQLLoader.load("EmbeddedDerby").getType(), is("EmbeddedDerby"));
assertThat(JDBCRepositorySQLLoader.load("DerbyNetworkServer").getType(), is("DerbyNetworkServer"));
assertThat(JDBCRepositorySQLLoader.load("HSQLDB").getType(), is("HSQLDB"));
}

Expand Down
Loading