Coder Social home page Coder Social logo

cache's Introduction

实现的cache拥有以下特点

  • 指定最大的内存使用大小
  • 采用LRU淘汰策略
  • 使用锁提供单机并发访问控制
  • 可用于单机缓存,并提供http 服务
  • 采用一致性hash选择节点,实现负载均衡
  • 可用于基于HTTP协议的分布式缓存
  • 拥有防止缓存穿透的机制
  • 使用protobuf优化节点间的二进制通信

获取key的流程

                            是
接收 key --> 检查是否被缓存 -----> 返回缓存值
                |  否                         
               使用一致性哈希选择节点     是                                    是
                  |-----> 是否是远程节点 -----> HTTP 客户端访问远程节点 --> 成功-----> 服务端返回返回值
                               |  否                                    ↓  否
                               |----------------------------> 回退到本地节点处理

cache's People

Contributors

zmbiubiubiu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.