Jimmy Chat Architecture
Contents
Current Architecture
Requirements
Acknowledgment of Messages
messages should have three status: sent, delivered, read.
Push Notification of Messages
notify offline users of new messages once their status becomes online.
Chat System Component
- Stateful Services: chat functionality
- Stateless Services: other functionality except chat
- Third-party integration: push notification
Storage
- generic data: user profile, user friend list -> relational Database
- chat data -> key value stores
API Design
- Send Message(sender, receiver)
- Read Unread Messages(user)
Detailed Design
- Service Discovery(Optional)
- Sending or Receiving messages
- How to send real time messages for two users which are connected to different websocket servers?
- WebSocket server sends the message to the message service, and message is stored in the database in case user B is offline.
- When the messages are delivered to the receiver, they are deleted from the database.