6 ms·
Redcon – Fast Redis-compatible server framework for Go
- deleted 10y ago[deleted]
- eknkc 10y agoNote 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 10y agoI 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?
- eknkc 10y agoCould be used for proxying redis connections, be it for clustering or I don't know, add sophisticated access control or something. You could expose a memcached cluster as a redis server using this. (Not sure why would you want to do that.. Maybe if you have an existing memcached cluster and have redis client code?) Or you could go crazy and implement the entire set of redis commands on top of sqlite and call it a "strongly persistent redis" or something like that. It's just a nice building block, I'm sure people would find ways to abuse it :)
- otterley 10y agoI'm not sure, either. By the time you've implemented all the actual Redis functions, there's no telling whether the server will be more or less performant than Redis itself. (Most likely less, since Redis is written in optimized C.) Of course the existing benchmark shows that the example Go implementation is faster. For one, the Go implementation provided avoids a lot of functionality that the Redis server implements, such as TTL checking.
- tidwall 10y agoThis is not for recreating Redis, but for custom server implementations such as the Tile38 project, proxying services, and microservices that might need to use the RESP protocol.
- _RPM 10y agoBecause it's written in Go of course.
- JulianMorrison 10y agoYou have a more complicated data storage, or an established one that you don't wanna change, or a mandate from on high that all data must be put in X due to auditing or whatever - and a program that wants to talk to Redis.
- bradrydzewski 10y agoThe use case would be implementing the redis protocol for client server communication in your own software. There is a specification for using the redis protocol [1]. The fact that redis is widely used and there are a number of client libraries in many languages may make it an attractive option compared to creating your own protocol from scratch. I believe disque, the distributed message broker [2] uses the redis protocol for client server communication. [1] http://redis.io/topics/protocol http://redis.io/topics/protocol [2] https://github.com/antirez/disque https://github.com/antirez/disque
- LeanderK 10y agoDo 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 10y agoi would say rust is the new kid on the block, go is old news.
- lohankin 10y agoThe main problem of rust is that it's not implemented in go. The reverse is also true.
- spriggan3 10y agoDidn't see a lot of HN posts about "How one rewrote Y from Z to Rust" yet.
- otterley 10y agoEditors: can you please change the title? It's not a "Redis server implementation" at all.
- spullara 10y agoI reimplemented it in Java, including all the commands, with similar results. Mostly useful as a mocking tool during unit tests.
- rad_gruchalski 10y agoBut why: https://github.com/kstyrc/embedded-redis https://github.com/kstyrc/embedded-redis
- the_duke 10y agoBecause reinventing the wheel is an immense amount of fun, if you get to do it yourself. ;) A good learning experience too. Everyone should at one point write their own compiler. And maybe their own OS. (I'm only half kidding here)
- rad_gruchalski 10y agoThat's a good reason.
- the_duke 10y agoSomeone should tell the JS crowd though, that you shouldn't neccessarily reinvent everything every 6 months and use it in production.
- vertex-four 10y ago
- tidwall 10y agoNote 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 https://github.com/tidwall/sider
- cnfnjrnxnx 10y agoFor what purpose?
- zzzcpan 10y agoThis 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.
- deleted 10y ago[deleted]
- yepperino 10y agoIt'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?
- politician 10y agoIf 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.
- thdespou 10y agoI think we need to set up www.not-another-redis-clone.com