My internship at Pusher.
This summer I’ve been working at Pusher (“powering realtime with spit and glue”, as my mug says). When I’m not interning, I’m doing a Ph.D in testing concurrent programs at the University of York, so it was a bit of a change. Not many people arrange a nice relaxing break by getting a full-time job, but the academic machine is a strange place to be a cog.
The main project I’ve been working on is a distributed message bus written in Go using Raft consensus, which is hoped to replace the current Redis-based system (and is now deployed on one production cluster!).
It’s a bit different to what I expected. When I had my interview a few months before, the plan was to work on testing the current Haskell-based replacement system. Unfortunately, that had to be scrapped due to garbage collection performance (read about that in this great blog post).
So, we switched to Go.
I’d never written any Go before June, now I’ve written maybe 30,000 lines across four projects (three work, one personal). Not all that is live, bits of it have since been modified by myself or others, but it’s still a substantial amount to write. I now consider myself intermediate at Go.
Go is a bit of a polarising language. It’s very simple and easy to pick up (for evidence, see my summer), there’s not a lot to the language. I won’t get too much into whether it’s a good language. Go is very good at what it does, which is being a simple tool allowing you to write fast code without too much effort. On the other hand, I think some decisions made in its design actively hinder, if not prevent, writing verifiably correct code and make it easier than necessary to slip up.
I had the opportunity to go to GolangUK, and there were some really interesting talks. When the videos are up, I particularly recommend Static Deadlock Detection for Go by Nicholas Ng, and What is a container, really? Let’s write one in Go from scratch by Liz Rice. The former is quite close to my research (although taking a different approach: static analysis rather than testing), and I’ll be keeping an eye on further developments; the latter was really interesting because containers never seem to be explained well, and seeing one live-coded in about 50 lines really helped me understand what they actually are.
In addition to never having written any Go before starting at Pusher, I’d never programmed a distributed system either. Fortunately, the Raft paper is very approachable for beginners, and the library we were using quite clear. It was definitely a new paradigm to get used to, although I think I would have found it much harder than I did if I were less familiar with concurrency. There were definitely a few things which tripped me up, but on the whole it was alright.
As I plan to look at testing distributed systems for the next stage of my research, it was great to get some actual hands-on experience. My simplified for-research mental model of a distributed system didn’t change, but it was nice to get some confirmation that it wasn’t way off-target.
If you have any comments or questions, feel free to send me an email or contact me on Twitter (@barrucadu).