I should organize REST-service for messaging using azure. Now i have problem with DB. I have 3 tables: users, chats, messages of chats.
- Users contains user data like login, password hash, salt.
- Chats contains partitionkey - userlogin, rowkey - chatId, nowInChat - the user came from a chat.
- Messages of chat contains partitionkey, wich consists of userlogin_chatId_datetimeticks (zevis_8a70ff8d-c363-4eb4-8a51-f853fa113fa8 _634292263478068039), rowkey - messageId, message, sender - userLogin.
I saw disadvantages in the design, such as, if you imagine that users are actively communicated a year ago, and now do not talk, and one of them wants to look at the history, then I'll have to send a large number of requests to the server with the time intervals, such as a week, request data. Sending the request with a time less than today will be ineffective, because We get the whole story. How should we change the design of the table?