CockroachDB TIL: Volume 9

This is my series of articles covering short "today I learned" topics as I work with CockroachDB. Read the previous installments:

Topics

  • Topic 1: Capture schema change history
  • Topic 2: Use Linode Object Storage for CockroachDB bulk ops
  • Topic 3: Configure DBeaver for CockroachDB Serverless
  • Topic 4: Configure DBeaver for multiple databases
  • Topic 5: Configure DBeaver CockroachDB connection with pgpass

Topic 1: Capture Schema Change History

There was a question in our community Slack on capturing schema changes from a cluster. CockroachDB has a system.eventlog table that can be inspected for audit events like schema changes, cluster configuration changes, user and role changes, etc. This table is a running record of these events and by default, it retains 90 days of events controlled by the "server.eventlog.ttl" property. This is a notable event table and not a replacement for a schema change tool, which typically persists in schema change history on a permanent basis. Here's a sample output from the table:

CategoriesUncategorized