Architecture Deep Dive
Telebase's biggest differentiator is its hybrid architecture: Telegram + KV Cache + State Sharding + Chunk TTL.
The Flow
[ Client / Web App ]
│
▼ (Reads <15ms / Writes <150ms via HTTP REST)
┌────────────────────────────────┐
│ Telebase Next.js API │ ◄───► [ Cloudflare KV Edge Cache ]
└──────────────┬─────────────────┘
│ (Chunked & Encrypted Background Sync)
▼
┌────────────────────────────────┐
│ Telegram Private Channel │ (Infinite, Permanent Storage)
└────────────────────────────────┘Telegram Permanent Backend
Telegram serves as the ultimate source of truth. Every database table and file is chunked, encrypted with AES-256-GCM, and stored as documents in a private channel.
Cloudflare KV Hot Cache
To achieve <15ms latency, Telebase caches master state and table chunks in Cloudflare KV globally. It strictly acts as a cache, not a database.
State Sharding
Telebase shards individual file metadata (e.g., file_<uuid>.json) directly to KV and Telegram to prevent massive monolithic state congestion at high scale.
24h Chunk TTL
Large file chunks stored in Cloudflare KV automatically expire after 24 hours (TTL). When a cache miss occurs, they are seamlessly re-fetched from Telegram, ensuring zero KV storage bloat.