dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Feature][MasterServer] Add cache manager for Master

Open caishunfeng opened this issue 5 years ago • 5 comments

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Description

Now when Master run a workflow, it will do many db select operation, such as processDefinition, taskDefinition, processTaskRelation, tenant, user, workGroup, project......

I think these data will not be changed easily, so if we can use cache instead of selecting from db, it will speed up the processing of workflow and improve performance.

function design:

  • cache config for enable switch and other params like expire time, cache size.
  • cache annotation, which can be use easily, and it's helpful to manage the unified cache logic -> use spring cache + caffeine
  • cache hit rate statistics
  • cache update notify, now is from api-server

sub-issue:

  • [x] #6985
  • [x] #6987
  • [x] #6988

Use case

No response

Related issues

No response

Are you willing to submit a PR?

  • [x] Yes I am willing to submit a PR!

Code of Conduct

caishunfeng avatar Nov 22 '21 10:11 caishunfeng

Hi:

  • Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
  • In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
  • If you haven't received a reply for a long time, you can subscribe to the developer's email,Mail subscription steps reference https://dolphinscheduler.apache.org/en-us/community/development/subscribe.html ,Then write the issue URL in the email content and send question to [email protected].

github-actions[bot] avatar Nov 22 '21 10:11 github-actions[bot]

Now when Master run a workflow, it will do many db select operation, such as processDefinition, taskDefinition, processTaskRelation, tenant, user, workGroup, project......

If the cache is only for DB operations, maybe we can investigate whether the ORM framework supports cache itself, I remember MyBatis supports some basic cache mechanism.

function design:

  • [ ] add the cache switch, it can be controlled by user freely. If false, the cache will not effect
  • [ ] cache expire config, it will decide how long the cache will last
  • [ ] cache annotation, which can be use easily, and it's helpful to manage the unified cache logic
  • [ ] cache hit rate statistics
  • [ ] cache update notify, now is from api-server

All the functionalities above can be easily achieved by introducing

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-cache</artifactId>
</dependency>

@caishunfeng which cache system do we want to use?

kezhenxu94 avatar Nov 22 '21 10:11 kezhenxu94

@kezhenxu94 yes, I found too, the spring cache maybe is suitable.

caishunfeng avatar Nov 22 '21 10:11 caishunfeng

try to take #6987

zwZjut avatar Dec 01 '21 03:12 zwZjut

try to take #6987

OK, looking forward to your PR.

caishunfeng avatar Dec 01 '21 03:12 caishunfeng