ruanwenjun opened a new issue #6125: URL: https://github.com/apache/dolphinscheduler/issues/6125
**Describe the question** During the past moths, the community spent a lot of time to complete the JSON split. I am not involved in this job, but I can see this task is very difficult. Now the feature seems to be finished, and I have read some code and have a question about the `code` field in the database. We add a code field in many tables, and this field seems just used to maintain the relationship between the data models. For example, in `t_ds_task_definition` table we have a code, and in `t_ds_process_definition` we have a code, then we can maintain the relation of task and process_definition in `t_ds_process_task_relation` by these two codes. The design is OK, and I guess the reason for using `code` instead of `id` is that we cannot get the `id` in program, since we use AUTO_INCREMENT to generate the `id`, so we cannot get the`id` if the data has not been inserted. If my suspicions are correct, I think we can generate the `id` in program instead of using AUTO_INCREMENT, then we can get the `id` before insert data. We can implement this like segment mode(https://github.com/Meituan-Dianping/Leaf) Then we don't need the `code` field. The advantage of remove `code` field is that this make DolphinScheduler easier to migrate with other systems, since other systems may don't have `code`. On the other hand, we needn't add a new index of `code` and the data model will be clearer. **Which version of DolphinScheduler:** -[dev] -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
