Ajax request to mysql
I'm using ajax to pull some data from my database every 10 sec.
My question will this effect my mysql database .. will it slow down my site or crypt my database
Please let me know if it is good idea to send request to my database every few sec to refresh page.
I try top pull banners an开发者_如何转开发d refreshing every few sec.
thanks
Any DBMS is capable of responding to a query every 10 seconds. Most DBMSes can handle hundreds of requests per second even on commodity hardware.
Nevertheless, it all depends on the complexity of your query. Most importantly, you need to make sure that your query is able to use an index.
On the other hand, there is nothing stopping you from adding a simple caching layer between your application and your database, such that the info is returned from the cache unless an update to the database invalidates the cache.
精彩评论