Introduction
To speed up the analysis of historical build event data, BuildBuddy can be configured to use ClickHouse as an OLAP database, in addition to the primary SQL database required for core functionality.Setting up ClickHouse is completely optional when using BuildBuddy.
BuildBuddy does not require ClickHouse for its core features, including the build results UI, remote cache, and remote execution system.
Configuration Options
This is a connection string used by the database driver to connect to the database. ClickHouse database is supported.
If ClickHouse is using a cluster deployment, this will enable data replication within the cluster.
Example Configurations
Sizing
2 CPUs and 50 GiB memory can handle ~150 insert QPS (normal) / 600 QPS (peak). Disk usage can be estimated as follows:| Table | avg_bytes_per_row |
|---|---|
| Executions | 260 |
| Invocations | 107 |
| TestTargetStatuses | 23.0 |
TestTargetStatuses corresponds to Targets and TargetStatuses in MySQL.
An additional 20% disk is recommended to be reserved to handle additional disk usage during merging.Feature Configuration
After configuring the ClickHouse connection, you’ll need to enable specific feature flags to use the OLAP-powered UI features:Trends and Drilldown
The Trends page provides historical analysis of build performance and patterns. An example of how to use Trends and Drilldown can be found at this blog post. Most of the features are enabled by default once you set up the OLAP database.config.yaml
Tags Filtering
Tags allow you to categorize and filter invocations. While tags can be used without ClickHouse, it is highly recommended to use them with ClickHouse for better performance.config.yaml
Test Grid
The Test Grid provides a comprehensive view of test results over time.config.yaml
Flakes
The Flakes UI shows “Flaky” and “Likely Flaky” test targets. This requires the same configuration as Test Grid plus turning on a new flag.config.yaml
Audit Logging
Audit logs track administrative events and require ClickHouse for storage.config.yaml
Remote Execution Data Storage
By default, BuildBuddy automatically writes remote execution data to ClickHouse when an OLAP database is configured. You can also enable reading execution data from ClickHouse instead of the primary database for better performance.config.yaml
olap_reads_enabled and write_execution_progress_state_to_redis are enabled, BuildBuddy will:
- Read completed execution data from ClickHouse
- Read in-progress execution information from Redis
- Fall back to the primary database for executions not found in ClickHouse
write_executions_to_primary_db: false), so that executions are only written to Redis + ClickHouse, reducing load on the primary DB.
It may also be desired to set primary_db_reads_enabled: false to skip primary DB reads once primary DB writes are disabled. This will speed up queries for the executions page, but older invocations created before migrating to ClickHouse will not have any execution data displayed in the UI.