Server Memcached implementation in Ruby

Hi, i need help. I need to do (educational purpose) a server in ruby like memcached. I know the basic about ruby and networks. I only need to implement the storage commands (set, add, replace, append and prepend) and retrieval commands (get, gets). i know how memcached works and i have an idea of how i should implement that commands, but i dont really know how to structure the hole thing, i mean should i have a client implementation and also a server implementation? how i connect the client with server using TCP conection? should i use sockets? etc.

Any help is really helpful, thanks you.

you could just make a ruby hash where each key points to (metadata,
object). you can cerealize ruby objects using Marshal

http://ruby-doc.org/core-2.4.0/Marshal.html

or JSON

http://ruby-doc.org/stdlib-2.4.0/libdoc/json/rdoc/JSON.html

and if it should work over HTTP, you could use something liek Roda:

http://roda.jeremyevans.net/

it should be pretty straight forward.

···

--
Igor

you could just make a ruby hash where each key points to (metadata,
object). you can cerealize ruby objects using Marshal

"cerealize" - hilarious! :slight_smile: Was that intentional?

and if it should work over HTTP, you could use something liek Roda:

http://roda.jeremyevans.net/

Or just use Webrick from the stdlib.

it should be pretty straight forward.

Agreed.

Kind regards

robert

···

On Sat, Sep 2, 2017 at 3:37 AM, Igor Fontana <rogi@skylittlesystem.org> wrote:

--
[guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can
- without end}
http://blog.rubybestpractices.com/