---
title: "Asynchronous Data Inserts in ClickHouse"
description: "ClickHouse asynchronous inserts move batching from the client to the server."
url: "https://swe.quest/articles/asynchronous-data-inserts-in-clickhouse-7e5b81fdcf244f48"
canonical: "https://clickhouse.com/blog/asynchronous-data-inserts-in-clickhouse"
source: "ClickHouse"
published: "2023-08-01"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 19
tags: ["analytics","storage-engines","performance","observability"]
---

# Asynchronous Data Inserts in ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2023-08-01, 19 min read, Deep dive. Original: [https://clickhouse.com/blog/asynchronous-data-inserts-in-clickhouse](https://clickhouse.com/blog/asynchronous-data-inserts-in-clickhouse)

## Summary

ClickHouse asynchronous inserts move batching from the client to the server. Insert data goes into in-memory buffers, one per query shape and settings on each node, and is flushed as larger parts, which avoids the 'Too many parts' error that frequent small synchronous inserts trigger. In a benchmark with a serverless uptime-monitoring app (UpClick), 200 cloud functions inserting every 10 seconds pushed a 3-node ClickHouse Cloud service to the 300-active-part limit within 5 minutes using synchronous inserts. The post then covers buffer flush semantics, deduplication for idempotent retries, errors that only surface at flush time, how asynchronous inserts compare to Buffer tables, and how to tune return behavior and flush settings.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)

## Prerequisites

- ClickHouse MergeTree basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- columnar database ingestion ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

ClickHouse, MergeTree, asynchronous inserts, Buffer table engine, ClickHouse Keeper, ClickHouse Cloud, Grafana

## Related posts

- [ClickHouse v21.11 Released](https://swe.quest/articles/clickhouse-v21-11-released-1011a7b63db415f6.md): ClickHouse · 2021-11-11 · Medium · 4 min read · Analytics & OLAP, Databases
  ClickHouse 21.11 adds asynchronous inserts, which buffer many small concurrent INSERTs server-side and flush them as a single batch.
- [Monitoring Asynchronous Inserts](https://swe.quest/articles/monitoring-asynchronous-inserts-f9474fee5c98ea90.md): ClickHouse · 2024-01-04 · Medium · 9 min read · Observability, Analytics & OLAP, Databases, SQL
  ClickHouse asynchronous inserts can be monitored with SQL over system tables (query\_log, asynchronous\_insert\_log, part\_log, parts, and the PendingAsyncInsert metric), packaged as parameterized views for part creations, buffer flushes, flush errors and pending flushes.
- [Building a Unified Data Platform with ClickHouse](https://swe.quest/articles/building-a-unified-data-platform-with-clickhouse-cc8bf54cebee136c.md): ClickHouse · 2023-07-28 · Medium · 10 min read · Analytics & OLAP, Databases, Data pipelines, Performance engineering, Go
  Synq, a data observability startup, consolidated its user-facing application, internal BI, in-app analytics and ML training data onto a single ClickHouse Cloud cluster after Postgres with a time-series plugin struggled with large backfills.
- [Essential Monitoring Queries - part 1 - INSERT Queries](https://swe.quest/articles/essential-monitoring-queries-part-1-insert-queries-eda633e3819dfbe1.md): ClickHouse · 2022-12-28 · Medium · 10 min read · Analytics & OLAP, Observability, SQL
  ClickHouse system tables such as part\_log, query\_log, asynchronous\_insert\_log, asynchronous\_metric\_log and parts can be queried with SQL to monitor and troubleshoot INSERT workloads.
- [Kafka, Latency, and You: Minimizing Latency with Kafka & ClickHouse](https://swe.quest/articles/kafka-latency-and-you-minimizing-latency-with-kafka-clickhouse-89c71c2fc7e4578d.md): ClickHouse · 2023-09-13 · Medium · 8 min read · Queues & messaging, Analytics & OLAP, Performance engineering, Data pipelines
  End-to-end latency in a Kafka → Kafka Connect → ClickHouse pipeline can be measured by stamping messages with offset, partition, timestamp and topic via single message transforms, recording insert time with a DEFAULT now() column, and charting median/p75/p95 deltas per minute in SQL.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
