I'm making a chat application android as a client and php as a server (I'm using nodejs to make a website realtime), in this application I can send messages to other android users using the GCM, the flow of messages is when a message is sent to the another user,the messages first pass to server (to store the data in mysql) and pass that to the user at the destination, I've several question about that.
1.Is stable if I create a chat application using only the GCM to send a message?
2 Is secure if I using mysql as database ?
3 I use my own server with ubuntu server Speck (8GB disk space and 96MB RAM), if the speck is feasible to be used as a chat server?
4 Is this application is feasible in publishing, and if is used by more than 100,000 users?
how do you think about the above statement? whether my application will be stable and not get serious problems in the future?
thanks..
That is fine that you are using PHP, GCM, MySQL and Node.js.
The quote below answers your first question:
Google Cloud Messaging for Android (GCM) is a service that allows you to send data from your server to your users' Android-powered device, and also to receive messages from devices on the same connection.
Is a No. You need to use GCM to send messages User -> Server -> User. User -> User is usually called Peer-to-Peer an GCM has a different purpose.
MySQL is secure and mature database, but in no means you shall not consider your MySQL (or Server in general) to be secure, because technology is. Almost all attacks on a server are the consequence of misconfiguration, or not enough of basic protection.
100MB RAM is a challenge, you might have issues there. You also did not tell how much CPU power you are guaranteed there, as well as networking.
100k users? No. I would firstly focus on 1k users, and after reaching then worry about scalability. In reality, you will have to change almost everything before you can handle 100k users. On a bright side, if you are to have that user base, you will be having a larger budget to manage it. And to handle 1k users the server you specified is 100% not enough, though technology shall be OK with the task, once you upgrade to an average dedicated or cloud server.
GCM offers some very important features The Android devices do not poll to receive communication. Instead, GCM servers push data onto a registered device when it's sent by an application server. By avoiding polling, the mobile device conserves battery life.
for the scalability part unlike other Google APIs, there are no quotas on the GCM service, so it's entirely free for any number of messages or devices using the service.
Stack Overflow has a series of questions & answers about GCM's inner workings. browse through them