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)