Giter Site home page Giter Site logo

memcache-simplified's Introduction

memcached

A simple memcached implementaion as defined by Memcached Protocol with support of getter/setter.

Prerequisite

Install gcc! Developed and well tested under MacOS. It doesn't work on Windows. Not yet tested on other linux family system.

Running the server

Make sure you have 11211 port available for the application. Check out the repository and run the following command.

make
./server

Server will be running on 11211 port.

test-client/test.python is a simple client for verification. To run the test client, make sure you have python installed:

pip install python-binary-memcached
python test-client/test.python

Design decisions

  1. Multi-threading: Main thread is responsible of accepting socket connections. After accepting TCP connection, a new thread will be created to handle the response.

  2. Map implementation: Map is implemented by using linked list. It is a bad choice since the lookup of linked list has O(n) time. It is implemented this way solely because it is easy to develop within a short time.

  3. Locking: Every entry in the map has a lock. Implemented using linux pthread rwlock.

Things to improve

  1. Map implementation
  2. Robustness

memcache-simplified's People

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.