Menu
Back to Discussions

Chat system architecture: how to handle message delivery guarantees

Amara Davis
Amara Davis
·571 views
building a chat system, and handling message delivery guarantees is proving to be complex. we need read receipts, typing indicators, and offline message delivery. the big question is whether to persist messages to a database first and then publish an event for delivery, or publish to kafka first and then have a consumer persist to the database. there's a trade-off between reliability and latency here. persisting to the db first feels more reliable for ensuring the message is never lost, but adds latency before it gets to the recipient. kafka first could be faster but introduces more complexity around guaranteeing persistence. how have others structured their chat backends to ensure messages are delivered reliably, including offline, while keeping latency low? any specific patterns for handling read receipts and typing indicators at scale?
4 comments

Comments

Sign in to join the conversation.

Loading comments...