Skip to content

Scaling Guide

Last Updated: 2026-02-03 | Reading Time: 10 minutes

Guidelines for scaling PasteShelf for large deployments.



Use CaseRecommended Limit
Light user1,000 items
Power user5,000 items
Heavy user10,000 items
ItemsEstimated RAM
1,000~50 MB
5,000~150 MB
10,000~250 MB
// Recommended settings for performance
struct PerformanceConfig {
static let batchSize = 50
static let preloadCount = 100
static let thumbnailSize = 256
static let searchDebounce = 0.15
}

┌───────────────────────────────────────────────────────────────┐
│ Load Balanced Architecture │
├───────────────────────────────────────────────────────────────┤
│ │
│ Clients │
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ Load Balancer │ │
│ └────────┬─────────┘ │
│ │ │
│ ┌──────┼──────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌────┐ ┌────┐ ┌────┐ │
│ │ S1 │ │ S2 │ │ S3 │ Sync Servers (stateless) │
│ └────┘ └────┘ └────┘ │
│ │ │ │ │
│ └──────┼──────┘ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ PostgreSQL │ (Primary + Read Replicas) │
│ └──────────────────┘ │
│ │
└───────────────────────────────────────────────────────────────┘
UsersSync ServersDB Size
100110 GB
1,0002100 GB
10,00051 TB

-- Essential indexes
CREATE INDEX idx_items_user_created ON clipboard_items(user_id, created_at DESC);
CREATE INDEX idx_items_content_hash ON clipboard_items(content_hash);
CREATE INDEX idx_items_sync_status ON clipboard_items(sync_status) WHERE sync_status != 'synced';
-- Regular maintenance
VACUUM ANALYZE clipboard_items;
REINDEX INDEX idx_items_user_created;

  • Response latency (p50, p95, p99)
  • Sync queue depth
  • Database connection pool
  • Memory usage per user
  • Error rates

DocumentDescription
PerformanceClient optimization
Enterprise DeploymentDeployment

Last updated: 2026-02-03