Streamlit Messaging

Hey everyone,

In my app, I’ve developed separate pages for admins and users. Admins can send messages to users, such as: “There is a short update for you. See the details below:” Users can view these messages in a dedicated messages tab.

Currently, messages are stored in MongoDB and retrieved for users. However, when an admin sends multiple messages, I delete the previous one and replace it with the latest update. This approach feels inefficient and poorly structured for managing communications.

Is there a better way to design this messaging system? Ideally, I’d like to create a more structured communication channel between admins and users. Any suggestions?

What is the problem? I don’t see anything that looks inefficient or poorly structured in what you describe.

Sometime when my app takes too much time to load things from db. I want the app to run smoothly when messages are in and out.
For exmaple, For React.j, we have React Chat SDK Messaging Components that allow users to send and receive messages in a chat-like experience. Do we have kind of component here?

If “things” are messages, I think that should be fixable by optimizing db operations.

Db operations are mostly CRUD which will be performed by my python script. I dont think how to optimizing db operation here :confused: