I just read a technica article from the Discord team. Someone in their infinite wisdom decided to rewrite some systems in Rust in replacement of their Go implementation. I know some people that are interested in Rust and I struggle with their influence because in my estimation it’s just a new shiney object.
I’m certain that discord had a very good reason for going thru this effort but knowing what I do about scaling systems their effort seemed to be more about generating heat than it was solving a business or technology problem. I jumped the ship when the author mentioned that generics allowed them to delete some code. And then went on to describe some other code that was deleted for sharing state between goroutines.
But I really got peeved when the author described all these other enhancements that were applied and thus achieved these other benefits.
First and foremost while I like a good engineering problem and it’s application in production I also have a strong business side that says you do not rewrite working systems without a business driver. For Discord it was meerely a 2 minute latency. I call BS because there are so many non code related ways to deal with that problem.
Second; fucking generics… go back to java.
Next, while this was a cache solution without a problem the next BS was what exactly was the timeout causing? That they used an LRU in the first place might have been the bigger mistake to begin with. Just how many system updates can a single person make? First of all the fastest post hast to take a few seconds round trip. And the fastest set of updates has to take longer than that… consider just the tie to load the page. Then the amount of time it takes to the user to post.
(caching the page is different than caching the user data. They were talking about the user)
Lastly there was mention that there was an ejection event that caused the data to be written to a (federated) cassandra DB. At least one of the statements confused the situation. Tge Go GC, to my knowledge, does not create user events. Even if it did it does not implement a LRU… in fact if it were in the LRU then it would not be garbage collected. And so on.
Rust might make a good greefield language. Clearly Mozilla likes it and Microsoft is on it’s way to poluting it. And I’ve read about the discourse in the Rust community. Frankly this is the wrong way to do this but that is for another time.