accesspatterns.dev

general

URL Shortener

A hash-only table keyed by short code, the classic key-value lookup.

key-valuelookuphash-only

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.

resolving the model…

The in-browser engine is a preview; behaviour is illustrative and not conformance-verified against AWS.