Distributed Cache -01 Overview

01 Distributed Cache Overview

 

 

 

 

 

 

Why use

  Why use a distributed cache, a very simple thing you have current system does not apply to the performance of your portfolio would have to upgrade your system to improve system performance, improve several areas where, optimized code, database optimization, use static under data, only in stand-alone has no way to meet the business case will go to consider cluster is then distributed

Distributed means that you want the original system into multiple services, which involves calling and consistency of data between services. The future will become a stand-alone distributed, concurrent performance of the system has sufficient lifting but the pressure of big database up a large number of database I / O operations consume a large amount of resources. How to reduce the pressure on the database, read from the disk

Data into memory to reduce disk I / O operations is cached, the cache is assigned to multiple servers distributed cache.

Scenarios

  01- page caching

      After the return and render when we visit a website, the request is sent to the background, the background check from the database to data, resources consumed in the process of reading and rendering data, so it is necessary to enter the data read from the cache before look no further query cache rendering from the database and stored in the cache

  02- State Cache

      Problem solving session synchronization of distributed Web-deployed, state caching. Cache includes state data during Session session state and application scale, such data are generally difficult to restore, high availability requirements.

  Parallel Processing 03-

      Distributed computing, data sharing intermediate

   04- Transactions

      Coherence distributed transaction data in the cache and database

    06- hot data

      Amount concurrent system, data of high access frequency hotspot

Application Technology

  07-Ehcache

    Ehcache is open source Java distributed cache a widely used. Mainly for common caching, Java EE and lightweight containers. It has a memory and disk storage, the cache loader, the cache extensions, cache exception handler, a buffer gzip servlet filter support REST and SOAP api characteristics.

    The main features are:
   1. Fast
   2. Simple
   3. A variety of caching policy
   4. There are two levels of data cache: memory and disk, so no need to worry about capacity issues
   The cached data will be in a virtual machine written to disk in the process of restarting
   6. The cache can be distributed through RMI, API, etc. may be inserted
   7. listening socket having a cache and a cache manager
   8. supports multiple cache manager instance, and an example of a plurality of cache area
   9. Hibernate provides cache implementation

 09-Memcached

   1. is applicable to larger data cache
   2. No server-side distributed functions, depending on the client implementation
   3 is a pure in-memory database, no data persistence implementation, memory hung up the data is gone
   4. Multithreading

 10-Redis

    1. a single thread
    2. supports a variety of data structures
    3. Support data persistence
    4. The operation is atomic, transactional

  Issues and Challenges

   11- Data Consistency

      In distributed systems, or due to network a variety of problems may lead to inconsistent data in the database and cache data

   Reference: https: //blog.csdn.net/chenyiminnanjing/article/details/82763928

    12- cache penetration

      Cache penetrating query data in the cache does not exist, does not exist in the cache will query to the database, resulting in a pressure increase in the time to read the database data growth.

       solution:

     13- cache avalanche

       Over time, lead to the disappearance of large amounts of cache data to increase traffic database

    

 

Guess you like

Origin www.cnblogs.com/saozhou/p/11508017.html
Recommended