recently read some tutorials on caching:
Memcache stores data as hash tables with key- > value structure;
redis can support five data types:: string (strings), hash (hash), list (list), set (collections) and zset (sorted set: ordered collections)
is obviously more powerful than Memcache, so is it necessary to use Memcache? Does it implement simple caching compared to lightweight points?
there is also an explanation based on the underlying implementation of PHP previously seen: the
php variable is implemented by the zval structure, and the address of the zval structure is stored in the symbol (hash) table, and the
global variable is stored in the symbol_table global symbol table. Then question: the
1.php variable and the Memcache cache are stored in memory, and the variable access speed should be faster than the cache. If you want to call across pages, you can define the global variable. There is no limit to the size of PHP7"s string variables, so why use caching? The
2.php variable zval structure uses five data types to store eight PHP data types, which is similar to the five data types implemented by redis.
php array is also a hash-like structure, with array functions can also achieve redis collection, list functions, can also be sorted, select access, then what is the essential difference in storing data?