v1.0.0
High-performance caching layer 🔥

Stratum
CDN-like caching for your databases

A high-performance Go application that acts as a CDN-like layer for your databases. Expose specific data through custom API endpoints with powerful caching to protect your databases from excessive load.

High Performance
Multi-Database
Cloud Native

Everything you need to scale your data layer

Stratum provides all the tools you need to create a high-performance caching layer for your applications.

High Performance
Built with Go for speed and efficiency, designed to handle high-throughput scenarios.
Dynamic Routes
Configure custom URL patterns for your data on the fly without code changes.
Multi-Project
Serve data for multiple, independent projects from a single Stratum instance.
Environment-Driven
All configuration managed via environment variables. No code changes needed.
Redis Caching
Built-in support for Redis caching with configurable TTLs per route.
Scalable
Designed to be stateless for easy horizontal scaling across multiple instances.
Cloud-Native
Ready for deployment on Docker, Google Cloud Run, and other cloud platforms.
Database Protection
Protect your databases from excessive load with intelligent caching strategies.

How Stratum Works

Simple, efficient request flow with intelligent caching

Request Received

Client sends request to Stratum endpoint

Cache Check

Check Redis cache for existing data

Database Query

Query database if cache miss occurs

Serve Data

Cache result and serve to client

Try Stratum Live

Experience Stratum's caching capabilities with these interactive demos

User Profile API
Fetch user profile data with JSON caching
GET
/users/12/profile
Content-Type:
application/json
Cache TTL:
3600s
Response
Click "Send Request" to see the response
Live Demo Statistics
Real-time metrics from our demo Stratum instance
98.7%
Cache Hit Rate
23ms
Avg Response Time
1.2M
Requests Today
99.99%
Uptime
Configuration for These Demos
Environment variables used to create the demo endpoints above
# Demo 1: User Profile API
PROJECT_1_SOURCE_TYPE=db
PROJECT_1_ROUTE=/users/{id}/profile
PROJECT_1_DB_DSN=postgres://user:pass@localhost:5432/demo
PROJECT_1_TABLE=user_profiles
PROJECT_1_ID_COLUMN=id
PROJECT_1_SERVE_COLUMN=profile_data
PROJECT_1_CONTENT_TYPE=application/json
PROJECT_1_CACHE_TTL_SECONDS=3600

# Demo 2: User Avatar API
PROJECT_2_SOURCE_TYPE=api
PROJECT_2_ROUTE=/users/{id}/avatar
PROJECT_2_API_ENDPOINT=https://api.dicebear.com/7.x/avataaars/svg?seed={id}
PROJECT_2_ID_COLUMN=id
PROJECT_2_CONTENT_TYPE=image/svg+xml
PROJECT_2_CACHE_TTL_SECONDS=300

# Demo 3: App Configuration
PROJECT_3_SOURCE_TYPE=db
PROJECT_3_ROUTE=/config/{app_id}
PROJECT_3_DB_DSN=postgres://user:pass@localhost:5432/demo
PROJECT_3_TABLE=app_configs
PROJECT_3_ID_COLUMN=app_id
PROJECT_3_SERVE_COLUMN=config_json
PROJECT_3_CONTENT_TYPE=application/json
PROJECT_3_CACHE_TTL_SECONDS=1800

Simple Configuration

Configure your endpoints entirely through environment variables. No code changes required.

Database Configuration
db
Query database tables to serve data through custom endpoints
# Server Configuration
SERVER_PORT=8080
REDIS_URL=redis://localhost:6379/0

# Project 1: User Profiles
PROJECT_1_SOURCE_TYPE=db
PROJECT_1_ROUTE=/users/{id}/profile
PROJECT_1_DB_DSN=user:pass@tcp(127.0.0.1:3306)/mydb
PROJECT_1_TABLE=user_profiles
PROJECT_1_ID_COLUMN=id
PROJECT_1_SERVE_COLUMN=profile_json
PROJECT_1_CONTENT_TYPE=application/json
PROJECT_1_CACHE_TTL_SECONDS=3600

Deploy Anywhere

Stratum is designed for modern cloud environments and can be deployed on any platform

Docker
Containerized deployment with Docker for consistent environments
docker build -t stratum-app .
docker run --env-file ./.env \
  -p 8080:8080 stratum-app
Google Cloud Run
Serverless deployment with automatic scaling and zero server management
gcloud run deploy stratum \
  --source . \
  --platform managed \
  --region us-central1
Traditional Server
Deploy on your own infrastructure with systemd or process managers
go mod tidy
go build -o stratum ./cmd/Stratum
./stratum

Ready to get started?

Join developers who are already using Stratum to scale their data layer and protect their databases.

Made with ❤️ by Varun Agnihotri

Open source and MIT licensed. Contributions welcome!