Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Distributed cache

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This paper will introduce distributed caching from a theoretical point of view. When building large-scale web applications, caching technology can be said to be necessary, and the necessity of learning is self-evident.

Overview of distributed caching

1.1 Features of distributed caching

Distributed caching has the following characteristics:

1) High performance: when traditional databases are faced with large-scale data access, disk I _ Pot O often becomes a performance bottleneck, which leads to high response latency. Distributed cache uses high-speed memory as the storage medium for data objects, and the data is stored in the form of key/value. Ideally, DRAM-level read and write performance can be achieved.

2) dynamic scalability: support elastic expansion, provide predictable performance and scalability by dynamically increasing or reducing the changing data access load of nodes, and maximize resource utilization.

3) High availability: availability includes two aspects: data availability and service availability. Based on redundancy mechanism to achieve high availability, no single point of failure (single point of failure), support automatic fault discovery, implement failover transparently, and will not cause cache service interruption or data loss due to server failure. Automatically balance data partitions during dynamic expansion, while ensuring the continuous availability of cache services

4) ease of use: provides a single view of data and management; API interface is simple and independent of topology; no manual configuration is required for dynamic expansion or failure recovery; backup nodes are selected automatically; most cache systems provide a graphical management console for unified maintenance

1.2 typical application scenarios

Typical application scenarios for distributed caching can be divided into the following categories:

1) page cache. Used to cache Web page content fragments, including HTML, CSS and images, etc., mostly used on social networking sites, etc.

2) apply object cache. The cache system provides services as the second-level cache of the ORM framework, which aims to reduce the load on the database and accelerate application access.

3) state cache. Caching includes Session session state and state data during application scale-out. This kind of data is generally difficult to recover, requires high availability, and is mostly used in highly available clusters.

4) parallel processing. Usually a large number of intermediate calculation results need to be shared.

5) event handling. Distributed cache provides continuous query (continuous query) processing technology for event streams to meet real-time requirements.

6) extreme transaction processing. Distributed cache provides high throughput and low latency solutions for transactional applications, supports high concurrent transaction request processing, and is often used in railway, financial services, telecommunications and other fields.

1.3 Development of distributed caching

Distributed cache has gone through many stages of development, from the initial local cache to the elastic cache platform to the elastic application platform [8]. The goal is to build a better distributed system (as shown in the following figure).

1) Local cache: the data is stored in the memory space where the application code is located. The advantage is that it can provide fast data access; the disadvantage is that the data cannot be distributed and shared, and there is no fault-tolerant processing.

2) distributed cache system: data is distributed and stored among a fixed number of cluster nodes. The advantage is that the cache capacity is scalable (static expansion), and the disadvantage is that a large number of configurations are needed in the expansion process, and there is no fault-tolerant mechanism. Typical, such as Memcached

3) flexible caching platform: data is distributed among cluster nodes and high availability is realized based on redundancy mechanism. The advantage is dynamic scalability and fault tolerance, while the disadvantage is that replication backup will affect the performance of the system. Typical, such as Windows Appfabric Caching

4) flexible application platform: elastic application platform represents the future development direction of distributed cache system in cloud environment. To put it simply, the elastic application platform is a combination of flexible caching and code execution. transferring the business logic code to the node where the data is located for execution can greatly reduce the data transmission overhead and improve the system performance. Typical, such as GigaSpaces XAP.

1.4 distributed cache and NoSQL

NoSQL, also known as Not Only Sql, mainly refers to the database design pattern that is non-relational, distributed and supports horizontal expansion. NoSQL abandons the strict transaction consistency and paradigm constraints of traditional relational databases and adopts a weak consistency model. Compared with the NoSQL system, the traditional database is difficult to meet the storage needs of application data in the cloud environment, which is embodied in the following three aspects:

1) according to CAP theory, consistency (consistency), availability (availability) and partition fault tolerance (partition tolerance) satisfy at most two at the same time, and it is impossible to take both of them into consideration. For a large number of Web applications deployed in Yunping Taichung, the priority of data availability and partition fault tolerance is usually higher, so it is generally chosen to relax the consistency constraints appropriately. The requirement of transaction consistency of traditional database restricts the implementation of its horizontal scalability and high availability technology.

2) it is difficult for traditional databases to adapt to the new data storage and access mode. There are a large number of semi-structured data in Web 2.0 sites and cloud platforms, such as user Session data, time-sensitive transactional data, computing-intensive task data, etc., these state data are more suitable to be stored in Key/Value format and do not need the complex query and management functions provided by RDBMS.

3) NoSQL provides low latency read and write speed and supports horizontal scaling, which are very important for cloud platforms with massive data access requests. Traditional relational data cannot provide the same performance, while in-memory databases have limited capacity and lack scalability. As an important implementation of NoSQL, distributed cache can provide highly available state storage and scalable application acceleration services for cloud platforms. There is no clear boundary between distributed cache and other NoSQL systems. Application access and system failures in the platform are unpredictable. In order to better deal with these challenges, application software is usually designed stateless, and a large amount of state information is no longer managed by components, containers or platforms, but is directly handed over to the back-end distributed cache service or NoSQL system.

1.5 distributed caching and extreme transaction processing

With the further development of cloud computing and Web 2.0, many enterprises or organizations are often faced with unprecedented requirements: millions of concurrent user access, thousands of concurrent transactions per second, flexible flexibility and scalability, low latency and 7 × 24 × 365 availability. Traditional transactional applications face the limit scale of concurrent transaction processing, and there are extreme transaction applications, such as railway ticketing system. Wikipedia believes that extreme transaction processing is more than 500 transactions per second or more than 10,000 concurrent visits [12]. Gartner defines extreme transaction processing (extreme transactionprocessing, referred to as XTP) as an application model for the development, deployment, management and maintenance of transactional applications. It is characterized by extreme requirements for performance, scalability, availability, manageability and so on. Gartner predicted in its report that the scale of extreme transaction applications will increase from 10% in 2005 to 20% in 2010. Extreme transaction processing technology is a hot technology in the next 5-10 years. The introduction of extreme transaction processing undoubtedly brings new challenges to the traditional Web three-tier architecture. That is, how to provide good support for large-capacity and business-critical transaction processing applications on cheap and standardized hardware and software platforms. As a key XTP technology, distributed cache can provide technical solutions with high throughput and low latency for transactional applications. Its delayed write (write-behind) mechanism can provide shorter response time and greatly reduce the transaction load of the database. The phased event-driven architecture (staged event-driven architecture) can support large-scale and highly concurrent transaction requests. In addition, the distributed cache manages transactions in memory and provides the guarantee of data consistency. Data replication technology is used to achieve high availability, with better scalability and performance combination.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report