santosh79

santosh79

RemixDB - an Elixir implementation of the Redis protocol

Hi All,
I have just released a project that I had been hacking on for quite a while and would love to get your feedback. It’s basically redis implemented in Elixir. The line level protocol stays the same, this way people currently using Redis who’d (maybe) wish to switch to Remixdb, needn’t have to install new drivers/packages/what have you.

It’s still super experimental and I have some crazy ideas for doing real time sharding, moving processes across nodes in a cluster etc., but it’s no where near being reality, yet.

The repo is at – https://github.com/santosh79/remixdb.

Best,
Santosh

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Your readme promises a lot, but your code doesn’t back it up. You need to be clearer in the readme that this is wildly alpha software.

Couple of points that raise some alarms:

  • https://github.com/santosh79/remixdb/blob/master/lib/remixdb.ex doesn’t create an OTP application
  • No supervisors. Not only is this bad practice, it goes against all general claims to fault tolerance in the Readme, as well as against explicit claims to use supervisors.
  • No distributed functionality, despite claiming so in the readme.
  • Your latest commit says “Using HashDicts for better hash performance” and the commit shows you’ve replaced a bunch of Maps with HashDicts. Not only is this false, Maps perform better in literally every case, but HashDicts are deprecated.
  • you’re creating an escript, but a release would be more appropriate for a long running service.
  • extensive use of spawn_link instead of using OTP behaviours.
  • unlinked processes.
  • You aren’t following elixir conventions for file organization

I’m not trying to discourage you, I think there’s a lot of value in thinking through how a key value store in Elixir might work. However, right now your readme is 100% aspirational, but written as if it reflects the current capabilities of your code. You do yourself and your users a disservice by not being clear on this point.

sasajuric

sasajuric

Author of Elixir In Action

Having a Redis protocol compatible k-v, but with an Elixir implementation certainly sounds interesting!

However, I’d advise against hand building the distributed k-v part yourself, as it can become hard to get proper CP or AP guarantees in a clustered environment. Instead, I’d suggest looking for third party libraries which solve those problems. The first ones which come to mind are riak_core for eventual consistency, and riak_ensemble for strong consistency. I also wonder whether recent work on Phoenix presence (i.e. CRDT) could be used for a general purpose distributed k-v, and what are the trade-offs. I’ll ping @chrismccord to hear his thoughts on this :slight_smile:

However, if you just want to practice and/or have fun, then it will probably be simpler to build from scratch, as long as you’re not optimistic about proper behaviour on netsplits. Getting that part right requires carefully applying some scientific papers and a good amount of testing. Otherwise various subtle errors might occur, and the storage might have unpredictable behaviour on netsplits.

I agree with other comments, especially those made by @benwilson512. An app should be OTP compliant, because strange bugs may occur, and it might not play nicely with the client’s project. If you’re still practicing, it’s fine to violate those principles and taking baby steps in whichever order suits your flow. However, the project Readme should clearly state that, because otherwise people may get false impression about the maturity of the library. Here’s an example of how we did it for our Phoenix socket client.

Best of luck!

Qqwy

Qqwy

TypeCheck Core Team

Yes. This used to be the case, but in recent versions of Erlang (18+) this has been changed. Maps are now more performant than HashDicts. Also see http://www.theerlangelist.com/article/eia_elixir_12

santosh79

santosh79

Thanks for your suggestions. I’ve gone ahead and updated the README, to
reflect the same and appreciate your suggestions on that as well.

I hadn’t thought about riak_core/riak_ensemble. Will check it out. As for
CRDTs, isn’t that a little loose with it’s consistency guarantees? I was
considering those, but Redis is very strong with it’s consistency
guarantees, so I’d like to have RemixDB meet those as well.

Best,
Santosh

santosh79

santosh79

Appreciate your response as well. Misleading is definitely a bit of a stretch, since a whole slew of sections are TBD’ed. I’ve gone and thrown in a disclaimer now, so it should be more obvious now.

And yes, I’m in complete agreement, supervisors/other OTP constructs are definitely something that will be there when it’s usable and are a high priority. RIght now, as Sasa had picked up, it’s more of a playground than anything else. But should be usable real soon.

Best,
Santosh

Where Next?

Popular in Libraries Top

RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 11851 134
New
Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
OvermindDL1
Been making an MLElixir thing (not released yet…) for fun in spare time in the past day. I’m just trying to see how much I can get an ML...
132 13487 106
New
arkgil
Hi all! I’m happy to announce that Telemetry v0.3.0 is out! This release marks the conversion from Elixir to Erlang so that all the libr...
New
michalmuskala
Another small library today. PersistentEts Hex: persistent_ets | Hex GitHub: GitHub - michalmuskala/persistent_ets Ets table backed by...
New
riverrun
I’ve just released version 3 of Comeonin, a password hashing library. The following small changes have been made: changes to the NIF c...
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_or...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Th...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Sub Categories:

We're in Beta

About us Mission Statement