What would be the best way to quickly store the hash / session in one of these three ways?
Method 1: Create a memory table in MySQL that stores the hash and timestamp when the record was created. The MySQL event automatically deletes all records older than 20 minutes. This should be pretty fast, because all the data is stored in memory, but the overhead of connecting to the database server can ruin this advantage.
Method 2: I create an empty file with a hash as its name and create a cronjob that automatically deletes all files older than 20 minutes. This can become slow due to all read operations on the hard disk.
Method 3: Since it will be related to PHP, and we use the Zend Framework, I could use Zend_Cache and store the hash with a lifetime of 20 minutes.
I don't want to use Memcached or APC for this, because I think this is a big overhead for some small hashes.
Do you have experience in such scenarios? I would appreciate your experience and solutions for this.
source share