You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dolphinscheduler.apache.org by C _ C <24...@qq.com> on 2020/07/04 07:09:22 UTC
[Summer 2020]Disscuss on process tags feature 工作流标签讨论
Dear all
l have two different designs for this task.Please read the designs and give me some advice on plan selection, thanks.
Goals:1 users can add, delete and modify tags.2 Select the process to add the created tags.3 Click the tags to display processes.
Plan Ⅰ
##Database Design
t_ds_process_definition
id【unique identifier】 name【process name】……
t_ds_process_to_tags
id 【unique identifier]】tag_id【tag id】process_id【workflow id】
t_ds_process_definiton_tags
id【unique identification】tag_name【tag name】
##Goal 1
Add tags: add a row of data in t_ds_process_definiton_tags
Modify tags: modify the tag_name of t_ds_process_definiton_tags
Delete tags: delete tag_name data of t_ds_process_definiton_tags, and delete the tag_id data of t_ds_process_to_tags
##Goal 2
1 Select the process and get the process_id.
2 select the tag and get the tag_id.
3 add a row of data in t_ds_process_to_tags.
## Goal 3
1 Query the tag_id corresponding to the tag_name at t_ds_process_definiton_tag
2 Query the process_id corresponding to the tag_id at t_ds_process_to_tags
3 Query the process corresponding to the process_id at t_ds_process_definition
Problem: There are three database tables, which have many associations and are more complicated to operate.
Plan II
##Database Design
t_ds_process_definition
id 【unique identifier】 name 【process name】……
t_ds_process_to_tags
id 【unique identifier】 tag_name 【tag id】 process_id 【process id]】
##Goal 1
Adding tags: because a row of data in t_ds_process_definiton_tags contains tag_name and process_id, adding tag_name alone does not make sense.
Modify tags: modify the tag_name of t_ds_process_definiton_tags
Delete tags: delete tag_name data of t_ds_process_definiton_tags
##Goal 2
1 Select the process and get process_id
2 select the tag and get tag_name
3 add a row of data in t_ds_process_to_tags
## Goal 3
1 Query all process_id corresponding to tag_name at t_ds_process_definiton_tags
2 Query process corresponding to process_id at t_ds_process_definition
Problem: Because a process may contains multiple tags, there is duplication of tag_name. However, the number of tables can be reduced, and it is easier to operate the tables.
目标:
1 在工作流定义界面,用户可以添加,删除和修改标签;
2 选择工作流添加到创建的标签中
3 点击对应的标签就可以展示该标签下的工作流。
方案一
##数据库设计
t_ds_process_definition
id【唯一标识】name【工作流名称】version【版本】
t_ds_process_to_tags
id【唯一标识】tag_id【标签id】process_id【工作流id】
t_ds_process_definiton_tags
id【唯一标识】tag_name【标签名称】
##目标 1
添加:在t_ds_process_definiton_tags中增加一行数据
修改:修改t_ds_process_definiton_tags的tag_name
删除:删除t_ds_process_definiton_tags的tag_name数据,t_ds_process_to_tags的tag_id数据
##目标 2
选择工作流process_idà选择标签tag_idà在t_ds_process_to_tags中增加一行数据
##目标3
在t_ds_process_definiton_tag查询tag_name对应的tag_idà在t_ds_process_to_tags查询该tag_id对应的process_idà在t_ds_process_definition查询该process_id
问题:有三个数据库表,关联较多,操作起来比较复杂
方案二
##数据库设计
t_ds_process_definition
id【唯一标识】name【工作流名称】version【版本】
t_ds_process_to_tags
id【唯一标识】tag_name【标签id】process_id【工作流id】
##目标 1
添加标签:因为t_ds_process_to_tags表中一个tag_name对应一个process_id,所以单独添加标签没有意义
修改标签:修改t_ds_process_definiton_tags的tag_name
删除标签:删除t_ds_process_definiton_tags的tag_name数据
##目标 2
选择工作流process_idà选择标签tag_nameà在t_ds_process_to_tags中增加一行数据
##目标3
在t_ds_process_definiton_tags查询tag_name对应的所有process_idà在t_ds_process_definition查询process_id
问题:因为一个工作流可能对应多个标签,存在tag_name数据的重复。但可以减少表的数量,操作表更简单。