Font Size: a A A

Design And Implementation Of Memory Cache System In Cloud Platform

Posted on:2019-06-27Degree:MasterType:Thesis
Country:ChinaCandidate:S ZhaoFull Text:PDF
GTID:2348330569495577Subject:Engineering
Abstract/Summary:PDF Full Text Request
The establishment of the cloud platform has brought great convenience to users,and with the increasing number of users,it has also brought tremendous pressure on the platform.In the face of this situation,it is necessary to build a caching system on the cloud platform to relieve the pressure fromvisit,which also makes the cache more important in the cloud platform.At present,most of the cloud computing companies in the world have built a caching layer on their platforms to speed up their response to users.Based on memcached,this paper designs and implements a memory cache system in the cloud platform.In this thesis,the demand analysis is carried out firstly,and the problems such as load imbalance,single node failure and non-persistence are analyzed in the cloud computing environment.According to these problems,we have given the entire architecture of the memory cache system.The system is divided into three layers: network communication layer,system control layer,and data processing layer.The system control layer is divided into load balancing module,heartbeat detection module,fault handling module and node coordination module.The data processing layer is divided into data synchronization module,memory storage module and persistence module.Then,the detailed design and implementation of each module of the system are carried out.The network communication layer can easily handle high concurrent customers' visit by using epoll multiplexing and thread pooling.The system control layer is the center of the entire system and adopts the master-slave model to ensure high availability.The load balancing module improves the consistent hash algorithm based on virtual nodes,fully considers the heterogeneity between servers,and optimizes the virtual node allocation strategy,so that it can achieve load balancing.The heartbeat detection module can detect the online status,load status,and data consistency between master and slave.The fault processing module handles problem on the data processing layer.It ensures that only the latest data from the node can replace the master when the master node fails.So it avoids the single node fault phenomenon.The node coordination module guarantees system consistency and high availability through the raft protocol.The data processing layer consists of multiple groups.Each group adopts a multi-master model to avoid data loss caused by a single point of failure.The data synchronization module ensures that the data can be kept consistent between the master and slave nodes.And the redundant backup of the data can be also achieved.The memory storage module designs a hierarchical hash table,which controls the granularity of the lock well and can deal with the data movement and query efficiency problems caused by the hash table expansion.The 2q replacement algorithm improves the cache hit rate.The persistence module can use a local file to store the write command with certain format.It can reconstruct the file to control the file size.So it ensures that the system has a good disaster tolerance.Finally,this thesis tests and analyzes the function and performance of the system in the production environment.The analysis results show that the system has reached the initial design goal.And the system has high availability and good hit rate,and can achieve load balancing.
Keywords/Search Tags:cache, cloud computing, Memcached, high availability
PDF Full Text Request
Related items