Increase sales with a scarcity strategy and waiting rooms

Mariana Aguilera
aziontech
Published in
7 min readFeb 20, 2024

--

For a long time, waiting rooms have been primarily used as a solution to avoid downtime due to spikes in traffic. With the arrival of new technologies, the digital world has become even more robust and adaptable, reducing the need for this kind of solution. Edge computing platforms, for example, natively offer greater security, faster and more efficient content delivery, lower latency, and, therefore, more availability.

In this context, digital waiting rooms can go beyond downtime mitigation, becoming a strategic tool to improve customer satisfaction and optimize business operations. Every e-commerce is always thinking of strategies to increase sales, including yours. A rise in the number of users during seasonal periods, such as Black Friday and Christmas, is good news. But, what about creating more buzz around your brand and motivating purchasing decisions through the scarcity principle and a waiting room?

First, the basics…

Scarcity is a term commonly used in the marketing context. It appeals to the value of the product or service when perceived as limited or hard to obtain: if a product is offered in a limited quantity, in a limited time, or has an idea of exclusivity around it, it creates a sense of urgency among consumers. Let’s review some possible scenarios:

  • Limited edition of a product
  • New product launch
  • Tickets or access to a demanded event
  • Flash sales and discounts
  • Stock liquidation

Here’s where a waiting room can be useful to control and limit access to your site and create the perfect context for these cases.

What is a Waiting Room integration?

A digital waiting room works similarly to anyone in the physical world. If you go to a shop, there’s a limited amount of sellers and changing rooms to test the clothes. If all rooms and sellers are occupied, you must wait until somebody finishes. Just at that moment, you’ll enter a room to continue your buying journey.

With this integration, you’re able to repeat this experience by adding a “waiting room” page, between your users and your website during a special offer or campaign. You determine how many users can be simultaneously on your page: when this limit is reached, the system redirects users to a waiting room and assigns them a number in the queue. When a spot on the page becomes available, the first user in the queue will be granted access.

How a Waiting Room integration works

The Azion team has developed a Waiting Room integration with Upstash. The integration is based on an edge function that runs on the Azion Edge Computing Platform, containing the logic and the parameters to define its behavior. By running on the edge of the network, it benefits from being closer to end-users, low latency, and enhanced security.

This waiting room implementation also uses Redis as a state store. Redis is an open-source in-memory data store; that means the information is stored in RAM-memory and not in hard formats, being recommended for applications that require fast access to large amounts of data and real-time tasks, such as e-commerce. While you can also monitor and manage the activity through the Upstash Dashboard.

What happens when you configure a waiting room on your site and a request arrives?

The integration, available in Azion Marketplace, uses a First-In, First-Out (FIFO) approach. This way, requests are processed according to the order they’re received by the system. Imagine you’ve configured a limit of 10 users to be on your site simultaneously. Now you have 9 users navigating your site and 3 new users trying to access it. Each user will be attended to in the order their request arrives.

  1. User-1-Request is processed first and the system assigns an ID to identify the request.
  2. Edge Firewall executes the integration; the request is held in a waiting queue while the verification happens.
  3. The integration verifies if there’s available space.
  4. Considering that, in this example, there’s one available slot, the User-1-Request is redirected from the waiting queue to the site.
  5. The system will repeat the process with User-2-Request. There isn’t availability now, so the request is redirected to the waiting room page, receiving the number 1 in the row to access. (Users in the waiting room receive a message informing them they’re in the queue and their number in the row.)
  6. The same will happen with User-3-Request, being the number 2 in the row.
  7. Once space is available, the customers in the waiting room are moved and can access the website following that order.

In any phase (verification, waiting queue, waiting room, site page), it uses a standard HTTP 302 redirect. The data related to the request ID, the queue, and the site’s capacity are stored in the Upstash database. The integration retrieves that information in each step to act accordingly.

Additionally, you can add a predefined TTL (Time-to-Live) to the sessions on your website. For example, users have 10 minutes to navigate the page and complete their transactions. If that time expires and nothing happens, the session finishes and the first user in the queue can now access it.

