Database Size Limit ADR 002: Limit new columns for tables larger than 100 GB

Context

GitLab aims to maintain table sizes under 100 GB for optimal performance and manageability. Table size growth occurs through:

  • Adding new columns
  • Increasing row counts
  • Creating new indexes

While this decision focuses on preventing new column additions, other size control methods like partitioning and data retention policies are handled separately.

Decision

We prevent new column additions to tables larger than 100 GB through:

  1. RuboCop enforcement (!173248)
  2. Documentation of allowed exceptions (!169164)

Exceptions to this rule are documented in our development guidelines and require explicit approval.

Consequences

  • New features may require additional engineering effort.
  • Some features may require architectural changes.
  • Large tables may require partitioning strategies.
  • Data retention policies become more critical.
  • Developers may need to create separate tables for related data (for example, namespace_settings for namespaces). This may add some complexity to the database schema.