top | item 12327803

Redcon – Fast Redis-compatible server framework for Go

105 points| tidwall | 9 years ago |github.com | reply

49 comments

order
[+] eknkc|9 years ago|reply
Note that it's a redis serialization protocol and tcp server implementation. It's up to you to define redis commands such as get, set etc.

This can be used coupled with a backend storage to provide custom redis servers.

It's not a redis implementation by itself.

[+] butabah|9 years ago|reply
I don't see how it's useful then. Maybe someone can give me a good use case?

redis is already very bare-bones and dead simple to set up and maintain, what more does one want? Wouldn't adding more logic into a redis-like environment be a little cumbersome from an architecture perspective?

[+] politician|9 years ago|reply
If you need an easy to write, debug, and operate RPC tech for building networked components with minimal dependencies/effort, writing Go servers with RESP (iirc, REdis Serialization Protocol) is surely the way to go. I've built several of these things (although, with a custom RESP parser), and, from my experience, the ROI is pretty high -- it's up there with bash scripts for getting stuff done.
[+] zzzcpan|9 years ago|reply
This is a not a good way to do this kind of thing. Simple stateless redis protocol parser and an example to use it would be a much better interface.
[+] tidwall|9 years ago|reply
Note that this is not a full reimplementation of Redis in Go, but rather a framework for implementing a Redis-like server in Go.

If what you are looking for is a Redis implementation, I did create a Redis v1 clone in Go a while back. It's is only a proof-of-concept and lead to the development of Redcon.

https://github.com/tidwall/sider

[+] spullara|9 years ago|reply
I reimplemented it in Java, including all the commands, with similar results. Mostly useful as a mocking tool during unit tests.
[+] stevekemp|9 years ago|reply
You're not alone, I wrote wire-compatible version of Redis in perl:

https://github.com/skx/predis

Of course I simplified things by only implementing keys and sets, rather than all the operations such as hashes, etc. But allowing pluggable storage back-ends made it useful for my use-case(s).

[+] spriggan3|9 years ago|reply
> Mostly useful as a mocking tool during unit tests.

AFAIK redis has tests, you don't need to rewrite tests for redis in Java. Mocking implies test assertions in the Mock. I'm sure redis driver for Java has tests too. That's what you should mock.

[+] yepperino|9 years ago|reply
It's not a server. You can't implement a redis-compatible server in 100 lines of Go code. How did this make it to the front page of HN?
[+] LeanderK|9 years ago|reply
Do we really need one post a day on the frontpage where somebody reimplements something in Go?

Just because the language is really hyped right now?

[+] dominotw|9 years ago|reply
i would say rust is the new kid on the block, go is old news.
[+] otterley|9 years ago|reply
Editors: can you please change the title? It's not a "Redis server implementation" at all.