ServerlessArchitecture#11 - Where would you possibly use Lambda@Edge For?

ServerlessArchitecture#11 - Where would you possibly use Lambda@Edge For?

Suppose you wrote the Lambda Function in NodeJS or Python in region us-east-1(N.Virginia) and then execute them in AWS locations globally that are closer to the viewer, without provisioning or managing the servers.

Now my question is, Where would you possibly use Lambda@Edge For?

image.png


Use Case 1: Protecting your video contents from unauthorized access

Lets say you have protected contents and you want to authenticate it against something like "Cognito {{User Pools and Identity Pools}}" . That means, only users within our cognito authentication system are allowed to access those contents. This is something exampro do for their video contents there.

Selection_053.png

Use Case 2: A/B Testing websites

Use Case 3: Returning different images based on the screen size of their device

Use Case 4: For retail store that sales cloth,

For retail store that sales cloth, Based on the cookie (to indicate the color of a Jacket chosen by customer), my Lambda function can change the request for the CDN to return the image of that selected color.

Use Case 5: Inspect request headers

Inspect request headers or authorization tokens before forwarding those to the origin (server).

Use Case 6: Make network calls to external resources

Make network calls to external resources to confirm user credentials or fetch additions to customize a response.


Lambda@Edge scales automatically, from a few requests per day to thousands per second. Processing requests at AWS locations closer to the viewer instead of on origin servers significantly reduces latency and improves the user experience.