Upstash Waiting Room is an integration that helps you manage traffic surges and prevent overload on your websites and applications. The integration uses a First-In, First-Out (FIFO) approach and leverages on Azion Edge Firewall, creating a waiting room to control and redirect access according to your parameters.
When a request is received by your website, Edge Firewall executes the integration. Then, the integration verifies if there’s available space and moves the request from the waiting queue to the release queue. If there isn’t availability, the request is redirected to the waiting room, receiving a number in the row to access.
RequirementsSection titled Requirements
To start using this integration, you need to:
- Create an Upstash account.
- Create a Global Database for the best available edge latency in the Upstash Console.
Getting the integrationSection titled Getting the integration
To install this integration:
- Access Real-Time Manager (RTM) > Marketplace.
- On the Marketplace homepage, select the Upstash Waiting Room card.
- On the integration page, click the Get It Now button, located at the bottom-right corner of the page.
You’ll see a message indicating that your integration was successfully installed.
Configuring the integrationSection titled Configuring the integration
Once you’ve installed the Upstash Waiting Room integration, you’ll need to complete the steps explained below to configure it.
Setting up the Edge Firewall ruleSection titled Setting up the Edge Firewall rule
Follow the steps:
- On the upper-left corner, open the Products menu and select Edge Firewall in the SECURE section.
- Click the Add Rule Set button.
- Give an easy-to-remember name to your new rule.
- Select the domains you want to protect with the function.
- Enable the Edge Functions switch in the Edge Firewall Modules.
- This action gives access to edge functions on your edge firewall.
- Click the Save button.
Done. Now you’ve instantiated the rule for your function and have access to edge functions on your edge firewall.
Setting up the Edge Firewall functionSection titled Setting up the Edge Firewall function
While still on the Edge Firewall page, select the Functions tab and follow these steps:
- Click the Add Function button.
- Give an easy-to-remember name to your instance.
- On the dropdown menu, select the Upstash Waiting Room function.
This action will load the function, showing a form with the function’s source code and two tabs: Code and Args. By clicking on the Code tab, you’ll be able to navigate through the source code, but won’t be able to change it.
- In the Args tab, you’ll pass your Upstash credentials and your variables:
|URL string to connect on Upstash Redis. Go to your Upstash Console and copy the
UPSTASH_REDIS_REST_URL in your database page
|Token to access the Upstash Redis database. Go to your Upstash Console and copy the
UPSTASH_REDIS_REST_TOKEN in your database page
|Maximum time, in seconds, a user can stay on your website. Example:
|Maximum number of simultaneous connections allowed on your website. Example:
Setting up the Rules EngineSection titled Setting up the Rules Engine
To finish, you must set up a rule in Rules Engine to configure the criteria and the behavior to run the function.
Still in the Edge Firewall page:
- Select the Rules Engine tab.
- Click the New Rule button.
- Give an easy-to-remember name to the rule.
- Select a criteria to run and catch the domains that you want to run the integration on.
- Example: if
Request URIstarts with
- Below, select the Run Function behavior to the criteria.
- Select the Upstash Waiting Room function according to the name you gave it before.
- Click the Save button.
Done. Now the Upstash Waiting Room integration is running.