I have been developing a real time chatting service and need to mask bad words which client sends. So, now I am wondering about system performance as thousands of msgs transfer at a real time.
Which part (server or client) process is the best solution masking bad words to get better performance?
Client side : Android
Server side : Nodejs (MySQL, Redis)
Methods I am thinking :
- Download slang list from server and when client sends a msg (if bad word) mask it. Process can take long time but there may be good search algorithm.
- Put slang list on redis and on every msg server processing check for bad word (through redis query) and send masked msg to client and endpoint. Through redis sounds great but I have to send back masked msg to client, this seems me making the system slow.