简体   繁体   中英

avoid multi updates to database PHP&MYSQLI

I have a site , on my site every time that someone is clicking on a banner i am doing a select query to take all the relevant links so today i have about 1000000 clicks a day on links , this process is making too many querys on the server what other options do i have ?

i was thinking about using

memcache 

and than to ask the server cache for the hosted link and every 5 minutes

i will run a

CronJob 

that will give me the link.

there is any other kind of technologies i can use ?

memcache is a safe technology to use ?

I'm sure this is a large open-ended topic that doesn't have one particular answer. But if you are asking if people use memcache to take the load off the database server?

Certainly yes. memcached is more than a decade old now; been tested and used by a lot many more companies.

You could figure out the most frequent queries that your database server is getting and then start by caching the result set into memcache (and update your memcached whenever database inserts, updates & deletions occur).

You'd also observe that memcached is also frequently compared to redis .

There are several techniques that you can use to take off the load on your database. Please check out the answers here[1]

[1] https://softwareengineering.stackexchange.com/questions/60225/how-do-you-off-load-work-from-the-database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM