Memcache,redis
1. are used to manage the data
2. Their data is stored in memory
3.Redis can periodically back up data to disk (persistent)
4.Memcache is just a simple key/value cache
5.Redis not only supports simple key/value-type data,
It also provides storage of data structures such as List,set,hash
MySQL If operation data:
1. Requires MySQL server
2. Terminals that need to operate the MySQL database (e.g. navicat)
3. Requires MySQL server address, port number (default 3306)
4. Connect to the address and write the SQL command.
5. The server accepts commands, operates on the database, and returns the data.
The page and client app cannot operate the terminal, so server scripting is required
Redis Memcache operates data in a similar way to the MySQL operation database
1. Client connects to Redis Memcache server via address and port number
2. The client sends a set (set)/get (GET) command to the server
3. After the server accepts the data, it is processed by PHP and returns it to the database
PHP generates memcache data in Sina SAE
<?php $mmc =memcache_init (); if ($mmc ==false) echo "MC init failed\n"; else{ //0 is flag,10 is effective time memcache_ Set ($MMC, "key", "David", 0,10);
PHP Development Server Memcache cache data