Construct the backend infrastructure for a real-time collaborative document editing application, similar to Google Docs. This project will focus on implementing WebSockets for instant synchronization of document changes across multiple users, managing document versions, handling user presence (who is currently editing), and ensuring secure access control. The backend will need to efficiently store and retrieve document content and history, manage concurrent edits without conflicts, and provide a robust API for frontend interaction. Emphasis will be on low-latency communication, data consistency, and scalability to support numerous simultaneous users and documents.