July 13th, 2008


Google "Protocol Buffers" are the new CORBA.

Protocol buffers are "just" cross-platform data structures. All you have to write is the schema (a .proto file), then generate bindings in C++, Java, or Python. (Or Haskell. Or Perl.) The .proto file is just a schema; it doesn’t contain any data except default values. All getting and setting is done in code. The serialized over-the-wire format is designed to minimize network traffic, and deserialization (especially in C++) is designed to maximize performance. I can’t begin to describe how much effort Google spends maximizing performance at every level. We would tear down our data centers and rewire them with $500 ethernet cables if you could prove that it would reduce latency by 1%.

Besides being blindingly fast, protocol buffers have lots of neat features. A zero-size PB returns default values. You can nest PBs inside each other. And most importantly, PBs are both backward and forward compatible, which means you can upgrade servers gradually and they can still talk to each other in the interim. (When you have as many machines as Google has, it’s always the interim somewhere.)

Comparisons to other data formats was, I suppose, inevitable. Old-timers may remember ASN.1 or IIOP. Kids these days seem to compare everything to XML or JSON. They’re actually closer to Facebook’s Thrift (written by ex-Googlers) or SQL Server’s TDS. Protocol buffers won’t kill XML (no matter how much you wish they would), nor will they replace JSON, ASN.1, or carrier pigeon. But they’re simple and they’re fast and they scale like crazy, and that’s the way Google likes it.



See also: Thrift vs. ProtoBufs and The "One True Data Schema" problem.

(This also reminds me that at work, some people are using Apache's ActiveMQ and JSON as a highly scalable (we assume) message passing system between an arbitrary number of machines.)

Best explanation of double-slit experiment, EVAR.


A little bit misleading. The video insinuates that the electron mysteriously "knows" it's being watched, but fails to explain the technical details of measurement device. The electron doesn't "know" it's being watched, rather it is modified by the act of measuring its position - by whatever means the scientists decide to use.


(E.g. Heisenburg Uncertainty Principle in action.)

Electrons are particles, i.e., little tiny bullets. The deal is that electrons are highly perturbed as they emit and absorb photons. An electron can emit a photon anywhere along its path to the detector which alters the electron's trajectory. It can also absorb photons along the way. Contrary to what you might think, the electron doesn’t take a straight path from the slit it went through to the detector. The electron is absorbing/emitting repeatedly as it moves along thereby altering its course. It wanders around as it gets battered by the absorption and emission of photons. The double slit experiment is displaying the end points of a lot of different possible paths the electrons took. You need to realize that each electron took one of those many paths. The interference pattern is a probability display - the brighter stripes are showing the more probable paths and the dark regions showing the less probable paths.

But if someone says to you electrons/photons are wavicles they’re wrong. If they don’t believe you, tell them to read QED, which was written by the guy who was one of the three to figure out the mathematics and who then later, mapped the math back into human-space so the rest of us could get a handle on it. The later step was what was unique about Feynman’s genius – he not only could simplify very complex topics, he disdained unnecessarily complex explanations.

  • Current Music
    Type O Negative - My Girlfriend's Girlfriend (;])
  • Tags