On Zab

Apache ZooKeeper has become an indispensable component for many distributed systems: Apache Hadoop, Apache Mesos, Apache Kafka, Apache HBase, etc. all use ZooKeeper in some form or the other. I’ve written code that interacts with ZooKeeper and I’m a big fan of the simple APIs and powerful guarantees it provides.

I had a vague idea of the broadcast protocol that powers ZooKeeper but wasn’t awake of the details. So this weekend I decided to read a short paper that gives an overview of Zab (a more detailed description of Zab can be found in “Zab: High-performance broadcast for primary-backup systems” by Flavio P. Junqueira, Benjamin C. Reed, and Marco Serafini).

The title of the paper is extremely accurate – Zab is a very simple protocol that is intuitive and easy to understand. The paper does a great job of explaining the core concepts of the algorithm to the reader. I particularly liked section 3, which includes a comparison between Zab and Paxos. Section 4 is probably the most important section of the paper and is very well written. The figures illustrating the two main failure scenarios are a nice touch.

Next step – read the detailed Zab paper.

Let’s Go.

One of my goals of 2014 was to learn a new programming language, and for various reasons I decided on Go. While my learning progress has been pretty terrible for most of the year, I was able to make pretty good progress this week.

(Chart generated using the awesome pygal library. Code can be found here.)

Screen Shot 2014-09-28 at 11.09.48 AM

What made me get to 40% this month? Several things, but by far the most important one was A Tour of Go.

The tour is a fantastic resource for a person beginning to learn Go. It does a great job of explaining the important language features and constructs, and lets you try Go without having to install Go on your machine. This ability to try Go without having to install Go locally and setup your environment is incredibly powerful (this is how it works under the hood) and is something that I wish more languages incorporated into their websites. With the ability to compile almost anything down to Javascript one does not even have to build a remote sandbox environment (though that is more powerful and robust in my opinion) in order to introduce newcomers to your language.
I feel that the Tour could be improved by adding three things – syntax highlighting to the code in the console, more exercises, and including solutions to the exercises. Apart from that, I think it is a perfect learning resource.

My thoughts on Go? I think it is an interesting language, and something that I will most certainly delving into more. I’d read some Go code before (mostly Docker code) so I was vaguely aware of what the language looked like. I was initially a bit hesitant about the fact that Go has both high level (e.g. functional programming) and low level (e.g. pointers) features, but I think I quite like this ability to have and use both. The concurrency primitives look excellent, and I can’t wait to write some code using it. Another thing that scared me a little was the lack of classes, but structs + interfaces seem to be powerful enough to deal with that. I’ve read online about Go’s lack of generics being a problem, but I haven’t written enough code in Go to comment on this issue. I really liked the fact that the Go compiler doesn’t allow you to compile code that has unused imports or unused variables.

Next steps – read Go by Example and An Introduction to Programming in Go, and begin writing Go code to implement the two phase commit protocol.

Unresolved Resolutions

At the start of 2014 I wrote a post about what my goals were for this year. Now that we are 9 months in I thought it would be good to see how much progress I’ve made. And yes, I do agree that I should have done this 6 months in.

(Charts generated using the awesome pygal library. Code can be found here.)

  1. Learning Go – 10% progress has been made on this. I got distracted by various other things happening in life and forgot about this endeavor. I think I can still achieve this.

    Screen Shot 2014-09-10 at 10.27.51 PM

  2. Reading three research papers a month – I’m disappointed that I haven’t been able to keep up with this. While I have read a lot of research papers this year, it falls short of my goal of three a month. Papers I have read include Omega, Orleans, Photon, Raft, Paxos Made Simple, and F1.

    Screen Shot 2014-09-10 at 10.29.06 PM

  3. Blog more – My original post was pretty ambiguous by what I meant by “more”. Let’s assume “more” meant 4 posts a month. I’m tempted to make a POST related joke here but I won’t.

    Screen Shot 2014-09-10 at 10.32.38 PM

  4. Play guitar for at least 30 minutes a day – I think I’m averaging 20 minutes a day.
  5. Work out 6 days a week and start running again – Achieved minus the running. I’m definitely going to make up for that in the last 4 months though.

One Year Later

Wow. I can’t believe that it’s been a year at LinkedIn already. When I look down at my  employee badge,  it seems like it was only yesterday that I was waiting to get my picture taken before heading out for new hire orientation. Despite me looking terrible in the photo, I’m happy to say that my first year at LinkedIn has been nothing short of fantastic.

In true developer fashion, I thought it would be fun to look back at the year that passed and talk about some of the significant, and seemingly not so significant, numbers. So, without further ado, here are some statistics about my first year at LinkedIn:

(I’ve used 220 work days in a year for all my calculations)

Amazing coworkers I have: too many to count. I think this is one of the main reasons I love working at LinkedIn.

Lines of code written (additions): at least ~16000. Yes, I know lines of code is a terrible metric to measure an engineer’s productivity, and I’m not trying to do that here. This is just an approximation for lines of code I’ve written for the projects I’ve worked on that are on GitHub (Rest.li, Rest.li API Hub, and linkedin.github.com).

Coffee consumed: 495 cups. I drink 2-3 cups of coffee per day, but closer to 2 most of the days (I used 2.25 cups/day for my calculations). I’m hoping to cut down my coffee consumption but it is hard because COFFEE IS SO DELICIOUS.

Time spent working out: 180 hours. My overall fitness levels were pretty low at the end of my undergraduate life. I’m working hard on improving that.

Time spent at the pull up rings: 25 hours. One of my coworkers showed me these around 3 months after I started. I now spend 15-20 minutes a day there during my workouts.

IMG_1194

The three sets of rings.

The rings do mess up your hands.

The rings do mess up your hands.

LinkedIn shirts I own: 10 (and one hoodie). One of the first LinkedIn shirts I got was a shirt for the team that I was an intern on. Each shirt was personalized with the last name of the person as well as a number of their choice. I really wanted the number 7 on mine (I like 7 for some reason, don’t ask why) but one of my coworkers had already claimed it for themselves. I chose 91 instead. Wasn’t that a fun anecdote?

My favorite LinkedIn shirt.

My favorite LinkedIn shirt.

Hackathons I’ve mentored and been a preliminary judge at: 2. DevelopHer Hackday 2013 and Intern Hackday 2014. It was lots of fun to be on the other side of the table during a hackathon. What I found most interesting was seeing what languages and technologies other people use during a hackathon, and how the tech scene had changed since the last time I’d taken part in a hackathon. My observation – everyone loves Javascript and Node.js. And mobile. Oh, and computer vision.

Internal hackdays I’ve taken part in: 2. This number is abysmally low and is something I hope to improve on.

Unofficial team mascots broken: 1. The unofficial mascot for our team is a small blue Pegasus figurine (after the name of the Rest.li data layer). I dropped it on the ground on Friday 7/25 and one of its wings sort of broke. I’m looking for a suitable replacement.

The left wing is broken :(

The left wing is broken :(

Times I’ve felt like quitting my job at LinkedIn: 0.