Docs/Core Concepts

Core Concepts

Technical architecture and implementation patterns for EdgeURL

Developer Documentation: For comprehensive architecture details, see EdgeURL_Architecture_Reference.txt in the project root.

KV-First Caching

EdgeURL uses a KV-first architecture for blazing-fast redirects. Every short link lookup hits our ultra-fast cache layer first, not your database.

How It Works

1
User Clicks Short Link
Request hits Edge Function deployed globally
2
KV Lookup
Edge Function checks Redis for cached link data (sub-5ms)
3
Database Fallback
If not cached, query Postgres and prime the cache
4
Instant Redirect
User redirected to destination (total: sub-15ms)
// Simplified redirect flow
const link = await getFromKV(slug); if (!link) { link = await getFromDB(slug); await setInKV(slug, link); } return redirect(link.target_url);
99.9%
Cache hit rate
Sub-15ms
Global redirect

Smart Redirects

EdgeURL supports advanced redirect logic to optimize user experience and conversions.

A/B Testing

Send traffic to multiple destinations based on weighted probability. Perfect for comparing landing pages or testing offers.

// Variant A: 50% traffic
0gr.me/sale → landing-page-a.com
// Variant B: 50% traffic
0gr.me/sale → landing-page-b.com

Link Expiration

Set automatic expiration dates for time-sensitive campaigns. Expired links can redirect to a fallback or show an error page.

Link Status

Enable or disable links without deleting them. Useful for pausing campaigns or scheduled activations.

Analytics Pipeline

EdgeURL captures comprehensive analytics without slowing down redirects using a batch processing pipeline.

Real-Time Click Tracking

1
Click Event
User clicks short link, analytics event created
2
Counter Increment
KV counter incremented instantly (non-blocking)
3
Background Job
Cron job flushes counters to Postgres every 5 minutes

Tracked Data Points

Geographic
  • • Country
  • • City
  • • Region
Device Info
  • • Device type (mobile/desktop)
  • • Operating system
  • • Browser
Traffic Source
  • • Referrer
  • • UTM parameters
  • • Campaign tracking
Timestamp
  • • Date & time
  • • Daily aggregations
  • • Trend analysis
Performance: Analytics collection adds <1ms to redirect time. All heavy processing happens asynchronously.

Multi-Tenant Architecture

EdgeURL uses a hierarchical multi-tenant structure with Row-Level Security (RLS) for data isolation.

Organization ├── Projects │ ├── Links │ └── Analytics ├── Team Members (roles) ├── API Keys └── Custom Domains

Security Features

  • Row-Level Security: Database policies ensure users only access their organization's data
  • API Key Hashing: Keys hashed with SHA256 before storage
  • Rate Limiting: Per-IP and per-API-key limits prevent abuse
  • Role-Based Access: Owner, Admin, Member roles with granular permissions

Scalability & Performance

EdgeURL is built to handle millions of redirects per day without breaking a sweat.

Horizontal Scaling
Edge Functions auto-scale globally
99.9%
Uptime SLA
Enterprise-grade reliability
300+
Edge Locations
Global network
Tech Stack Highlights
  • Modern edge runtime for optimal performance
  • Redis cache for sub-5ms response times
  • PostgreSQL for persistent storage
  • Edge functions deployed across 275+ global locations

Implementation Guides

→ Quick Start - Integration guide→ API Reference - Endpoint documentation
→ Code Reference - app/[slug]/route.ts (redirect handler), app/api/links/route.ts (link CRUD)