Loading...
POST /shorten
{ long_url }
→ { short_url }
GET /{short_code}
→ 302 redirect
Client
|
API Gateway
|
+-------------------+
| |
Shorten Service Redirect Service
| |
ID Generator Cache (Redis)
| |
+-------> Database
urls(
id BIGINT PK,
short_code VARCHAR UNIQUE,
long_url TEXT,
created_at,
expires_at
)
short_codeshort_codelong_urlFlow:
Read → Cache → DB fallback → update cache