Binary Cold Storage Engine
How Lexino AI achieves 70%–85% database storage reduction using native Brotli and Gzip compression.
To scale database capacity while preserving full chat history, Lexino AI implements automated binary cold storage.
#How It Works
• Inactive sessions (older than 7 days) are compressed using Node.js native zlib Brotli (Quality level 6).
• The resulting binary payload is stored as a compressed buffer in PostgreSQL, reducing row footprint by up to 85%.
• Transparent Decompression: When a user re-opens an archived session, the engine auto-detects binary headers, uncompresses the message history into memory in under 2ms, and restores the chat seamlessly.
#Archiving Endpoints
• POST /api/chat/archive: Compresses inactive sessions.
• GET /api/chat/sessions: Returns all chat sessions with automatic transparent decompression.