问题
Say for example, an accounting service has a need to schedule ledger update jobs,
- should the accounting service include it's own scheduler? or,
- should job scheduling be a shared service?
I guess option (a) makes the service more autonomous?
What other criteria should be involved in making the decision?
回答1:
Job scheduler is usually an off-the-shelf component (like quartz) so you'd probably use that (many times it is embedded in the service host anyway).
In any event when you decide whether or not to create a separate service vs. having a component/library used internally within services you should consider the overhead of maintaining it, developing it as a separate unit etc. (see the nano-services antipattern)
来源:https://stackoverflow.com/questions/11351031/should-job-schedulers-be-shared-in-a-soa-environment