benchmarking sqlite-based filesystem traversal

Have you ever wondered the performance comparison of directory traversal between a regular filesystem and a filesystem implemented in SQLite database? No? Well, I did, and I couldn’t come up with a strong argument on which one would be faster.

So, as a scientist1, I thought it would be fun to do a benchmarking experiment without having strong hypothesis on how things will go.

read more →

on delete cascade

I have not written SQL in a while, and today I know I needed to define a column with ON DELETE CASCADE. However, playing out the deletion scenario in my head was challenging (i.e. should it be here or the other table?) — it felt like the first time learning SQL.

I found a DBA StackExchange thread that was helpful: SQL:2011 Spec of ON DELETE behaviors.

adding cover alt text

Espresso in a demitasse with colorful spoon.

The picture above has nothing to do with the post, except that I just finished updating <meta> tags in the templates and now posts with pictures can have link preview with pictures, while having custom alt text in the post.

If you are using the same hugo terminal theme like this blog, you can do it by overriding the partials (by default, the alt text is post title, which I think isn’t quite enough for the way I post pictures).

url rewrites

I did some URL rewriting for this site:

  • /words/:id => /w/:id
  • /monthly/:id => /m/:id
  • /pictures/:id => /p/:id

Existing posts has aliases which will redirect to the new URL. I think I made all the changes required in this site as well as external references. I would appreciate it if you let me know what I missed!

New URL format will be used from hereon!

tandem bike and team slack

I had this conversation today, which I think is worth sharing more broadly.

For context, throughout my time at Pivotal / VMware, there is a concept called “flex time” where you are left to your own judgement on what to use 1 hour out of your 8 work hours to make yourself a better engineer (or coworker, or team player). It’s flex because it is (in my experience) truly flex — sometimes the best thing to do with that hour is to cook dinner, read a book, or build a prototype of an idea you have which hasn’t been prioritized by the team.

Anyhow, I am glad that my managers have been checking in from time to time, “have you been sacrificing your flex time?” which is treated as a high priority team health check.

And today it clicked to me: running teams are like riding tandem bikes — bicycle continues to move, but it’s hard to tell who is putting extra hours until it’s too late. Asking these questions is a mechanism to check if anyone isn’t clocking off on time.

So here’s a reminder to build slack and capacity for your team resilience, and cultivate a safe environment for your team to speak up when there is too much to do.

a tale of protocol of minimizing cost

I once stumbled on a story from the era of workers’ competence in Silicon Valley being measured through brainteasers: (paraphrased, recited from memory)

Let’s ask a candidate: “Alice would like Bob to call her in the future and Alice would like to keep her phone number private. What should Alice do?”

Microsoft would want you to elaborate cryptographic scheme for Alice and Bob to communicate secretly.

However, Google would want you to start with: “Alice should tell Bob to call them, and provide backup plan if Bob has trouble doing so.”

read more →

metaprogramming json to ruby

I was looking for an excuse to revisit Ruby after writing a lot of Go in the recent months, so I thought I would do something with Bored API.

I had learned about Bored API recently from a talk by Justin Searls. In short, Bored API is an endpoint returning random values with the option of querying based on parameters.

read more →