Giter VIP home page Giter VIP logo

cachelot's Introduction

What is Cachelot Library

If your application needs an LRU cache that works at the speed of light. That's what the Cachelot library is.

The library works with a fixed pre-allocated memory. You tell the memory size and LRU cache is ready.

Small metadata, up to 98% memory utilization.

Besides memory management, Cachelot ensures smooth responsiveness, without any "gaps" for both read and write operations.

Cachelot can work as a consistent cache, returning an error when out of memory or evicting old items to free space for new ones.

The code is highly optimized C++. You can use cachelot on platforms where resources are limited, like IoT devices or handheld; as well, as on servers with tons of RAM.

All this allows you to store and access three million items per second (depending on the CPU cache size). Maybe 3MOPs doesn't sound like such a large number, but it means ~333 nanoseconds are spent on a single operation, while RAM reference cost is at ~100 nanoseconds. Only 3 RAM reference per request, can you compete with that?

There are benchmarks inside of repo; we encourage you to try them for yourself.

It is possible to create bindings and use cachelot from your programming language of choice: Python, Go, Java, etc.

What is Cachelot Distributed Cache Server

Think of Memcached but Cachelot far better utilizes RAM so you can store more items in the same amount of memory. Also Cachelot is faster in terms of latency. See benchmarks on the cachelot web site.

Cachelot is single-threaded. It can scale to 1024 cores, and run even on battery-powered devices.

Cachelot supports TCP, UDP, and Unix sockets.

The easiest way to play with cachelot is to run Docker container

$ docker run --net=host cachelot/cachelot

Then you can connect to the port 11211 and speak memcached protocol

$ telnet localhost 11211
>set test 0 0 16
>Hello, cachelot!
STORED
>get test
VALUE test 0 16
Hello, cachelot!
END
>quit

Cross-platform

Cachelot is tested on Alpine Linux (Docker), CentOS 7, Ubuntu Trusty and MacOS.

32bit ARM and x86-64 supported.

Windows build is upcoming.

How To Hack

Prerequisites

Build

Clone source code repository:

$ git clone https://github.com/cachelot/cachelot.git

Next

$ cd cachelot

Generate project files for your favorite IDE or Makefile by running cmake -G "{target}" in the cachelot root directory.

For example:

$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && make

or

$ cmake -G "Xcode"

There are several variants of build:

-DCMAKE_BUILD_TYPE must be one of the: - Debug - enable debug messages, assertions and disable optimization - Release - release build - RelWithDebInfo - release build with debug information enabled - MinSizeRel - minimal size release - AddressSanitizer - special build to run under Address Sanitizer (compiler support and libasan required)

Run tests or benchmarks

All binaries (main executable, unit tests, etc.) will be in bin/{build_type}.

Subscribe to Cachelot blog

cachelot.io/blog

Follow Cachelot in social media

Be first to know about the new features


License

Cachelot is free and open source. Distributed under the terms of Simplified BSD License

Credits

cachelot's People

Contributors

aka-rider avatar thedrow avatar

Watchers

James Cloos 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.