How high concurrency php to handle large data

Big Data Solutions

Use cache: 

Use: 1, using a program stored directly into memory. The main use Map, in particular ConcurrentHashMap.

Use caching framework. Common framework: Ehcache, Memcache, Redis like.

The key question is: create a cache, as well as its failure mechanism when.

For the null data buffer: best to use a particular type of stored value, to distinguish the two states and null data uncached.

Distributed database

The different tables to be stored in different databases, and then into different servers. Some complex issues, such as: transaction processing, multi-table queries.

NoSql and Hadoop

NoSql, not only SQL. No relational databases are so many restrictions, more flexible and efficient.

Hadoop, a data table of the plurality of layered, saved to a plurality of nodes (distributed). Each piece of data has a plurality of nodes save (cluster). Cluster parallel processing the same data, you can also ensure data integrity.

High concurrency solutions

Separation applications and static resources.

The static resources (js, css, images, etc.) into a dedicated server.

Page Caching

The application generates the cached page can save a lot of cpu resources.

For some frequently transformed data page may be processed using ajax.

Clusters and distributed

Cluster, multiple servers have the same functionality, diversion from the main role.

Distributed, different services into different servers, a request may require multiple processing servers, and further improve the processing speed of a request.

It is divided into static resource cluster and application clusters. The latter is more complex, often session to consider the issue synchronization.

Reverse Proxy

Server clients to directly access the server does not directly provide services, it gets resources from other servers, then returns the results to the user.

CDN

CDN is a special server cluster paged, and multiple paged Common server cluster is the main difference compared: its storage position and a different allocation request mode.

CDN servers distributed across the country, after receiving the request sends a request to assign the most appropriate CDN server node to obtain data. Each node is a page of its CDN caching server.

Guess you like

Origin www.cnblogs.com/heyue0117/p/11862888.html