[Yandex Cloud documentation](../../../index.md) > [Yandex API Gateway](../../index.md) > [Tutorials](../index.md) > Serverless-based backend > URL shortener > Overview

# URL shortener


This tool accepts user requests via a public [API gateway](../../concepts/index.md): [Yandex API Gateway](../../index.md). The user receives an HTML page with a URL input field from a [hosting](../../../storage/concepts/hosting.md) service. The [Yandex Cloud Functions](../../../functions/index.md) [function](../../../functions/concepts/function.md) sends the entered URL for storage to a [Yandex Managed Service for YDB](../../../ydb/index.md) [serverless database](../../../ydb/concepts/serverless-and-dedicated.md#serverless), shortens it, and returns it to the user. When the user follows the shortened URL, the function retrieves the full URL from the database and performs a redirect.

You can create the infrastructure for your URL shortener using one of these tools:

* [Management console](console.md): Create your URL shortener step by step in the Yandex Cloud management console.
* [Terraform](terraform.md): Streamline creating and managing your resources with the _infrastructure as code_ (IaC) approach. Download a Terraform configuration example from the GitHub repository and then deploy your infrastructure using the [Yandex Cloud Terraform provider](../../../terraform/index.md).