Careful with That Lock, Eugene: Part 2

Posted on 2024-05-06 in postgres • Tagged with postgres, rust

A while back, I wrote Careful with That Lock,Eugene about an idea for how to check if a database migration is likely to disturb production. That post came about after having an inspiring chat with a colleague about the advantages of transactional migration scripts and the ability to check …


Continue reading

Careful with That Lock, Eugene

Posted on 2024-04-12 in postgres • Tagged with postgres

It is rewarding to work on software that people care about and use all around the clock. This constant usage means we can't simply take the system offline for maintenance without upsetting users. Therefore, techniques that allow us to update the software seamlessly without downtime or compromising service quality are …


Continue reading

How to test for missing indexes on foreign keys

Posted on 2024-04-04 in postgres • Tagged with postgres

If you're developing a transactional application backed by postgres, there's a pretty cool trick you can use to check if you're missing indexes that could potentially cause serious performance issues or even outages. In particular, I mean foreign keys where the referencing side of the constraint does not have an …


Continue reading

Friends don't let friends export to CSV

Posted on 2024-03-24 in data • Tagged with data

I worked for a few years in the intersection between data science and software engineering. On the whole, it was a really enjoyable time and I'd like to have the chance to do so again at some point. One of the least enjoyable experiences from that time was to deal …


Continue reading

Isolating integration tests that commit transactions

Posted on 2024-03-10 in postgres • Tagged with postgres

For tests that need to touch the database, it is generally a really good idea to roll back transactions. That way, you can run lots of tests in parallell or in any arbitrary order and the tests won't interfere with each other. But sometimes, that just isn't possible. One reason …


Continue reading

Protecting your postgres server from your application

Posted on 2023-05-09 in postgres • Tagged with postgres

There are 2 configuration options that every OLTP application that uses postgres should set, in order to protect the database from high load:

  • statement_timeout
  • idle_in_transaction_session_timeout

These can both be set by client configuration and require no special permissions to set, and are easily overridden locally for transactions that have different …


Continue reading