NoSQL Database Introduction, memcached Installation

Source: Internet
Author: User
Tags memcached

NoSQL database What is a NoSQL database?

Non-relational database is NoSQL, relational database represents MySQL;

relational database, it is necessary to store data into libraries, tables, rows, fields, the query needs to be based on the criteria of a row of matching, need to retrieve from the disk, time and resources to consume;
NoSQL database, the storage principle is simple (data type is K-V), data can be stored in memory, query speed is very fast, the extension is very easy, support distributed;

A common NoSQL database

K-v form: memcached, Redis suitable for storing user information, such as reply, configuration files, parameters, shopping cart and so on. This information is usually linked to the ID (key), which is a good choice in the context of the key-value database;
Document database: MongoDB stores the data as a document;
Column storage: Hbase
Figure: neo4j, Infinite graph, Orientdb

memcached Introduction

Features: Cache database query results, reduce database access times, illegible improve dynamic Web site performance;
Official website: www.memcached.org

The data structure is simple (k-v), the data is stored in memory, the restart data is lost, and the data must be saved to the hard disk before restarting;
Multithreaded
Based on C/S architecture, the protocol is simple;
Time processing based on libevent;
Autonomic memory storage processing (slab allowcation)
Data expiration methods: Lazy Expiration and LRU
~~

Install memcached Source Package
yum install -y libmemcached libeventyum install -y memcached
Start
systemctl start memcached
Configuration file
监听的ip,可以将OPTIONS="" 改为OPTIONS="127.0.0.1"其中-m指定memcached 分配内存,单位为M-c 指定最大并发数-u 指的是运行memcached服务的用户-p 为监听端口
View Run status
memcached-tool 127.0.0.1:11211 stats或者echo stats |nc 127.0.0.1 11211 需要安装nc工具memstat --servers=127.0.0.1:11211get_hits:命中了多少curr_items:缓存了多少

NoSQL Database Introduction, memcached Installation

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.