The difference between PHP extension memcache and memcached

Source: Internet
Author: User

1. memcached Introduction


Memcached is a high performance, distributed memory object caching system.

PHP operates the memcached service with two extensions memcache and memcached.


2. memcache extension


The memcache extension supports both object-oriented and process-oriented interfaces.

Its function is affected by php.ini, so it must be set in the php.ini configuration file.

The extension appears earlier (2004).

PHP.ini configuration:

[memcache]extension = Memcache.somemcache.allow_failover = "0" memcache.hash_strategy = "consistent" Memcache.default_ Timeout_ms = 100


3. memcached Extension


This extension uses the APIs provided by the Libmemcached library to interact with the memcached service side.

The libmemcached library must be installed first.

The memcached extension supports only object-oriented interfaces.

The installation does not need to be configured in php.ini, only the extension can be introduced.

The extension appears late (2009).

The memcached function is more complete than memcache and supports more functions.


3. which extension to use


It is recommended to use the memcached extension.

The memcached function is a bit more complete.


4. Specific comparison of different points


The following table compares the specific differences, address:

Https://code.google.com/p/memcached/wiki/PHPClientComparison

  • 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.