redis pub / sub数据如何与CentOS 7上的移动应用程序进行交互

I made a stock-like app, which received data from outside then publish them to clients. I want to use redis as cache to save 7 days’ data and MySQL to save all data. But I have wondered how to deal with subscribe data interaction is effective? I have used remote connection from mobile app to redis server, but the server is infected with mining virus. So it seems like unsafe. What about php api? I don’t use pub/sub but use ‘get’ once a second use php api? It seems ineffective. Java is difficult to me. I could use Qt to write a server, but it seems like poor performance on high concurrency. I am confused.