Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [RFC] Database governance-ConcurrecyControl CRD for concurrency control l | 数据库治理-并发控制 #33

Open
mlycore opened this issue Aug 25, 2022 · 0 comments
Labels
area/database-governance Category issues or PRs related to database governance kind/spec-RFC Issues or PRs for OpenSergo spec RFC

Comments

@mlycore
Copy link
Contributor

mlycore commented Aug 25, 2022

domain: database

Considering change domain to traffic

Umbrella issue: #15

ConcurrencyControl defines a set of rules help declare what to do while meeting some spike traffic.

(English version TBD...)


解决的是当具有某个属性特征的 SQL 出现时,对它的出现频率(并发度)进行控制,这样的 SQL 往往是慢 SQL 或者非常消耗资源的 SQL,放任它执行可能会导致关键业务 SQL 无法正常执行。

并发控制包括多种配置规则,比如由工程师根据经验预先设定的 SQL 属性特征,包括正则表达式和条件表达式两种。

在一些场景中,SQL 并发控制表现为开启和关闭两种状态,在开启的情况下,针对特定的 SQL 进行并发数量限制。对于开启状态的判断可以有多种方式,比如通过 Cron 表达式决定生效的时间段。

YAML 示例:

apiVersion: database.opensergo.io/v1alpha1
kind: ConcurrencyControl
metadata:
  name: order
spec:
  rules:
  - cron: "* * * * *"
     maxConcurrency: 1
     regex: # 基于正则表达式的
     - "^SELECT * FROM t_orders"
     conditions: # 基于条件表达式的
    - subject: column # column 列或 table 表
      op: in # 预算符,包括 in, eq, ne, notin 等
      values:
      - "items"
@mlycore mlycore changed the title [RFC] Database governance-ConcurrecyControl CRD for concurrency control l | 数据库治理-并发控制 WIP: [RFC] Database governance-ConcurrecyControl CRD for concurrency control l | 数据库治理-并发控制 Aug 25, 2022
@sczyh30 sczyh30 added kind/spec-RFC Issues or PRs for OpenSergo spec RFC area/database-governance Category issues or PRs related to database governance labels Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/database-governance Category issues or PRs related to database governance kind/spec-RFC Issues or PRs for OpenSergo spec RFC
Projects
None yet
Development

No branches or pull requests

2 participants