Skip to content

kyopark2014/webchat-golang-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webchat-golang-chat

It is a chat server based on PUBSUB. In order to make a seamless connection between web client and server, socket.io is a good way to support bidirectional message flow. Also, the application server is based on golang which have a strangth for massice transaction.

PUBSUB ISSUES

For one-to-one chat, published messages from Sender will return since the sender also do SUBSCRIBE into PUBSUB server. It may be used for acknowlegement for the sent message. But it also requires special management for UI because an user usually prefers to use legacy message experience where it shows if a message is failed to send by some reason, it should be displayed in the chat dialog so that the user recognizes and then tries again if needs. So, I think it is a redundacy for PUBSUB when it is applied for one-to-one chat.

image

where Sender and Receiver are subscribed to a chat room with chat-id.

In mobile environment, the state of user client can move to online to offline which means that Sender may not sucess to send a message based on the state of Receiver. So, the architecture should support store and forward approach.

The proposed architecture is using PUBSUB to endpoints which doesn't have the redundancy and some of benefits to notice the received message and manages a single connection for multiple chat rooms.

image

where Sender will publish to Receiver directly and messages can be delivered consistently without the state of Receiver.

Basic Call Flow

Client <-> Server : Socket.io

Online : PUBSUB

If the receiver is online, the message will be delivered by PUBSUB.

alternative text

Offline: QUEUING

If the receiver is offline, the message will be queued in database as bellow.

alternative text

About

It is a chat server based on PUBSUB in which socket.io is used to connect the server and client.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published