Skip to content

docs(integrations): add integration development best practices guide#6141

Draft
alexfrancoeur wants to merge 9 commits into
mainfrom
integration-dev-best-practices
Draft

docs(integrations): add integration development best practices guide#6141
alexfrancoeur wants to merge 9 commits into
mainfrom
integration-dev-best-practices

Conversation

@alexfrancoeur
Copy link
Copy Markdown
Contributor

@alexfrancoeur alexfrancoeur commented May 1, 2026

AlexF Disclaimer

Using Claude to draft some best practices for integration development in our docs

Summary

Adds a new guide at /integrations/building-integrations for ISVs, connector builders, and tool vendors integrating with ClickHouse (BI connectors, ETL pipelines, data catalog adapters, IDE plugins, etc.).

This is distinct from the existing language client docs — it targets the developer building on top of ClickHouse on behalf of end users, not an application developer writing queries directly.

What's covered

Section Content
Protocol selection Decision matrix: HTTP API vs JDBC vs ODBC vs native TCP vs MySQL/PG wire protocol
Authentication Basic auth patterns, dedicated service accounts, TLS requirements
Schema discovery system.tables, system.columns, system.databases queries; when to use INFORMATION_SCHEMA vs system tables
Data type mapping Unsigned integer widening, Nullable/LowCardinality unwrapping, FixedString zero-byte handling, DateTime64 timezone semantics, complex types
Query patterns Named parameters (HTTP {name:type} syntax + JDBC), query_id for tracing and idempotent retries, output format selection, compression, pagination, timeouts
Write patterns HTTP POST batch inserts, JDBC executeBatch(), batch sizing (10k–100k rows), insert_deduplication_token for retries, no-transaction design
Identification & observability User-Agent header, log_comment, system.query_log query
Error handling HTTP status codes, exception codes, retry strategy, streaming error detection
ClickHouse Cloud specifics HTTPS-only, endpoint format, auto-pause retry behavior, Cloud API
Testing OSS vs Cloud differences, edge-case type coverage, system.query_log verification
Implementation examples Python (HTTP API streaming connector skeleton) + Java (JDBC connection pool + query tagging skeleton)
Checklist 16-item production readiness checklist

Test plan

  • Page renders correctly in local docs dev server (yarn start)
  • All internal links resolve (/integrations/java, /interfaces/http, etc.)
  • New page appears in the sidebar under Integrations
  • Code examples syntax-highlighted correctly (python, java, bash, sql)

🤖 Generated with Claude Code

Adds a new guide at /integrations/building-integrations for ISVs,
connector builders, and tool vendors integrating with ClickHouse.

Covers: protocol selection (HTTP/JDBC/ODBC/native), authentication,
schema discovery via system.* tables, data type mapping (unsigned
integers, Nullable, LowCardinality, DateTime timezone handling,
complex types), query parameterization, output formats, batch writes,
idempotent inserts, client/query identification for system.query_log,
error handling and streaming error detection, ClickHouse Cloud
specifics, testing guidance, and implementation examples for both
HTTP API (Python) and JDBC (Java).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clickhouse-docs Ready Ready Preview, Comment May 7, 2026 4:04pm
clickhouse-docs-jp Building Building Preview, Comment May 7, 2026 4:04pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
clickhouse-docs-ko Ignored Ignored Preview May 7, 2026 4:04pm
clickhouse-docs-ru Ignored Ignored Preview May 7, 2026 4:04pm
clickhouse-docs-zh Ignored Ignored Preview May 7, 2026 4:04pm

Request Review

@alexfrancoeur alexfrancoeur requested review from a team as code owners May 1, 2026 02:08
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 1, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Blargian
❌ Alex Francoeur


Alex Francoeur seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Alex Francoeur and others added 3 commits May 1, 2026 11:14
…pecifiers to bare code blocks

Resolves markdownlint failures (custom-anchor-headings, MD040) from the
docs CI check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers: when to choose MCP over JDBC/HTTP API, using ClickHouse Cloud's
built-in remote MCP server, building custom remote MCP servers (transport
selection, OAuth vs bearer token auth, read-only enforcement, resource
limits, tool description design, prompt injection mitigation,
observability via query_id/log_comment). Adds MCP items to checklist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Alex Francoeur and others added 2 commits May 1, 2026 11:59
- HTTP 200 does not guarantee success — explain mid-stream error injection
  and the X-ClickHouse-Exception-Code header check requirement
- Remove session_timezone recommendation (experimental, can break partition pruning)
- Explain Too many parts failure mode and 1-2 inserts/sec limit
- Add async insert gotchas: error-on-flush with wait_for_async_insert=0,
  SETTINGS must precede VALUES
- Add JDBC PreparedStatement batch reuse regression (driver 0.8.6+)
- Add materialized view row count inflation warning for ETL validation
- Add mutations-are-async section with deduplication checksum caveat
- Add JSON insert DEFAULT expression gotcha and input_format_defaults_for_omitted_fields
- Add case sensitivity section (identifiers, function names)
- Add Int64/UInt64 JSON precision loss for JavaScript consumers
- Note INFORMATION_SCHEMA.TABLE_ROWS is always NULL, FK tables are empty
- Note system.query_log has ~7.5s flush delay — do not query immediately

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split integration development docs into dedicated pages:
- ingestion.md: batch fundamentals, formats, async insert, deduplication,
  schema evolution, CDC/upsert patterns, MV row count gotcha
- consumption.md: schema discovery, type mapping, streaming queries,
  pagination, connection pooling, HTTP 200 error detection
- jdbc.md: end-to-end JDBC connector walkthrough — Maven setup, HikariCP,
  schema introspection, full type table, batch inserts, V1→V2 migration
- python.md: clickhouse-connect connector guide — streaming, InsertContext,
  type mapping, Windows tzdata note
- go.md: clickhouse-go connector guide — native and database/sql APIs,
  type mapping, batch inserts, context cancellation gotcha
- javascript.md: @clickhouse/client guide — Int64 precision problem,
  streaming, web client limitations, CORS guidance

Updated index.md routing table and expanded sidebars.js to a category
with ingestion/consumption and a nested language guides section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract Remote MCP section from index.md into dedicated mcp.md page
- mcp.md adds consumption-focused best practices: schema discovery tool
  design, result sizing for LLM context, per-tool observability query,
  focused MCP checklist
- Move "Identifying your integration" to position 3 in index.md (right
  after authentication) — it is foundational setup, not an afterthought
- Add MCP to routing table in index.md overview
- Wire mcp.md into sidebar between consumption and language guides

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants