Code Monkey home page Code Monkey logo

volatile_warmth's Introduction

Volatile Warmth

世界中が涙する、ありきたりなハッシュテーブル型オンメモリキャッシュサーバ。

構想

低機能を目指したmemcachedの代替になりもしないサーバ。 ソケットはepollとかいうノンブロッキングIOを目指してるけど、なんとも複雑なLinuxシステムコールが前に立ちはだかる! ハッシュテーブルの実装はふつうにWikipediaに書いてる実装でもいいけど、キーでバイナリツリーつくってもおもしろかったりしなかったり? とりあえずある程度使えるように?するために適当な言語バインディング、データベースドライバを書くつもり。 永続化はいつかやってもいいね。

実装

Cのできない輩がCを取り急ぎ手続的に使ったらこうなる例。 Hashtableは連結リスト。ハッシュ関数はFNV-1a。 サーバースレッドとデータベーススレッドをPOSIX threadで並列化。

妄想

Volatile = 揮発性の Warmth = ぬくもり


Protocol

Abstract

  • TCP/8814
  • text/plain

Header

  • 0x00 - 0x08 -> Payload Size in Hexadecimal

Payload

Store the data

SET <key> <value>
  #=> returns HEADER + [succeed:0/failed:1]

Restore the data

GET <key>
  #=> returns HEADER + raw_value

Purge the data

PURGE <key>
  #=> returns HEADER + purged_key_name

volatile_warmth's People

Contributors

keiya avatar

Stargazers

Eason Wang avatar  avatar zhengji avatar

Watchers

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