The difference between memcache and memcached

Source: Internet
Author: User
Tags comparison table php framework php memcached

Actually say what does not matter, as long as you really understand and know how to use it! But in the same way as I have to study the confusion encountered in this, share the reasons for the following:

Memcache is a software

Memcache is a free and open source, high performance, allocated memory object caching system. Used to accelerate dynamic Web applications and reduce database load.

It can handle any number of connections, using non-blocking network IO. Since its working mechanism is to open a space in memory, and then build a hashtable,memcache This software project is generally called Memcache, but the project's main program file is called Memcached.exe, These hashtable are managed by this daemon on the server side. Because of this naming problem, so many people put this software system called Memcache, want to call into memcached also no problem!

PHP has two pecl extensions for the above software: one called Memcache, one called memcached

The memcache extension was developed entirely within the PHP framework, and the memecached extension was used libmemcached. From the manual, memcached will be more than memcache several methods, the use of the same way, the specific difference later talk about!

So everyone should understand, the following drawing a diagram to help understand:

It can be seen that different languages have their own extensions for Memcache!

The difference between memcache extension and memcached extension in PHP

For this memory cache system, PHP has two extensions, namely Memcache and memcached extensions. and memcached and memcache The Guardian process memcached the same name, more prone to confusion, and even mention memcached, some people first think of the daemon is the background, here or it is necessary to analyze the difference between the two, the following views are only personal views, Hope that friends will make additions and corrections.

First we can clearly see the difference between the two from the official PHP manual:

    • memcache:http://cn2.php.net/manual/en/book.memcache.php
    • memcached:http://cn2.php.net/manual/en/book.memcached.php

Memcache is developed entirely within the framework of PHP, and memecached is used libmemcached. From the manual, memcached will be more than memcache several methods, the use of the same way.

Memcache is a native implementation, but the use of libmemcached memached only support Oo interface, and Memcache is oo and non-oo two sets of interfaces coexist, later with the memcached server-side improvements, this Lib will also be immediately follow up. Memcache is not necessarily able to follow up on time.

Memcached, there is also a very good place to be praised, that is, flag is not in the operation of the time set. Instead, there is a unified setoption (). Memcached implements more memcached protocols (after all, based on the Libmemcached library).

Here is another comparison table, it is clear that the use of memcached will reassure a lot of people: Http://code.google.com/p/memcached/wiki/PHPClientComparison

The big difference is that memcached supports Binary Protocol, and Memcache does not, which means that memcached will have higher performance. However, it is also important to note that memcached currently does not support long connections.

The latest version and Memcache (server side) of the above software:
    • Unix/linux: Latest Version 1.4.5,:http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
    • Windows: Latest Version 1.2.1,:http://www.php100.com/html/download/server/2010/0125/3857.html
PHP memcache Extensions for Memcache software:
    • Unix/linux: Latest Version 3.0.5beta,:http://pecl.php.net/package/memcache
    • Windows::http://www.php100.com/html/download/server/2010/0125/3858.html
PHP memcached Extensions for Memcache software:
    • Unix/linux: Latest Version 1.0.2,:http://pecl.php.net/package/memcached

(Note: In Unix/linux installation needs to install Libevent, detailed installation of the system slightly different, the installation of PHP memcached extension needs to install libmemcached, specific software installation methods are not detailed here, You can have Google for yourself)

    • Libmemcached official: http://libmemcached.org/libMemcached.html
    • Memcached official: http://www.memcached.org/

PHP memcached client Memcahce vs. memcached: Http://code.google.com/p/memcached/wiki/PHPClientComparison

Extended reading:

Installation and configuration of Memcached.exe under Windows

Installing Memcached for PHP 5.3 on Windows 7

The difference between memcache and memcached

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.