I am planing to create mobile app. It calls web service automatically every 5 seconds to check, if there is a new message for the user. Imagine, that 10.000 users use this app at same time. That means web service receives 2000 request every second (that means 2000 hits on database per second).
How can I handle this amount of requests?
How to optimise database?
Polling is not really a good option you should better look for a push notification. That needs much less ressources on the client an server side.
You just need to find a way to fist a suitable push technic for your service. Maybe you could use something like XMPP. WhatsApp uses that too (even if they transport the data in a binary format).
For handling so much connections you may need a cluster with a broker. This is a very common senario. I’m sure you will find more stuff fast. You forgot to add some more informations about your server configuration.