-User and Client feed through an API Gateway containing two base services: The shortening service and the Redirect service.
-The shortening service contains the business logic for creating the shortened URL as well as the mapping between actual and shortened URL.
-The redirect service is used when the end-user enters the shortened URL in their browser. It effectively redirects them to the correct web page using the shortened URL.
-The database is where the mapped URLs (long and short) are stored. If the service is to be implemented around the globe, a CDN or distributed architecture may be considered
Key Components:
-API Gateway: Multi-functional gateway that directs both user and client (web host) requests. For the host, it allows them to create, get, or configure a shortened url. For the user, it directs them to the redirect service, which checks for the destination in the CDN Cache as well as the database.
-Database: Stores the shortened URLs, ids, and the original URL. Contains the mapping between the original URL (destination) and the shortened one. Two databases may be considered as well -- one for the shortening service and one for the redirect service.
-Shortening service: allows for the shortening of URLs and storage of the mapping between the original version and the shortened version in the database.
-Redirect service: Redirects the user by first checking the CDN cache for a more performant redirect if they have used the URL before. If not, the database is queried for the URL mappings and the redirect logic is then applied, sending the user to their intended destination.