What is the best way to cross the client-server boundary when handling custom messaging systems?

Hi! I am working on a custom messaging system (like thousands of other people have) and have gotten stuck time and time again on the best way to send a request to the server, process the given message (run server checks, moderate the text, etc.) and then send it to the specified player.

My question isn’t necessarily to ask for help in doing this, as I already know how to do all of those in terms of the logic. The only thing I have been hesitant on is how to send and receive data from the server.

I have thought about using RemoteEvents or RemoteFunctions, however, based on what I have been told neither are very reliable when you have potentially hundreds or thousands of requests per minute.

Any explanations or suggestions would be greatly appreciated!

EDIT: Some quick background in case this helps. The message system is modular. Each player has their own session object that is created when they join. Each message is it’s own object. The player session has methods like Session:Send(), etc. The message object has methods like Message:Edit(), Message:Delete(), etc.

1 Like

Why will there be so many requests? Remote events would be the best way to cross the client to server and then do sanity checks.

2 Likes

I suppose there wouldn’t be if there was a cooldown on how fast you can send messages, however, if everyone in a server spammed messages it may perform poorly. Is this correct?

If there was a way for a ModuleScript in ReplicatedStorage to talk to the server and the client simultaneously that would be incredibly helpful in this situation, however, I don’t believe that is a feature.

1 Like