Coder Social home page Coder Social logo

redis-like's Introduction

Environment

Web Server : Apache 2.4.23   
Language   : PHP 5.6.24  
Datebase   : Manual implementation (RB-Tree, depend on session)  
OS         : Ubuntu 14.04  

*The server must open cookies and session

APIs

  • Get

1.Get the value according to the specified key .

http://localhost/get.php?key=[k_name]
k_name : The name of the key you want to query

2.Get all keys and values

http://localhost/get.php

  • Set

1.Insert / update a key-value pair

http://localhost/set.php?[k_name]=[v_val]
k_name : The name of the key you want to insert / update
v_val : The value of the corresponding key

2.Insert / update several key-value pairs

http://localhost/set.php?[k_name0]=[v_val0]&[k_name1]=[v_val1]&[k_name2]=[v_val2]...
The meaning of the k_name and v_val as above.

*All requests are used HTTP-GET.

Notice

For data persistence, my idea is to serialize the entire rb-tree to a local file each time the rb-tree updated and reload the file in an unexpected crash or reboot, and deserialize the tree to memory.
Because of the time constraints, the RB-tree only to implement the insert and query, and didn't implement data persistence, the RB-tree temporarily in the session.
...
...
Ehhhh, ok i admit that my ability to implement is insufficient.

redis-like's People

Contributors

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