Partition-on-write library replaces scheduled watchman jobs for time-partitioned tables

A software engineer describes a shared library that creates time-based database partitions at the moment a row is written, instead of relying on a scheduled job. The author argues that the old approach, a night job pre-creating partitions, fails when the schedule is missed, the range is guessed wrongly, or a table is not registered. The library instead checks for the partition covering a row's timestamp, creates it if absent, and only then inserts the row. Design choices include requiring the application to specify the partition period with no default, and caching partition names only after the creating transaction commits. The piece is part of a series that uses a zoo metaphor to explain what a shared platform provides to its services.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in