Coder Social home page Coder Social logo

jonhoo / cucache Goto Github PK

View Code? Open in Web Editor NEW
63.0 6.0 5.0 1.18 MB

Fast PUT/GET/DELETE in-memory key-value store for lookaside caching

License: MIT License

Go 91.51% Gnuplot 1.98% Ruby 2.47% Shell 4.04%
memcache-server memcached caching key-value in-memory

cucache's Introduction

cucache

Fast PUT/GET/DELETE in-memory key-value store for lookaside caching.

Build Status

A mostly complete implementation the memcache text and binary protocols can be found inside cucache. The binary protocol has been tested using memcached-test, and the text protocol with simple test cases extracted from the protocol specification.

The implementation uses Cuckoo hashing along with several concurrency optimizations. The implementation uses much of the code from Dustin Sallings' gomemcached for the binary protocol.

Known limitations and outstanding things

  • Needs configurable debugging information output
  • The touch command is not implemented; see dustin/gomemcached#12
  • Protocol should be tested against mctest

Current implementation notes can be found in wip.md.

Want to use it?

Great! Please submit pull-requests and issues if you come across anything you think is wrong. Note that this is very much a WIP, and I give no guarantees about support.

Why another memcached?

Cuckoo hashing is cool, and fast. Go is cool, and fast. Maybe the two can outcompete the aging (though still very much relevant) memcached while keeping the code nice and readable. Furthermore, as the Go runtime improves over time, cucache might itself get faster automatically!

The hope is that fine-grained write locking and lock-free reading might speed up concurrent access significantly, and allow better scalability to many cores. While the traditional memcached wisdom of "just shard your data more" works well most of the time, there comes a point where you have some single key that is extremely hot, and then sharing simply won't help you. You need to be able to distribute that keys load across multiple cores. Although memcached does support multi-threaded execution, the fact that it locks during reads is a potential scaling bottleneck.

Experimental results

cucache is currently slightly slower than memcached in terms of over-the-network performance simply due to Go being slower than C for many operations: network socket operations have more overhead, system calls are slower, request and response marshalling is slower, and goroutine scheduling and GC incur additional runtime cost. In terms of pure performance (i.e. direct hash table operations), cuache is probably significantly faster than memcached already.

See benchmark/ for more in-depth performance evaluation.

cucache's People

Contributors

jonhoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.