3 ms·
Design a chat system based off of the constraints
- freemint 4y agoLooks like something a website would work for. Auto scale by assigning groups to different instances, keep chat history local to the instance where it happened, maintain a list of time windows on what instance a certain group chat happened centrally. After some time make the instances archival, move of active chats to other instances, attach readonly to servers serving history. Client side on fail to contact last known active instance for a group, ask central where it moved. Central handles auth, gives out irrevocable cookies for entire domain. Group switches are send as silent message to connected clients. Client->Server connection is HTTP(s) POSTs Sever -> client is an ongoing download of a file on the server that is throttled to only send when new stuff comes and the TCP connection kept open server side. In case of loss of connection download is continued where it left off. 80 million evenly spaced messages a day is something a single server could do too buti went for something more fancy.