I'm currently researching into building a large-scale chat app for android...and an issue came up that deals with the best practices for storing/retrieving the messages sent to/from the users. After a previous post here, I discovered the GCM service offered by Google. My plan was to utilize this service as the primary method of moving messages to the different clients. I found an excellent tutorial which works for a small number of users (http://www.appsrox.com/android/tutorials/instachat/7/#1
), however it seems like there will be scaling issues if I try to adapt it to handle hundreds of users connected at the same time.
In the tutorial, the server that is being used to store/retrieve messages is utilizing a database to write new messages to, then reading those messages to send over GCM and then on the the client. The chat system I'm developing is intended to serve many more clients (100's) in one chat room where all the users can be communicating at the same time. However by adapting this tutorial that means that there could potentially be many more read/writes to the DB than intended in that article. This is where the best practices question comes in...
It seems to me that having a lot of constant read/writes to a db would impact performance negatively...but if this is the case then what alternative do I have? I'm still learning more about GCM, so it's possible that there is a solution I haven't found yet.
I appreciate your time!