---
title: "ClickHouse® MinIO Integration for S3 Object Storage"
excerpt: "Learn to integrate ClickHouse® with MinIO for local, cost-efficient, high-performance S3-compatible storage."
authors: "Tinybird"
categories: "AI Resources"
createdOn: "2026-12-02 00:00:00"
publishedOn: "2026-12-02 00:00:00"
updatedOn: "2026-12-02 00:00:00"
status: "published"
---

ClickHouse® and MinIO integration provides **S3-compatible object storage** for analytical workloads without AWS dependency. MinIO delivers **high-performance object storage** on-premises or in private cloud with **full S3 API compatibility**. ClickHouse® treats MinIO as **standard S3 endpoint** enabling data lake queries, tiered storage, backups, and streaming ingestion.

This integration matters because MinIO offers **cost-effective object storage** with **data sovereignty** and **predictable performance** versus public cloud. Organizations achieve **lakehouse economics** (cheap storage, fast queries) while maintaining **infrastructure control** and **network locality** critical for high-throughput analytics.

However, MinIO isn't just "install and use as S3." Success requires understanding **metadata management strategies**, **filesystem consistency requirements**, **cache layer design**, **merge operation optimization**, and **orphan object prevention**—operational complexity public S3 abstracts but self-hosted MinIO exposes.

This guide examines ClickHouse® MinIO integration across deployment patterns—**direct file access** with `s3()` function, **external S3 tables**, **MergeTree storage on MinIO** with hot/cold tiering, **S3Queue streaming ingestion**, and **backup/restore workflows**. We'll show when **federation makes sense** versus **native storage**, what **consistency guarantees** you're accepting, and how to architect MinIO-backed analytics delivering **performance without operational nightmares**.

## **Before MinIO Integration: Do You Actually Need Object Storage?**

Most teams evaluating ClickHouse® MinIO integration face one question: should we use **MinIO for lakehouse federation** (query files directly), **tiered storage** (hot local, cold MinIO), or **full MergeTree on MinIO** (storage-compute separation)?

Before architecting MinIO integration with ClickHouse®, consider whether you need object storage complexity at all.

### **Tinybird: Real-Time Analytics Without Object Storage Operations**

Tinybird is a **fully managed real-time data platform** built on ClickHouse® that **eliminates object storage complexity** entirely. Instead of managing MinIO clusters, configuring storage tiers, tuning cache layers, and coordinating merge operations across object storage, you **ingest streaming data directly** and **serve analytics as production APIs**.

**Complete Storage Management Automated**

Where MinIO integration requires **cluster deployment** (distributed erasure coding sets), **disk configuration** (XFS/ZFS/BTRFS for consistency), **metadata management** (local vs plain vs plain\_rewritable), **cache tuning** (filesystem cache sizing), and **orphan object cleanup**, Tinybird handles **all storage operations** automatically.

Platform manages **ingestion, transformation, storage optimization, and API serving** without infrastructure decisions. No MinIO cluster sizing, no disk type selection, no cache eviction tuning.

**Sub-100ms Queries Without Object Storage Latency**

MinIO-backed ClickHouse® queries depend on **object storage latency** (10-100ms+ for cache misses), **network throughput** (critical for parallel reads), **file count** (thousands of small objects degrade performance), and **cache hit rates** (miss penalties expensive).

Tinybird delivers **p95 latency under 100ms** automatically over billions of rows. No object storage read latency, no cache warming strategies, no file compaction workflows. **Consistent performance** regardless of data volume or access patterns.

**Zero Lakehouse Maintenance**

MinIO operational burden includes: **cluster monitoring** (disk health, network saturation, request throttling), **compaction coordination** (preventing small file proliferation), **orphan detection** (desynchronized metadata), **filesystem selection** (consistency requirements), and **erasure coding configuration** (parity vs capacity trade-offs).

Tinybird **eliminates lakehouse operations** completely. No MinIO cluster management, no storage policy design, no cache layer tuning. Platform handles **automatic optimization** transparently.

