I’m making an Android app that will talk to an online database to get data from. My current method is to sign up for a website from a webhosting service, such as HostGator or WebHostingHub, and I’m creating a MySQL database on the site with PHP code to send the data to the app (in JSON format). I was wondering if this is a viable solution, specially if the app happens to take off. I would love to hear your ideas.
Thanks!
You should design your server side code and infrastructure to handle a lot of requests at the same time.
The following buzzwords came to my mind:
when using persistent connections to the MySQL database your queries will be answered immediately, but the tmp-tables will be shared between all clients. so based on the complexity of your queries this might not be optimal.
on-demand connections will cause little overhead, but this should be reducable to a minimum when you’re accessing MySQL through a local socket. Additionally, you should have the chance to configure MySQL according to your needs (the number of simultanious connections, keycache etc.) in case your app really takes off. 😉 this means that root-access to the server would be of great help.
same here. the number of possible child threads should be configurable in case that you will have long running queries. if you can adjust the modules loaded by your webserver to those that are really needed for your purpose it will help you lower the runtime of your single requests. lighttpd or Apache would be my choice.