Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement "debouncing" for event-driven microservices?

I have 2 microservices running in a Kubernetes cluster on Azure. The "Project"-microservice sends out an event to Kafka when a project has been updated. The "Analytics"-microservice consumes the event, does some expensive calculations, and finally sends out an e-mail containing the results.

To avoid spamming the receiver, I want to implement some kind of debouncing pattern so that calculations are only done when an hour has passed since receiving the last update-event. Since the "Analytics"-microservice would be idle for most of the time and cold starts are not a problem, it would be advantageous if resources are unreserved while it is inactive.

How would one implement a debouncing scenario when using Kafka? I have thought of introducing a less resource-intensive microservice with the sole purpose of triggering the "Analytics"-microservice once an internal clock has expired. Is this a sensible solution? I would appreciate the input of someone who has dealt with a similar problem before.

like image 524
andreas_rwth Avatar asked Oct 30 '25 02:10

andreas_rwth


1 Answers

Did you consider Temporal’s durable timers. See here: https://docs.temporal.io/docs/workflows/

You can also consider combining Temporal with Spiderwiz to streamline your entire workflow.

like image 181
zvil Avatar answered Nov 01 '25 02:11

zvil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!