Storage-Offline 1:1 Chat

Flowchart

Initial design

Improve with sequence num

Storage requirements

  • Requirement1: Query all 1-on-1 conversations a user participates in after a given timestamp.

  • Requirement2: For each conversation, load all messages within that conversation created later than a given timestamp.

Initial schema

Improved schema: Decouple msg content from sender and receiver

  • Intuition:

    • Even if sender A deletes the message on his machine, the receiver B should still be able to see it

    • Create a message_content table and message_index table

Last updated