Replayability and batch processing

You can use an asynchronous activity implementation. An activity would add the request to the local buffer and return the activity function. Then a separate thread would execute the batch update to the DB and complete the activities after that.

Note that Temporal is using queues internally. So an activity invocation is done through a task queue which an activity worker process listens on. So all the benefits of queues as flow control, rate limiting, batching, etc. are not lost.

But as Temporal is a workflow engine it adds a lot of features on top:

  • Unlimited activity execution time
  • Unlimited heartbeating
  • Unlimited exponential retries
  • Activity cancellation
  • Routing of activities to specific processes