apache / dolphinscheduler

Apache DolphinScheduler is the modern data orchestration platform. Agile to create high performance workflow with low-code
https://dolphinscheduler.apache.org/
Apache License 2.0
12.4k stars 4.49k forks source link

[Improvement][Database Design] Time fields in DB should use the time type with time zone #16131

Open chenxi-null opened 2 weeks ago

chenxi-null commented 2 weeks ago

Search before asking

Description

Description

Why many time field in DB don't use the time type with time zone?

For example, using the t_ds_process_instance.start_time field, in PostgreSQL, the definition of field is timestamp DEFAULT NULL, in Mysql, the definition is datetime DEFAULT NULL. Both of them don't have the time zone information, and it stores the time value is as-is . I understand that this is by design, but it is not friendly for timezone switching and data migration scenarios.

In our case, when we switch the time zone from UTC to UTC+8, we lost the previous time information. In the admin UI, it looks like that all historical events were shifted 8 hours earlier.

e.g. image

Is it worth considering adding timezone attributes to these database time fields?

Action

In Postgresql, changing the type from timestamp to timestamptz, in MySQL, change from datetime to timestamp.

Are you willing to submit a PR?

Code of Conduct