What are the tradeoffs of using S3 instead DynamoDb to store the redirect?
Sudarshan Gaikaiwari
1

I think you’ll find similarities with the trade-offs between bespoke and off-the-shelf software, where utilising DynamoDB would be the bespoke solution in this instance. It will be a harder to setup but will be more customisable to your requirements. Specifically when using DynamoDB you’d require another Lambda that would be responsible for looking up the URL shortcode in the database and then handling the redirect manually. Some features that you might want to add to a URL shortener: analytics, authentication/access controls, link transformations (e.g. appending something to the query string). These wouldn’t be possible with the S3 setup but would be easily done if you’re using DynamoDB as you would just add them to your redirect Lambda. Using the S3 setup described in the article you’re limited to the options that AWS make available to you, which is just basic forwarding, but you get it out of the box.