The requirement is to implement a graphic and text Live Broadcast System. when sending live messages, users can refresh in real time and meet sufficient requirements (1 w) and can view historical messages. My idea is that every time I send a live message, I use the message id as the key to add an m... the requirement is to implement a graphic and text Live Broadcast System. when sending live messages, users can refresh in real time and meet sufficient requirements (1 w) and can view historical messages.
The idea is that each time a live message is sent, the message id is used as the key to add a memcache record, and a message id list is maintained and put into memcache. When a user requests a message, the incoming message id takes n IDs forward based on the message id list, and n records are retrieved from memcache for n times and returned. If an error occurs during the process, read the database to regenerate the cache.
Q: Is this feasible? Can it meet requirements? Is there a better solution?
Reply content:
The requirement is to implement a graphic and text Live Broadcast System. when sending live messages, users can refresh in real time and meet sufficient requirements (1 w) and can view historical messages.
The idea is that each time a live message is sent, the message id is used as the key to add a memcache record, and a message id list is maintained and put into memcache. When a user requests a message, the incoming message id takes n IDs forward based on the message id list, and n records are retrieved from memcache for n times and returned. If an error occurs during the process, read the database to regenerate the cache.
Q: Is this feasible? Can it meet requirements? Is there a better solution?