In summary:

  • The function is executed in the Azion Edge Firewall.
  • Besides configuring the parameters, it’s possible to define criteria and behaviors for the integration to do.
  • Redis stores all the information related to the integration.
  • For monitoring, you can use the Upstash dashboard as well as the Azion Observe suite.

Implementing the integration

Beyond all the technology involved, implementing a waiting room through the integration of Azion with Upstash is simple and provides you with a set of tools to configure a solution aligned with your needs. And you don’t need to learn new languages or change your stack. Let’s configure a waiting room for your e-commerce in the following context:

  • You’re planning a limited stock liquidation.
  • Only 50 users are allowed to be on the site simultaneously.
  • The user has up to 10 minutes to complete the transaction.
  • When a user is redirected to the waiting room page, a message informing them of their number in the queue is shown.

Hands on!

Installing the integration

To install and configure this integration, you need to create first an Upstash account and a Global Database for the best available edge latency in the Upstash Console. After you have completed these steps, it’s time to go to Azion Marketplace and install the Waiting Room integration.

Check the documentation on how to access Azion and how to create an Azion account.

Then, complete the 3 main tasks listed below to adequately configure your new integration through the Edge Firewall product:

  1. Set up an Edge Firewall rule. In this step, you’ll add a rule set for Edge Firewall, selecting the domains you want to use the function in and enabling the Edge Functions module.
  2. Set up an Edge Firewall function. Add the Waiting Room edge function to the firewall and set the parameters.
  3. Configure a rule on the Rules Engine. To finish, you must set up a new rule with the criteria and the behavior to run the function. For example: using if Request URI starts with ./. as criteria and Run Function as behavior. In this case, if the e-commerce site receives a request, the Waiting Room function is executed to check if there’s or there isn’t availability, granting access or sending the request to the waiting room.

For a more detailed step-by-step, go to the How to install the Upstash Waiting Room integration through Azion Marketplace guide.

Customizing the integration

In the second step, it’s where the magic happens, because you’ll customize the waiting room to align it with your specific needs. After adding the Waiting Room function to your firewall, you’ll see a form containing the Code and Args tabs. Opening the Args tab will show the JSON file containing the variables, similar to this:

{
"url": "https://region-database.upstash.io",
"token": "YourUpstashToken",
"ttl": 10,
"capacity": 2
}

Where:

  • The url variable must be the URL string to connect on Upstash Redis.

You can go to your Upstash Console and copy the UPSTASH_REDIS_REST_URL in your database page.

  • token refers to the token to access the Upstash Redis database.

Go to your Upstash Console and copy the UPSTASH_REDIS_REST_TOKEN in your database page to retrieve this information.

  • ttl is the maximum time, in seconds, a user can stay on your website.
  • capacity represents the maximum number of simultaneous connections allowed on your website.

Following the example for the stock liquidation you’re planning, the parameters should be defined as follows:

{
"url": "https://region-database.upstash.io",
"token": "YourUpstashToken",
"ttl": 600,
"capacity": 50
}

Done! Now, during your stock liquidation, your e-commerce will support 50 users simultaneously, having 10 minutes to complete the transaction. If the capacity is full, the new requests will be sent to the waiting room.

Why use a Waiting Room integration

Implementing a waiting room empowers you to test and be more strategic in managing your e-commerce. With this kind of integration, you obtain:

  • Traffic control, by holding incoming users until resources become available on your website.
  • Improved user experience, with users being redirected to a placeholder page while they wait, avoiding error messages and frustration.
  • Flexibility, by defining strategies to manage the way users access your content aligned with your marketing campaigns and activations.

Besides that, you can also benefit from a waiting room during traffic peaks. Yes, an increase in traffic is great for your business. However, if you aren’t prepared, downtime and prolonged wait times can be a headache, leading to churn, reputation damage, SEO impact, and loss of profits. In this matter, waiting rooms are a good fit, along with edge computing capabilities, to manage traffic peaks without compromising your user experience and your server’s health.

Furthermore, you can also combine the Waiting Room with other integrations to improve your user experience and enhance even more your site security, including fingerprint, Bot Protection, and others.

This article doesn’t end here. Click here to read more about Azion Marketplace

The article was written in partnership with

, Product Manager @ Azion :)

--

--