Today will be two half-day tutorials.
The first one is a filler. The original speaker had to withdraw, so it’s billed as a mini-unconference where the attendees determine the topics.
The second one is a detailed dive into postgresql.conf. I haven’t looked at one since 2014! The talk’s description got me thinking about leaky abstractions and the perils of ease.
Except for security tools, everything we use is a leaky abstraction. It helps (or even is necessary) to know what’s going on behind the abstraction to use it well. An example of minimal leakage might be a well-designed API. An example of maximal leakage is a DBMS like PostgreSQL.
The query planner is exhibit A for abstraction leakage. You can see everything Postgres will do to process a query. Knowing whether a table is partitioned or a column is indexed informs decisions about how you write a query. Fixing a performance problem might mean using these techniques or others without affecting response content. Awareness of the effects of subqueries, JOIN tricks, primary key types, etc. are all leaks in the DBMS abstraction.
If you don’t know any of these, or choose to ignore them, you can design a schema and database that works for a small demo or prototype. But not for a non-trivial production system.
This got me thinking about the tools we use to make Postgres easier. Today everything is in the cloud, and services like RDS are deployment abstractions on top of the DBMS abstraction. We then use tools like Terraform or Argo CD as definition and deployment abstractions — on top of the RDS abstraction, which is on top of the DBMS abstraction. It’s turtles all the way down!
Postgres is a program (I just showed my age. It’s not a program, it’s an application) that reads postgresql.conf and other files when it boots. Some of our Terraform definitions get turned into postgresql.conf statements. But which ones, and how? We don’t know nor care. To handle today’s types of technical problems, we can’t care. We must trust the tools to do the right thing, even when we don’t understand — really understand — how they do what they do.
So diving into postgresql.conf will be a ton of fun!
