Real-Time Database Overview Designs database schemas and query patterns optimized for real-time applications — chat, activity feeds, notifications, collaborative editing. Focuses on efficient message storage, cursor-based pagination, unread tracking, and sync protocols that minimize data transfer on reconnection. Instructions 1. Schema Design for Messaging Core tables for a chat system: Use BIGSERIAL for message IDs — sequential, sortable, perfect for cursor pagination. 2. Cursor-Based Pagination Never use OFFSET for message history — it's O(n) and results shift as new messages arrive. Return…