Big Data Learning summary records-distributed cache-memacache (1)

Source: Internet
Author: User
Tags nginx reverse proxy

Traditional lamp

Traditional architecture Lamp

Linux + Apache (nginx) + Mysql + PHP

High availability, high concurrency, high performance

Traditional Architecture Process Analysis

A request arrives first through the Nginx reverse proxy server, through the Nginx load balanced balanced matching to the application server, the application server accesses the database service through the computation to obtain the data.

Problems with traditional architectures

1. First the application server should be stateless, we can be able to maintain the user state of the server is called the server stateful, if there is a state, then a single point of failure, the other application server will be unable to process the request. How to make the application server stateless, the server does not store the user state, build a huge session pool

(1) Session session based on Redis storage SessionID Advantages and disadvantages: Based on memory, server stateless session fully managed to Redis shortcomings need network communication, Redis storage session is unable to create the cluster.

(2) Cookie Local Storage Jssionid benefits regardless of the presence of the server, there is no problem with cookies 1. Local storage of user data is not secure 2. If the user prohibits cookies then there is no way to store

Session pool can be used Memacacher can also use Redis for session management

2. Application server access Data persistence layer

Database Services 32 Major categories

(1) relational database MySQL Oracle, etc.

(2) NOSQL MongoDB Document-based storage Redis based on Key-value storage based on column-based image storage

(3) Newsql between relational database and NoSQL

Application server access to data services improve efficiency you can also create an index library with a cache pool

Index Library features: sacrificing space for efficiency

Read characteristics of the cache pool:

Decrease penetration rate, increase hit ratio, increase hit rate, improve hitting ratio means minimizing application server access to data services, accessing cache pools as much as possible, increasing hits to cache pools, reducing penetration of data access, and keeping data services quiet as much as possible

Write features of the cache pool:

Using buffer queue to write operations, write operations made asynchronous, do not require the user to wait for information to write to the database, only require users and other write operations to reach the cache pool

Features of the queue: first in FIFO

Big Data Learning summary records-distributed cache-memacache (1)

Related Article

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.