Skip to content

Comment on A letter to myself as a fresh software engineerparent

Comments

But it's also hard to understand how to write your own database if you never write one yourself.

You just took NIH to a whole new level.

That isn't NIH. In fact it is often the opposite of NIH. It is a pre-requisite of becoming a true expert in the technologies that you are using.

NIH is writing your own database and using it in production.

But understanding how to write a database makes it easier to understand why your existing database works the way it does, and what its quirks should be.

For example suppose that you have a slow query. You EXPLAIN ANALYZE to get a query plan. Now what? It really helps if you can say, "What would a program to do this look like? How fast would it be?" And then be able to say, "And if I was to write a program to do this, how would I do it? How fast would that be?" And then if the second is faster you can ask, "How can I get the database to do what I think it should do?" (Hint, in most databases with temporary tables and indexes on them, you can force your desired query plan to within a factor of 2.)

That exercise really helps in optimization. But that exercise is only available to people who know how a database actually works.

Not sure if you were joking or not, but NIH doesn't really apply if it is a project for the sake of learning.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.