**When Tinybird Makes Sense**

Tinybird is ideal when:

* **Real-time analytics APIs primary goal** (dashboards, embedded analytics, operational monitoring)  
* **Sub-100ms query latency critical** for user experience without object storage variables  
* **Operational burden unacceptable**—team lacks bandwidth for MinIO cluster operations and ClickHouse® storage tuning  
* **Development velocity matters**—ship features in hours, not weeks configuring storage tiers  
* **Avoiding infrastructure complexity** while maintaining ClickHouse® analytical performance

This makes it particularly effective for workloads such as [social media analytics](https://www.ibm.com/think/topics/social-media-analytics), where fast insights from streaming data directly impact user engagement and decision-making.

## **MinIO as S3-Compatible Object Storage**

MinIO provides **high-performance object storage** with **S3 API compatibility** enabling ClickHouse® to treat it as standard S3 endpoint. Unlike AWS S3, MinIO runs **on-premises** or **private cloud** providing **data sovereignty**, **network locality**, and **cost predictability**.

### **S3 Compatibility Scope**

MinIO implements **core S3 APIs** ClickHouse® requires:

* **Object operations:** PutObject, GetObject, HeadObject, DeleteObject  
* **Bucket operations:** ListObjectsV2, CreateBucket, DeleteBucket  
* **Multipart uploads:** InitiateMultipartUpload, UploadPart, CompleteMultipartUpload  
* **Metadata:** Object tagging, custom headers, ETag validation

Critical compatibility note: ClickHouse® Cloud does NOT support MinIO. This integration applies to self-managed ClickHouse® or deployments where you control server configuration. Much like [Apache](https://www.sumologic.com/blog/apache-web-server-introduction) defines a foundational protocol layer for web services, MinIO’s S3 implementation forms the backbone of object-based analytics pipelines.

### **Consistency Model (Critical for Production)**

MinIO guarantees **strict read-after-write** and **list-after-write consistency** in standalone and distributed modes—**when using proper filesystems**. MinIO supports **XFS, ZFS, BTRFS** for distributed deployments and **explicitly discourages EXT4 and NFS**.

**Why filesystem matters:** ClickHouse® performs **intensive list, read, write, delete operations** during merges, TTL moves, mutations, and part maintenance. **Filesystem inconsistencies** cause the worst type of failures—objects appearing/disappearing unpredictably in listings or reads.

**Operational translation:** If deploying MinIO for production ClickHouse®, use **recommended filesystems** (XFS/ZFS/BTRFS) or accept operational fragility from eventual consistency.

## **Four Integration Patterns**

### **Pattern A: Direct File Access (Data Lake Without Loading)**

Use **`s3()` table function** querying or exporting files (CSV, Parquet, JSON) in MinIO **without creating persistent tables**. Ideal for:

* **Exploratory analytics** over lakehouse data  
* **One-time data loads** from external sources  
* **Export workflows** generating reports or extracts  
* **Data exchange** between systems via object storage

For teams comparing ClickHouse® object storage patterns with relational databases, understanding how systems like [PostgreSQL](https://www.ibm.com/think/topics/postgresql) handle data ingestion and querying helps contextualize MinIO integration trade-offs.

**Basic query example:**

```sql
-- Read Parquet from MinIO
SELECT *
FROM s3(
    'http://minio:9000/datalake/events/date=2026-02-01/*.parquet',
    'MINIO_ACCESS_KEY',
    'MINIO_SECRET_KEY',
    'Parquet'
)
WHERE user_id = 12345
LIMIT 100;
```

**Export to MinIO:**

```sql
-- Export aggregated results to Parquet
INSERT INTO FUNCTION s3(
    'http://minio:9000/exports/top_users_{_partition_id}.parquet',
    'MINIO_ACCESS_KEY',
    'MINIO_SECRET_KEY',
    'Parquet'
)
SELECT
    user_id,
    count() AS events,
    sum(revenue) AS total_revenue
FROM events
WHERE event_date >= today() - 30
GROUP BY user_id
ORDER BY total_revenue DESC
LIMIT 100000;
```

**Parallel processing across cluster:**

```sql
-- Distribute file processing across ClickHouse nodes
SELECT *
FROM s3Cluster(
    'production_cluster',
    'http://minio:9000/datalake/events/*.parquet',
    'MINIO_ACCESS_KEY',
    'MINIO_SECRET_KEY',
    'Parquet'
)
WHERE event_date = today();
```

`s3Cluster()` **divides files** across cluster nodes enabling **horizontal scale** for large file sets.

### **Pattern B: External S3 Tables (Persistent Reference)**

Create table with **S3 engine** pointing to MinIO path. Useful when treating **object storage as table** without native ClickHouse® storage:

```sql
CREATE TABLE events_external
ENGINE = S3(
    'http://minio:9000/datalake/events/*.parquet',
    'MINIO_ACCESS_KEY',
    'MINIO_SECRET_KEY',
    'Parquet'
);

-- Query like native table
SELECT event_type, count() AS events
FROM events_external
WHERE event_date >= today() - 7
GROUP BY event_type;
```

**Limitations:**

* **No indexes** (full scans unless Parquet statistics prune)  
* **No ALTER operations** (schema changes require recreating table)  
* **Performance depends** on file count, partitioning, object size

### **Pattern C: MergeTree Storage on MinIO (Tiered Architecture)**

Use MinIO as **storage backend** for ClickHouse® MergeTree tables. Most powerful pattern enabling:

* **Storage-compute separation** (scale storage independently)  
* **Hot/cold tiering** (recent data local, historical data MinIO)  
* **Cost optimization** (cheap object storage vs expensive local disks)  
* **Snapshot backups** (leverage object storage durability)

**Disk configuration example:**

```xml
<disks>
    <minio_disk>
        <type>s3</type>
        <endpoint>http://minio:9000/clickhouse-data/</endpoint>
        <access_key_id>MINIO_ACCESS_KEY</access_key_id>
        <secret_access_key>MINIO_SECRET_KEY</secret_access_key>
    </minio_disk>

    <minio_cache>
        <type>cache</type>
        <disk>minio_disk</disk>
        <path>/var/lib/clickhouse/minio_cache/</path>
        <max_size>200Gi</max_size>
        <cache_on_write_operations>1</cache_on_write_operations>
    </minio_cache>
</disks>

<storage_policies>
    <tiered_policy>
        <volumes>
            <hot>
                <disk>default</disk>
            </hot>
            <cold>
                <disk>minio_cache</disk>
            </cold>
        </volumes>
    </tiered_policy>
</storage_policies>
```

**Create table with tiered storage:**

```sql
CREATE TABLE events_tiered (
    event_date Date,
    user_id UInt64,
    event_type LowCardinality(String),
    revenue Decimal64(2)
)
ENGINE = MergeTree()
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_type, user_id, event_date)
SETTINGS storage_policy = 'tiered_policy'
TTL event_date + INTERVAL 7 DAY TO VOLUME 'cold';
```

**Data automatically moves** from local (hot) to MinIO (cold) after 7 days via TTL.

### **Pattern D: Streaming Ingestion with S3Queue**

Treat MinIO path as **file stream** where each object processed once. Useful for:

* **Microbatch ingestion** (files arriving periodically)  
* **Event-driven workflows** (process new files automatically)  
* **Decoupled architectures** (producers write MinIO, ClickHouse® consumes)

**S3Queue table example:**

```sql
CREATE TABLE s3_queue_ingest (
    ts DateTime,
    user_id UInt64,
    event_type LowCardinality(String)
)
ENGINE = S3Queue(
    'http://minio:9000/inbox/*.json.gz',
    'MINIO_ACCESS_KEY',
    'MINIO_SECRET_KEY',
    'JSONEachRow',
    'gzip'
)
SETTINGS mode = 'unordered';

-- Target MergeTree table
CREATE TABLE events_local (
    ts DateTime,
    user_id UInt64,
    event_type LowCardinality(String)
)
ENGINE = MergeTree()
ORDER BY (event_type, ts);

-- Materialized view consuming stream
CREATE MATERIALIZED VIEW mv_s3_ingest TO events_local
AS SELECT ts, user_id, event_type FROM s3_queue_ingest;
```

**Critical:** S3Queue expects **idempotent file names**. Overwriting objects or non-unique names causes **duplicates or processing failures**.

## **Metadata Management Strategies (Production Critical)**

When using MinIO as **MergeTree storage backend**, metadata management determines **operational stability**. ClickHouse® maps **local filesystem paths** to **MinIO objects** using metadata—**lose metadata, lose data access**.

### **Metadata Type Options**

**Local metadata (default):** Metadata stored in **local filesystem** on ClickHouse® nodes. Object paths, checksums, part references stored locally.

**Advantages:**

* **Fast metadata access** (no network latency)  
* **Mature implementation** (battle-tested)

**Disadvantages:**

* **Node restart without persistent storage** loses metadata  
* **Redeployments** require metadata backup/restore  
* **Orphan objects** if metadata desynchronizes from MinIO

**Plain metadata:** Metadata stored **in MinIO** using standard object names. Introduced in 22.10 as **write-once storage**.

**Advantages:**

* **No local state dependency** (metadata in MinIO)  
* **Simpler node replacement** (metadata travels with data)

**Disadvantages:**

* **Write-once limitation** (no rewrites, limited use cases)  
* **Different semantic** than standard MergeTree operations

**Plain rewritable metadata:** Extension of plain supporting **rewrites**. Available from 24.5.

**Configuration example:**

```xml
<disks>
    <minio_plain>
        <type>object_storage</type>
        <object_storage_type>s3</object_storage_type>
        <metadata_type>plain_rewritable</metadata_type>
        <endpoint>http://minio:9000/clickhouse-data/</endpoint>
        <access_key_id>MINIO_ACCESS_KEY</access_key_id>
        <secret_access_key>MINIO_SECRET_KEY</secret_access_key>
    </minio_plain>
</disks>
```

**Operational recommendation:** Test metadata recovery scenarios (node failure, redeployment) before production. Validate **metadata visibility** matches expectations in `system.disks` and `system.remote_data_paths`.

## **Filesystem Cache Layer (Required for Performance)**

MinIO-backed MergeTree **requires filesystem cache** for acceptable query performance. Without cache, every read pays **object storage latency** (10-100ms+) making analytical queries **orders of magnitude slower**.

### **Cache Configuration**

```xml
<disks>
    <minio_disk>
        <type>s3</type>
        <endpoint>http://minio:9000/clickhouse-data/</endpoint>
        <access_key_id>MINIO_ACCESS_KEY</access_key_id>
        <secret_access_key>MINIO_SECRET_KEY</secret_access_key>
    </minio_disk>

    <minio_cache>
        <type>cache</type>
        <disk>minio_disk</disk>
        <path>/var/lib/clickhouse/cache/</path>
        <max_size>500Gi</max_size>
        <cache_on_write_operations>1</cache_on_write_operations>
        <enable_cache_hits_threshold>3</enable_cache_hits_threshold>
    </minio_cache>
</disks>
```

**Key parameters:**

* **`max_size`:** Cache size with **LRU eviction** when full  
* **`cache_on_write_operations`:** Enable **write-through caching** during INSERT and background merges  
* **`enable_cache_hits_threshold`:** Cache only after **N reads** (avoid cache pollution from one-time scans)  
* **`enable_filesystem_query_cache_limit`:** Per-query cache limits preventing single query monopolizing cache

**Performance impact:** Properly sized cache provides **local disk performance** for hot data while maintaining **object storage economics** for cold data. **OS page cache** on cache filesystem provides **additional acceleration** (cache on cache effect).

## **Hot/Cold Tiering Best Practices**

Most stable MinIO pattern: **hot data on local disks**, **cold data in MinIO**, **cache for MinIO reads**.

### **Why Avoid Merge-Heavy MinIO Workloads**

**MergeTree merges rewrite data parts**—in object storage this means:

* **More PUT operations** (writing new merged parts)  
* **More DELETE operations** (removing old parts)  
* **Higher latency** (object operations slower than local disk)  
* **Increased costs** (request pricing in cloud, resource usage self-hosted)

**Recommendation:** Keep **recent high-write data** on local storage. Move to MinIO via **TTL** after write activity stabilizes.

### **TTL-Based Tiering**

```sql
CREATE TABLE events_tiered (
    event_date Date,
    user_id UInt64,
    event_type String,
    data String
)
ENGINE = MergeTree()
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_date, user_id)
SETTINGS storage_policy = 'hot_cold'
TTL event_date + INTERVAL 30 DAY TO VOLUME 'cold';
```

**Data lifecycle:**

1. **INSERT:** Data lands on **local (hot)** volume  
2. **Merges:** Happen on **local storage** (fast)  
3. **30 days:** TTL **moves parts** to MinIO (cold) volume  
4. **Queries:** Cache provides **acceptable performance** for cold data access

### **Storage Policy Fine-Tuning**

```xml
<storage_policies>
    <hot_cold>
        <volumes>
            <hot>
                <disk>default</disk>
                <prefer_not_to_merge>0</prefer_not_to_merge>
            </hot>
            <cold>
                <disk>minio_cache</disk>
                <prefer_not_to_merge>1</prefer_not_to_merge>
            </cold>
        </volumes>
        <move_factor>0.1</move_factor>
    </hot_cold>
</storage_policies>
```

**`prefer_not_to_merge`:** When enabled on cold volume, **pushes merges toward hot volume** reducing object storage rewrite overhead.

## **Performance Optimization for MinIO Backend**

### **S3 Connection and Request Settings**

```sql
-- Maximum concurrent connections to MinIO
SET s3_max_connections = 100;

-- Request throttling (prevent overwhelming MinIO)
SET s3_max_get_rps = 1000;
SET s3_max_get_burst = 2000;
SET s3_max_put_rps = 500;
SET s3_max_put_burst = 1000;

-- Timeouts and retries
SET s3_request_timeout_ms = 30000;
SET s3_connect_timeout_ms = 10000;
SET s3_max_single_read_retries = 5;

-- Parallel multipart uploads
SET s3_allow_parallel_part_upload = 1;

-- Verify uploads (adds HEAD request per object)
SET s3_check_objects_after_upload = 1;
```

**`s3_check_objects_after_upload`:** Adds **HEAD request** after PUT confirming object available. Increases requests but **prevents silent write failures** critical for data integrity.

### **Backoff and Retry Strategy**

```sql
-- Slow all threads on S3 errors (prevent thundering herd)
SET backup_slow_all_threads_after_retryable_s3_error = 1;
SET s3_slow_all_threads_after_network_error = 1;
```

Understanding whether your workload aligns more with transactional or analytical patterns is essential when tuning MinIO for performance. A clear distinction between [OLTP vs OLAP](https://www.tinybird.co/blog/oltp-vs-olap) helps optimize ClickHouse® and storage settings effectively.

**Prevents "retry storm"** where multiple threads simultaneously retry overwhelming MinIO during transient failures or high load.

### **Parallel Download Optimization**

```sql
-- Threads for parallel file downloads
SET max_download_threads = 8;

-- Buffer size threshold for parallel download
-- File parallelized only if size > 2 * buffer_size
SET max_download_buffer_size = 52428800;  -- 50MB
```

**Download parallelization logic:** File uses **parallel download** only if size **\> 2 × buffer size**. With 50MB buffer, files under 100MB use **single thread**.

**Tuning strategy:**

* **Many small files:** Optimize MinIO layout (compaction, file sizing) rather than download parallelism  
* **Large files (\> 500MB):** Increase `max_download_threads` exploiting network bandwidth

## **Backup and Restore to MinIO**

ClickHouse® supports **native backup/restore** to S3 endpoints including MinIO:

```sql
-- Backup table to MinIO
BACKUP TABLE production.events
TO S3(
    'http://minio:9000/backups/clickhouse/prod_events/',
    'MINIO_ACCESS_KEY',
    'MINIO_SECRET_KEY'
);

-- Restore from MinIO
RESTORE TABLE production.events
FROM S3(
    'http://minio:9000/backups/clickhouse/prod_events/',
    'MINIO_ACCESS_KEY',
    'MINIO_SECRET_KEY'
);
```

**Backup performance considerations:**

* **Backup thread pool** sizing affects throughput  
* **MinIO network bandwidth** becomes bottleneck for large backups  
* **Concurrent operations** (backups \+ merges \+ queries) can overwhelm MinIO cluster

**Recommendation:** Schedule backups during **low-activity windows** and monitor MinIO cluster resource utilization.

## **Security Best Practices**

### **Avoid Hardcoded Credentials**

Use **named collections** instead of credentials in SQL:

```xml
<!-- Server configuration -->
<named_collections>
    <minio_prod>
        <access_key_id>MINIO_ACCESS_KEY</access_key_id>
        <secret_access_key>MINIO_SECRET_KEY</secret_access_key>
    </minio_prod>
</named_collections>
```

```sql
-- Reference named collection
SELECT *
FROM s3(
    'http://minio:9000/datalake/events/*.parquet',
    minio_prod,
    'Parquet'
);
```

**Benefits:**

* **Hide credentials** from SQL logs and query history  
* **Centralize credential management** in server configuration  
* **Control access** via ClickHouse® user permissions

### **Encryption at Rest**

Wrap MinIO disk with **encrypted disk** for ClickHouse®-managed encryption:

```xml
<disks>
    <minio_disk>
        <type>s3</type>
        <endpoint>http://minio:9000/clickhouse-data/</endpoint>
        <access_key_id>MINIO_ACCESS_KEY</access_key_id>
        <secret_access_key>MINIO_SECRET_KEY</secret_access_key>
    </minio_disk>

    <minio_encrypted>
        <type>encrypted</type>
        <disk>minio_disk</disk>
        <algorithm>AES_256_CTR</algorithm>
        <key_hex id="0">ENCRYPTION_KEY_HEX</key_hex>
        <key_hex id="1">NEW_ENCRYPTION_KEY_HEX</key_hex>
        <current_key_id>1</current_key_id>
    </minio_encrypted>
</disks>
```

**Key rotation:** Update `current_key_id` pointing to new key. **Critical:** Losing encryption keys means **losing data access permanently**.

## **Orphan Object Detection and Prevention**

**Orphan objects** exist in MinIO but unreferenced by ClickHouse® metadata—common after **node failures**, **metadata loss**, or **desyncs**.

### **Audit Object Consistency**

```sql
-- What ClickHouse believes exists
SELECT
    disk_name,
    count() AS files,
    sum(size) AS bytes
FROM system.remote_data_paths
WHERE disk_name = 'minio_disk'
GROUP BY disk_name;
```

Compare against **actual MinIO objects** (using MinIO CLI or S3 tools). **Mismatch indicates orphans** or missing metadata.

### **Prevention Strategies**

**Separate prefixes per replica:**

```xml
<minio_disk>
    <endpoint>http://minio:9000/clickhouse/{installation}/{replica}/</endpoint>
    <!-- macros expand to unique paths per replica -->
</minio_disk>
```

If replica fails catastrophically, **clean entire prefix** without risking shared data.

**Regular audits:** Automated jobs comparing `system.remote_data_paths` against MinIO inventory detecting orphans early.

## **MinIO Cluster Sizing for ClickHouse®**

### **Erasure Coding and Parity**

MinIO distributes objects across **erasure sets** with configurable **data:parity ratios**. More parity increases **fault tolerance** but reduces **usable capacity**.

**Recommended configuration:**

* **Minimum 4 drives** per server  
* **XFS, ZFS, or BTRFS** filesystems for consistency  
* **25 Gbps network** minimum; **100 Gbps** for high-performance deployments  
* **Modern kernels** (5.x+) for optimal performance

### **I/O Pattern Considerations**

ClickHouse® generates **mixed I/O** against MinIO:

* **Large sequential reads** (scanning Parquet files)  
* **Small random reads** (index lookups, checksums)  
* **Merge write bursts** (creating new parts)  
* **Delete operations** (cleaning old parts)

**MinIO cluster must handle:**

* **High request rates** (thousands of GET/LIST operations)  
* **Sustained throughput** (multi-GB/s for large scans)  
* **Concurrent operations** (queries \+ merges \+ compactions)

**Undersized network** causes **latency spikes** and **query queue buildup**. Monitor MinIO cluster **CPU, network, disk I/O** ensuring capacity headroom.

## **Production Checklist**

Before deploying ClickHouse® MinIO integration in production:

* **Validate filesystem:** MinIO using **XFS, ZFS, or BTRFS** (NOT EXT4 or NFS) for distributed deployments ensuring consistency  
* **Test metadata recovery:** Node failure/redeployment scenarios confirming metadata **durability matches expectations**  
* **Size cache appropriately:** Filesystem cache **200GB+ minimum**; ideally **20-30% of working set** for acceptable hit rates  
* **Configure TTL-based tiering:** Recent data **local storage** (fast merges), historical data **MinIO** (cost-effective)  
* **Enable cache on writes:** `cache_on_write_operations = 1` improving read performance for recently written data  
* **Set connection limits:** `s3_max_connections` preventing overwhelming MinIO; tune based on cluster size and concurrency  
* **Implement backoff:** `backup_slow_all_threads_after_retryable_s3_error = 1` preventing retry storms during MinIO load spikes  
* **Use named collections:** Credentials in **server config**, not hardcoded in SQL queries  
* **Monitor orphan objects:** Regular audits comparing `system.remote_data_paths` against MinIO inventory  
* **Avoid merge-heavy MinIO:** Configure `prefer_not_to_merge` on cold volumes pushing merges to local storage  
* **Test backup/restore:** Validate procedures including **metadata recovery** and **encryption key management**  
* **Benchmark realistic workloads:** Test with **actual query patterns**, **data volumes**, **concurrency levels** before production  
* **Plan network capacity:** MinIO cluster **network bandwidth** critical bottleneck; ensure **25+ Gbps** for production workloads

## **Why Tinybird is the Best ClickHouse® MinIO Alternative**

After examining ClickHouse® MinIO integration complexity—**cluster deployment**, **filesystem selection**, **metadata management**, **cache tuning**, **tiering policies**, **orphan prevention**, **merge optimization**—one pattern emerges: most teams don't need object storage operational complexity. They need **fast analytics without infrastructure burden**.

This is precisely the focus of Tinybird, which leverages ClickHouse®—the [fastest database for analytics](https://www.tinybird.co/blog/fastest-database-for-analytics)—to deliver real-time data APIs without the maintenance overhead.

The MinIO conversation often distracts from the real goal. Engineers spend weeks deploying **erasure coding sets**, debugging **filesystem consistency**, tuning **cache eviction policies**, coordinating **TTL movements**, and auditing **orphan objects** when what they actually want is **fast queries serving user-facing analytics**.

Tinybird cuts through this complexity entirely.

### **Zero Object Storage Operations**

MinIO integration requires **operational decisions**: cluster sizing (drives, parity), filesystem selection (XFS vs ZFS), metadata strategy (local vs plain\_rewritable), cache configuration (size, eviction), tiering policies (TTL rules, merge preferences).

Tinybird **eliminates object storage operations**. Platform handles **all storage decisions** automatically. No cluster deployment, no filesystem selection, no cache tuning, no tiering coordination.

For teams seeking to simplify analytics architecture while retaining performance, Tinybird also serves as a [Google Analytics alternative](https://www.tinybird.co/blog/google-analytics-alternative-in-3-minutes) built on ClickHouse® for real-time data.

### **Consistent Performance Without Cache Variables**

MinIO-backed queries depend on **cache hit rates** (20-80%+ variability), **network latency** (10-100ms for misses), **file organization** (small file overhead), **merge state** (rewrite-in-progress degradation).

Tinybird delivers **p95 latency under 100ms** automatically. No cache warming, no hit rate optimization, no file compaction coordination. **Predictable performance** regardless of storage tier or access pattern.

### **Complete Platform vs Storage Assembly**

ClickHouse® MinIO requires building and maintaining:

* **MinIO cluster:** Erasure sets, disk configuration, network optimization  
* **ClickHouse® configuration:** Storage policies, cache tuning, TTL coordination  
* **Monitoring:** Cache hit rates, orphan detection, merge efficiency  
* **Maintenance:** Object cleanup, metadata audits, capacity planning

Tinybird provides **complete platform**. Kafka connectors, SQL transformations, authenticated APIs, automatic scaling—**integrated solution without storage assembly**.

## **Frequently Asked Questions (FAQs)**

### **Does ClickHouse® Cloud support MinIO?**

No. ClickHouse® Cloud documentation explicitly states **MinIO not supported**. This integration applies to **self-managed ClickHouse®** where you control server configuration. Use AWS S3, GCS, or Azure Blob for ClickHouse® Cloud.

### **What filesystems does MinIO require for ClickHouse®?**

MinIO supports **XFS, ZFS, BTRFS** for distributed deployments with **strict consistency**. **Explicitly discourages EXT4 and NFS** which may cause **list-after-write inconsistencies**. Filesystem choice **critical for operational stability**—inconsistencies cause objects appearing/disappearing unpredictably.

### **How do I prevent orphan objects in MinIO?**

Use **separate MinIO prefixes per replica** (macros like `{installation}/{replica}`). Enable **regular audits** comparing `system.remote_data_paths` against actual MinIO objects. Test **metadata recovery scenarios** (node failures, redeployments). Choose **metadata strategy** (local vs plain\_rewritable) matching operational capabilities.

### **Should I run merges on MinIO-backed storage?**

**Avoid merge-heavy MinIO workloads**. Configure `prefer_not_to_merge = 1` on cold volumes **pushing merges to local storage**. Use **TTL-based tiering**: recent data local (fast merges), historical data MinIO (cost-effective). Merges on object storage mean **more PUT/DELETE operations**, **higher latency**, **increased costs**.

### **How big should filesystem cache be?**

**Minimum 200GB**; ideally **20-30% of working set** for acceptable hit rates. Monitor cache metrics determining **actual hit rates** with production queries. **Undersized cache** causes **excessive MinIO requests** degrading performance. **OS page cache** on cache filesystem provides **additional acceleration**.

### **What's difference between metadata\_type local vs plain\_rewritable?**

**Local:** Metadata stored **locally** on ClickHouse® nodes. Fast access, mature implementation. **Risk:** Node redeployment without persistent storage loses metadata. **Plain\_rewritable:** Metadata stored **in MinIO**. No local state dependency, simpler node replacement. **Risk:** Newer implementation, different operational semantics. **Test metadata recovery** before production.

### **How do I optimize MinIO performance for ClickHouse®?**

**MinIO side:** Use **XFS/ZFS/BTRFS**, configure **erasure coding** appropriately, ensure **25+ Gbps network**, monitor **CPU/disk/network saturation**. **ClickHouse® side:** Size **filesystem cache** adequately, configure **connection limits** (`s3_max_connections`), enable **backoff** (`backup_slow_all_threads_after_retryable_s3_error`), tune **download parallelism** (`max_download_threads`).

### **Can I use MinIO for ClickHouse® backups?**

Yes. ClickHouse® supports **native BACKUP/RESTORE** to S3 endpoints including MinIO. Schedule backups during **low-activity windows** avoiding conflicts with merges and queries. Monitor **MinIO cluster resources** ensuring backup throughput doesn't overwhelm cluster. Test **restore procedures** including **metadata recovery** validating disaster recovery capabilities.
