Implementing multi-regional cron jobs
It may seem ironic, but scheduled jobs still play a role in event-driven systems. We strive to avoid the long latency of a batch cycle, but sometimes legacy integrations necessitate scheduled jobs. In these cases, an ESG service would encapsulate those requirements, but there are still legitimate business events that happen at specific points in the day— for example, the stock market has an opening and closing bell. For these scenarios, a control service can implement the schedule and broadcast time-based domain events, as shown in the following diagram. Downstream services can then react without duplicating the scheduling logic:
As with all autonomous services, we deploy these scheduled jobs to multiple active regions to ensure that there is coverage in the case of a regional disruption. However, we do not want these scheduled jobs to execute in multiple regions and...