Application of memcached in high-load concurrent Web sites (i)---introduction

Source: Internet
Author: User
Tags memcached mysql database

People may have a good understanding of this product memcached, or have been used in their own website, but some friends have never heard or used.

It doesn't matter, this article aims to introduce this product from all angles, as far as possible, if it can help you now or later, the author will feel extremely honored.

I would like to introduce a number of areas including the following:

1, Memcached's introduction

2, the memcached application scene

3, the installation of memcached

4, the use of memcached

5. Memcached Deployment Architecture

6, the limitations of memcached

7, the improvement of memcached

First, Introduction

1.1 Background

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

Memcached is widely used in large load and high concurrent Web sites, is a very mature product (called a technology is also not possible). Like Facebook,youtube,yahoo,sina,sohu,netease, watercress and other sites are more or less using the product. Memcached in the user-centric Web site, the performance is particularly prominent, such as Sns,blog and other web2.0 applications of the site. These sites in general, pay special attention to the user experience, users of the server response speed requirements are very high, user data is relatively complex, high degree of connection, the need to constantly update and retrieve the database.

Memcache is a danga.com several open source projects, initially specifically for the LiveJournal.com site development, at that time the site solar PV reached the Tens, in the use of the process of a lot of load and response speed related problems, and then developed the project, designed to improve the site at the time of the dilemma. Memcache can handle any number of connections, using Non-blocking network IO. Its use is very simple and convenient, the most commonly used function of no more than 5 methods.

Memcache official website: http://www.danga.com/memcached.

1.2 Features

1. High performance

No matter which database DBMS (mysql,oracle,mssql,db2,postgres, etc.), how to optimize, and ultimately avoid the slow storage media (hard disk, tape) for data exchange, but often once involved in the storage media IO operation, Access performance will drop dramatically. Memcached, as the name implies, all of its operations in memory from start to finish, so the efficiency of access to data is very high.

Of course, in general, large Web sites will be optimized for database operations. There are usually two kinds of means:

A, read and write data separation, using the main/auxiliary library mode, to disperse the pressure of the database, improve the speed of the query.

b, split the database horizontally or vertically according to the business characteristics. In short, it is the large library, the large table to make small table, to improve the efficiency of database access. Generally speaking, a database with a lot of tables or a table with more than N records, will significantly reduce the database service capabilities, such as MySQL database single table records reached about 20 million (the author's previous work experience), performance will be reduced to almost unbearable. About database design and optimization, we can do a separate topic, here do not do too much research.

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.