[RFC] Database governance-DatabaseEndpoint CRD for a physical database l | 数据库治理-数据库端点
Closed this issue · 0 comments
mlycore commented
domain: database
Umbrella issue: #15
DatabaseEndpoint
defines a physical database instance which could be connected and consumed by application via VirtualDatabase
.
(English version TBD...)
在数据库治理中,通过 VirtualDatabase 向应用声明了可以使用的逻辑数据库,而数据的真实存储则依赖于这样的一个物理的数据库,这里称为数据库访问端点,即 DatabaseEndpoint。DatabaseEndpoint 对应用无感知,它只能被 VirtualDatabase 通过特定治理策略所绑定然后连接和使用。这里以读写分离为例:
- database: 表示一个数据库访实例,需要的信息有:
- MySQL: 表示当前声明一个 MySQL 协议的数据库
一个基础的 YAML 示例:
apiVersion: database.opensergo.io/v1alpha1
kind: DatabaseEndpoint
metadata:
name: write_ds
spec:
database:
MySQL: # 声明后端数据源的类型及相关信息
url: jdbc:mysql://192.168.1.110:3306/demo_write_ds?serverTimezone=UTC&useSSL=false
username: root
password: root
connectionTimeout: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
---
apiVersion: database.opensergo.io/v1alpha1
kind: DatabaseEndpoint
metadata:
name: ds_0
spec:
database:
MySQL: # 声明后端数据源的类型及相关信息
url: jdbc:mysql://192.168.1.110:3306/demo_read_ds_0?serverTimezone=UTC&useSSL=false
username: root
password: root
connectionTimeout: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
---
apiVersion: database.opensergo.io/v1alpha1
kind: DatabaseEndpoint
metadata:
name: ds_1
spec:
database:
MySQL: # 声明后端数据源的类型及相关信息
url: jdbc:mysql://192.168.1.110:3306/demo_read_ds_1?serverTimezone=UTC&useSSL=false
username: root
password: root
connectionTimeout: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1