Problem
The front-end calls the "Get messages" endpoint frequently to ensure it is up-to-date. However, calling "Get messages" so often may cause unnecessary slowness in the future.
Say the user has 10,000 messages, then we would load all 10,000 each second, possibly overworking the server
Possible solutions
- Only returning most recent X messages at a time and lazy-loading as we scroll (industry-standard, but difficult)
- Limiting the number of total messages two users can have (easy, but could restrict user experience)
Problem
The front-end calls the "Get messages" endpoint frequently to ensure it is up-to-date. However, calling "Get messages" so often may cause unnecessary slowness in the future.
Say the user has 10,000 messages, then we would load all 10,000 each second, possibly overworking the server
Possible solutions