A high-performance URL shortening service built with Go.

URL Shortener is a lightweight, fast, and efficient service for converting long URLs into short, shareable links. Built entirely in Go, it demonstrates clean API design, efficient data handling, and practical backend development patterns — perfect for learning URL compression algorithms and building scalable web services.
git clone https://github.com/Itsayu/url-shortner.git
cd url-shortnergo mod download
go mod tidygo run main.go
# Service starts on localhost:8080curl -X POST http://localhost:8080/api/shorten \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/very/long/url"}'
# Response: {"short_url": "http://localhost:8080/abc123"}Generating unique short identifiers without collisions
Implemented a base62 encoding system combined with sequential IDs or custom hashing to ensure every long URL gets a unique short code.
Handling high-volume redirect requests efficiently
Used fast in-memory lookups and optimized database queries to serve redirects in milliseconds without bottlenecks.
Keeping the implementation minimal yet complete
Focused on core functionality with clean Go code — no unnecessary frameworks or dependencies, just pure backend logic.
URL validation and error handling
Added comprehensive validation for incoming URLs and proper HTTP error responses for edge cases.