PE Hackathon URL Shortener
This project started from a simple frustration: sharing links in chats and documents quickly becomes messy, and systems that seem “simple” often break under real-world load. We wanted to build something small enough to ship during a hackathon, but robust enough to behave like a production system.
What inspired us
We were inspired by the gap between demo-level projects and real-world systems. A URL shortener is a classic problem, but it exposes core backend challenges: caching, persistence, concurrency, and reliability under load. Instead of building a toy version, we wanted to push it toward something that could actually scale.
How we built it
We built a Python-based web service backed by PostgreSQL for persistence and Redis for caching. The system was containerized to ensure consistent environments across development and deployment.
To make performance measurable (not guesswork), we integrated:
- Prometheus + Grafana for monitoring
- Alertmanager for visibility into failures
- k6 for load testing under simulated traffic
At a high level, each request follows:
$$ \text{Request} \rightarrow \text{Cache check} \rightarrow \text{DB fallback} \rightarrow \text{Cache populate} \rightarrow \text{Response} $$
Our main optimization goal was reducing latency through caching efficiency:
$$ E[T] \approx h \cdot T_{\text{cache}} + (1-h)\cdot T_{\text{db}} $$
where $h$ represents the cache hit rate.
What we learned
- Performance is driven more by system design than raw code speed.
- Caching is powerful, but only when paired with correct invalidation strategies.
- Observability (metrics + logs) completely changes how you debug systems.
- Load testing early helps uncover bottlenecks before they become critical issues.
Challenges we faced
- Ensuring consistency between local containers and deployment environments
- Preventing database bottlenecks when cache misses spike
- Handling concurrent traffic without introducing race conditions or instability
- Interpreting noisy load-testing data and turning it into meaningful improvements
The short version
We built this project to show that even a “simple” service can be engineered like a real system—observable, testable, and resilient under pressure. It remains lightweight enough for a hackathon, but structured with production-level thinking.
Log in or sign up for Devpost to join the conversation.