You own a link shortener. It creates short codes and redirects them — that part works.
What does not work is the scale it is about to operate at. Ten billion redirects a month averages roughly 3,800 per second, and traffic is not evenly distributed: peaks run several times the average, and a small number of links account for most of the volume.
The read:write ratio is about 100:1. That asymmetry is the single most important fact about this system, and your architecture should show that you noticed it.
You start with an API tier querying PostgreSQL directly. Every redirect is a database read.