(no title)
zinxq | 2 years ago
In 2010, Zuck gave a lot of money to NJ schools. For reasons completely unknown to me, Bob, who was at Square at the time, was given the task of writing the code to accept the donations that would be given from the public alongside Zuck's gift. For reasons also completely unknown to me, Bob called me and asked me to help write the code. We had something like 3 days. I was working at my own startup at the time but was excited to go work on this one-off with Bob.
We had worked together at Google and spent a lot of time in the Java community thereafter. We were both Java geeks at the time, but I was confused why he couldn't find anyone at Square.
In any case - I went to Square each day for 3(?) days. I remember that we didn't need to process the transactions (thank goodness), but we just needed to validate and log them which made the problem much much easier. Bob insisted we write each transaction to 3 different machines for redundancy. He also insisted we used fsync which ensured the disk writes actually happened and didn't just get left in an output buffer. He was absolutely right, but I remember being saddened how much slower it made our system.
We finished the system with time to spare. Unbeknownst to me (and maybe Bob I guess) another team at Square also implemented the system in Ruby in competition with us. I recall them being rather "anti-Java" at the time.
In any case, we then benchmarked both systems and unsurprisingly, the Java version was many times faster than the Ruby version (in transactions stored per second). Of course, apart from fsync, this was also not just Java code - it was CrazyBob's Java code which wasted nothing. I really had a blast working on that project with him.
I now realize I really don't know so many finer points of why many of these decisions were made. If any early Square folks were there for this, I'd be interested in what you remember.
zinxq|2 years ago
Bob called me after Zuck's announcement that the system hit a peak of (wait for it), 5 transactions per second. And that for only a very short time. The system was mostly only loaded with a transaction every few seconds (or maybe even minutes)
The Ruby version would have been fine. Heck, we probably could have just printed the transactions to some screen and have someone write them down at that speed.
We did have a good laugh though.