Operations, Security, and ClickHouse Cloud
This domain covers running ClickHouse safely: SQL-driven access control, network and encryption posture, replication and backup mechanics, mutation semantics, monitoring surfaces, and how Cloud differs from self-managed. Questions often describe an operational requirement - isolate a tenant's rows, restore a table, wait for a mutation - and ask for the correct construct or the caveat.
Access control
- SQL RBAC:
CREATE USER,CREATE ROLE,CREATE SETTINGS PROFILE,CREATE QUOTA,CREATE ROW POLICY, thenGRANT SELECT ON db.* TO role. - Row policies filter rows per user; column restriction is
GRANT SELECT(col1, col2). - Profiles carry limits such as
readonly = 1,max_memory_usage,max_execution_time; attach per user or role. - The shipped
defaultuser has no password and full rights - lock it down or remove it.
Network and encryption
- Ports: 9000 native, 9440 native over TLS, 8123 HTTP, 8443 HTTPS, 9363 for Prometheus metrics.
- Cloud enforces TLS, offers IP access lists, and encrypts data at rest; customer-managed keys are an Enterprise capability.
Replication, backups, mutations
ReplicatedMergeTreecoordinates replicas through ClickHouse Keeper (Raft). Inspectsystem.replicas.absolute_delayandsystem.replication_queuefor lag.- Backup with
BACKUP TABLE ... TO S3(...)and restore withRESTORE; Cloud takes automatic backups and can write them to your own bucket. ALTER TABLE ... UPDATE/DELETEare asynchronous mutations that rewrite whole parts;mutations_sync = 1makes the statement wait. LightweightDELETE FROMonly marks rows deleted.
Cloud specifics
- Compute and object storage are separated (SharedMergeTree): storage grows without resizing compute, and compute scales vertically and horizontally.
- Idle services suspend compute after a timeout, so the first query after idling is slower.
- No direct Keeper access and no Kafka table engine - use ClickPipes for Kafka and object storage.
- Monitoring combines
system.metrics,system.events,system.asynchronous_metricswith a Prometheus integration.
Worked example
An EU analyst must see only EU rows: CREATE ROW POLICY p_eu ON db.orders FOR SELECT USING region = 'eu' TO analyst_eu; then GRANT SELECT ON db.orders TO analyst_eu. Multiple policies attached to the same user combine with OR (permissive) by default, so a user holding two regional policies sees both - a frequent exam trap.
Traps that cost marks
- Leaving
defaultpasswordless, or granting on*.*instead of schema scope. - Expecting
ALTER DELETEto take effect immediately. - Confusing replication (same data, availability) with sharding (Distributed, horizontal scale).
- Assuming Cloud supports every open-source engine.