general
URL Shortener
A hash-only table keyed by short code, the classic key-value lookup.
The simplest single-table design: a partition key and no sort key. Each item maps a short code to a long URL plus a click counter. There is no Query here, only GetItem by code.
The model
ShortLink
A short code mapping to a long URL.
- pk
- <code>
Attributes: code (S), longUrl (S), clicks (N)
Access patterns
- GetItemResolve a short code
Fetch the long URL for a short code.
Design notes
Why hash-onlywhy
Every read is a GetItem by the full key, so there is no sort key to carry. Adding one would cost storage and buy nothing for this access pattern.
Taught in the course
- The key is the address - GetItem needs the whole primary key: partition and sort.
These rows are real and already here. Running an operation against them downloads a DynamoDB-compatible engine, about 850 KB, and executes it in this tab.
Fetch the long URL for a short code.
Run an operation to see the raw engine response.
Transactions, streams, tags and TTL are among the operations the in-browser engine doesn't implement yet.