Setup

Enterprise customers are asking for an audit log: who did what, and when, in their account. Sales has promised it for next quarter.

Requirements:

  • Record actions like “user X changed setting Y from A to B” across the product.
  • Keep events for 1 year, then delete them.
  • Customers can search in the UI by person, action type, and date range, and export results as CSV.
  • Later, customers will want to stream events into their own security tools.

Numbers:

  • About 30 million events a month across all customers. The largest customer produces about 15% of them.
  • Writes are constant. Reads are rare: a few hundred searches a day, mostly over the last 30 days.

Constraints: a team of 3, 6 weeks, an existing Postgres primary that is already the busiest part of the system.

Options on the table:

  1. A plain table in the existing Postgres database.
  2. A separate Postgres database with the table partitioned by month.
  3. Write events to object storage and query them with a serverless query engine.
  4. Buy a third-party audit log service.

Commit before you see the outcome

Your call

Choose a storage approach for the audit log. What are you giving up, and which part of your decision is hardest to reverse?

Move the slider (or use the arrow keys) to set it. 0% is a pure guess; 100% means you'd bet on it.

After you reveal, your answer and confidence are locked. That's the point.