Hacker News new | ask | show | jobs
by nephy 680 days ago
We didn’t want to build something complicated, so we implemented our own raft consensus layer. Have you considered just using Redis?
5 comments

Haha, I totally hear you. But but, we didn't really build the raft consensus layer from scratch. We used an existing robust library for that: https://github.com/baidu/braft
You completely skipped the question though
Ah, sure: I did not consider Redis at all. My goal in the Explore phase was to keep the data in the same process as my code, and replacing MySQL with any other database doesn't really help here. This was a developer-productivity goal, not a performance goal.
Redis is best as an in-memory cache, not a database. Having used it in production for roughly a decade, I don't trust it's on-disk capabilities (AOF/RDB etc) as either solid or reliable (or even performant) in an emergency scenario, especially with DR or DB migration in mind.
FWIW, how I read the article it was just an implementation of the original Redis, but with some other language (and this types) than Tcl.

Redis is/was basically just Tcl-typed which are persisted to disk using snapshots (Tcl commands) and append-only Tcl commands, that had a network protocol for non-Tcl applications to talk to

To throw the question back at you: have you considered that this isn't complicated?
No I haven’t because it’s quite complicated. Databases are very much a solved problem. Unfortunately, this architecture is going to be nigh impossible to hire for and when it goes absolutely sideways recovery will be difficult.
That’s the best part, you don’t realize when things go sideways.
Compared to installing, configuring and maintaining an installation of Redis, this absolutely is complicated. Do you think this is less complicated than using Redis?
Setting up Redis or setting this up with a certain library is deterministic P hard. Both are equally "easy", including bugs and optimization.

The difference is that Redis costs extra in infrastructure.

In what way is setting up redis or writing a program yourself P hard? What’s the input that leads to polynomial time? And what kind of metric is that? If setting up redis takes me one day or I can write a software myself in a month, does it matter if both are P hard? And if you have an hourly wage over $1, I am very sure that redis is cheaper at the end of the day than programming your own software and using that.
Polynomial time means that both are deterministic. The diffreence between the two only comes down to how much has to type and copy and paste, provided that the person is well aware and experienced to do both. And the total time for either is negligible, while Raft saves you more money long termin infra costs.

The argument that im fighting agaist is that when someone says its more complex, what they mean is that they dont have experience in doing that. From a business perspective, this is something to consider when hiring from.an average pool, since you point about salary is correct, but the assumption that every single engineer fits this criteria is not correct.

redis and mongo are the type of things i will yak shave to no ends so i don't have to deploy them in production
I’m honestly not sure what you are talking about. In my experience, Redis is super easy to run and manage in production.
I'm with you. We've been using Redis in production for more than a decade and it's one of the easiest distributed DBs we've ever used.
If you like split brains, yes. :)