I am going with a single table design for a chat application in Azure Cosmos db. I have my access patterns setup, just want to check here if I am in the right direction.
Below are the few things that concerns me
I have heard about a hard limit of 20gb per logical partition, wondering my below data model would eventually hit that limit.
Also is the below model considered hot partitioning as I am assuming a lot of focus will be there in conversationid-1234 partition as the messages in the conversation grows?
Access patterns -
Get details of the user -
SELECT * from c WHERE c.pk = 'userid-1234' AND type = 'user'.
Get conversations the user is part of -
SELECT * from c WHERE c.pk = 'userid-1234' AND type = 'member-of'
Get details of a conversation -
SELECT * from c WHERE c.pk = 'conversationid-1234' AND type = 'conversation'
Get members of a conversation -
SELECT * from c WHERE c.pk = 'conversationid-1234' AND type = 'member'
Get messages of a conversation -
SELECT * from c WHERE c.pk = 'conversationid-1234' AND type = 'message'
Get pinned messages of a conversation -
SELECT * from c WHERE c.pk = 'conversationid-1234' AND type = 'pinned-message'
Get reactions to a message in a conversation -
SELECT * from c WHERE c.pk = 'conversationid-1234' AND type = 'message-reaction'
Get status of a message(read/unread) in a conversation -
SELECT * from c WHERE c.pk = 'conversationid-1234' AND type = 'message-status'
Please advise.