Good Way to Implement a Web-based Chat ApplicationOctober 13, 2019
Some web applications have been developed by me but they all only worked with databases.
This means that they operate using a approach where the following sequence takes place:
- A Client application (the UI for example) makes a petition to my program.
The app and this database connect.
An operation is performed by the app.
The program disconnects from the database.
An effect is returned by the program into the UI.
NOTE: My program generates a DB Connection for every single petition to take care of unexpected Server functions and other instances where the DB may be unavailable.
I am trying to develop a Chat application that is web-based similar to the one in Zoom or LinkedIn Meetings.
I plan to use XMPP with Openfire since the XMPP Client Library as the Smack API and the Server. Because XMPP is a normally excellent option for immediate Messaging programs, this is.
My primary issue is that the aforementioned fire-and-forget approach won’t be relevant because User links need to be kept alive for as long as the user is logged in to the UI (otherwise they will seem to be Offline to additional Clients ).
One more factor to consider is that rather than the customary 1-is-to-1 connection of standalone clients like WhatsApp and Skype (in which the app installed to a user’s machine just needs to worry about the specific User logged into it), this program will have to have a 1-is-to-many strategy.
My questions are as follows:
- What’s a good method to employ these requirements to be handled by a Chat program?
1 approach to the relationship is to make a new Thread. But, I am having some trouble visualizing the Chat program will keep track of.
I presumed I need to keep Connections connected. Is this essential?
Am I overlooking some concepts here which will make it easier to implement?
Any advice would be appreciated.