Skip to main content

Bottleneck use cases

let's take a quick look at the bottleneck use cases:

Initial scenario​

You have in your flow an App that connects to an API that only accepts 50 requests per hour. If you insert a batch of 1000 data records, you cannot be sure if that limit would be exceeded and then the API will start responding with rate limit errors.

Solution​

You place a Bottleneck in front of the App you need to control and set its configuration to 50 per hour. Let's suppose you start the 1000 records batch and your first record arrives to the bottleneck at 11:02. The first 50 records will be executed normally, going through the bottleneck without stopping.

At 11:12 the record 51 enters in the bottleneck. At that moment, that data record stops its execution, and it gets scheduled to continue at 12:02, just one hour later after the first record hit the bottleneck. The batch keeps executing, and now the record 101 enters the bottleneck at 11:35. To respect the rate limit, this data record will be scheduled till 13:02.

So if the 1000 records try to go through the bottleneck app in the first hour, they will be scheduled when reaching it like this:

First 50, they are not stopped. 51 to 100, they will be stopped till 12:02. 101 to 150, they will be stopped till 13:02. 151 to 200, they will be stopped till 14:02. ... So, the batch will need 19 hours to execute the 1000 records, and the last 50 records will start from the bottleneck app at 07:02 the next day.