I usually connect to a remote MySQL database from an android device using a PHP script to manage the database, run this script using the HTTP protocol and code data in JSON format. I am now looking for a more professional method that can handle thousands of connections and is secure at the same time. Will hashing be enough to make it secure?
How do popular apps connect to servers and how do they handle authentication, security and lots of traffic?
NodeJs is very good to create a server to your apps, it does connect with mysql really easy:
var connection = mysql.createConnection(
{
host : db_host,
user : db_user,
password : db_password,
database : db_database
}
);
connection.connect();
and handles websocket connection, which makes the communication with your apps and the server fast enought to make real time stuff.
Here's a link to a simple nodejs server and the android app, just connect the server to the DB and your done!
Popular apps that connect to servers do so by:
web service
MySq
l in your case) using a server language (like PHP
)The number of connections that the app can handle depends a lot more on the server. That is hardware, software, scaling techniques like caching, load balancing, etc...
As far as security is concerned, hashing does help and connecting to the server through https
does not hurt either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With