Request flows
Create Flow
- Client submits data via HTTP to Create the short URL
- Web Server validates data and submits to the API via /url/create (POST)
- Request is first received by the API gateway and is routed to the Load Balancer
- Load Balancer checks to see what API service to hit and submits data
- API Service generate the correct hash and UUID for the record
- After successful creation, the API service creates the cache record in Redis and returns the appropriate data upstream
Read / Get Flow (Redirect) - CACHE HIT
- Client sends request to Web Server
- Webserver understands target URL has been requested
- Webserver attempts to retrieve target data from Redis Cache and is found
- If cache record exists, it returns a 301 redirect to client.
Read / Get Flow (Redirect) - CACHE MISS
- Client sends request to Web Server
- Webserver understands target URL has been requested
- Webserver attempts to retrieve target data from Redis Cache and is not found
- Webserver requests the data from via API gateway -> Load Balancer -> API Service -> Database
Webservers, ALBs, API Service and Databases all send logs and metrics to Cloudwatch.