PHP Development Server Memcache cache data

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.