Weekly notes #10

On destructuring, how constant lookup works in Ruby, approaches to distributed cache invalidations and how to write a good commit message.

Ruby, systems, performance, and programming links from last week.

Ruby

Support of Ruby 2.1 has ended. Time to upgrade.

Destructuring with Ruby, not only for arrays and hashes.

Everything you ever wanted to know about constant lookup in Ruby. “Constant lookup searches for constants that are defined in Module.nesting, Module.nesting.first.ancestors, and Object.ancestors if Module.nesting.first is nil or a module”. The post translates previous sentence from Latin to simple English.

IO.select based timeouts. MRI Ruby still needs to resolve the Timeout-exception-can-be-raised-anywhere-across-threads-too issue, though.

Articles

Distributed Caching Woes: Cache Invalidation - 3 approaches to distributed cache invalidation. 1) TTL, 2) fanout to caching servers 3) using a MQ and finally 4) session affinity.

Distributed systems design checklist - a nice set of questions to consider when designing a (distributed) system.

How to Write a Git Commit Message. Please do this.

networking:netem - using tc to manipulate traffic (packet loss, corruption, latency) on Linux. Super useful for testing. A nice intro on tc by Julia Evans can be found here.

Fast Compact Sparse Bit Sets - on implementing a sparse bit set by Justin Collins.