5 ms·
Go has a nice set of polished libraries now for distributed computing (hashicorp/raft, etc) that makes it easy to start new projects. I wish other languages als
by manigandham 7y ago
Go has a nice set of polished libraries now for distributed computing (hashicorp/raft, etc) that makes it easy to start new projects. I wish other languages also had as many, might have to start porting.
- dnautics 7y agoRaft is incredibly easy to write correctly, with tests, since basically everything you need is in figure 2. I've done it once, but then lost all of the code because I got mugged, my computer was stolen, and I forgot to make a github repo, and am rebuilding it currently (current one I'm doing clocks at about 700 SLOC, including tests and it's about 3/4 done).
- rubiquity 7y agoRaft is not easy to implement. People think it is. But that’s only because they have implemented the happy paths, which are hard enough to get right as it is.
- dnautics 7y agothat's why you do property tests with unreliable mock networks.
- monadic2 7y agoCould you explain which parts you found difficult to implement?
- gozzoo 7y agoThe alternative to the happy paths would be all unexptecd things that might happen. They would be easy to implement only if we can forsee them. I think the diffuculty comes from our limited abiliyt to to predict all situations where things may go wrong.
- gozzoo 7y agoA classic example of this is when in 2006 it was discovered that nearly all implementations of binary search and mergsort are broken - more than 50 years after these algorithms where invented, and after they've been implemented thousands of times by the brghtest minds in computer science. Joshua Bloch (of the Java fame) bloged about this [1] and here is the main take-away: > The key lesson was to carefully consider the invariants in your programs. [1] https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html https://ai.googleblog.com/2006/06/extra-extra-read-all-about...
- manigandham 7y agoIt might be simple to implement the various operations but it's not easy to get perfect and reliable. I rather have a production-ready library used by major projects instead of something I write myself.
- hu3 7y agoI'm sorry your pc got stolen. Just wanted to say keep it up!
- frant-hartm 7y agoRaft is easy to understand. It may be easier to write compared to e.g. Paxos, but that's it. The consensus module and log are not very useful on their own. You need the integration with multiple concurrent clients, some state machine (even key value store will be complicated). This is still hard and doesn't get any easier with raft.
- CameronNemo 7y agohttps://raft.readthedocs.io/en/latest/ https://raft.readthedocs.io/en/latest/