Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 15 min read Case study mediumAdept

A MySQL Journey

ClickHouse extended its MySQL wire-protocol and syntax compatibility so online-only BI tools like Looker Studio and Tableau Online, which allow no custom drivers, can query ClickHouse directly. Iterative testing against these tools surfaced gaps fixed through discovery statements (SHOW COLUMNS, SHOW KEYS), the NULL-safe <=> operator, and aliases such as MAKEDATE, STR_TO_DATE, REGEXP, INSTR, TO_DAYS and DATE_FORMAT, plus new format substitutions. Some aliases behave differently from MySQL (e.g. re2 vs ICU regex), and full MySQL compatibility is explicitly not a goal.

Related posts

  • Visualizing Data with ClickHouse - Part 3 - Metabase

    ClickHouse mediumAdept

    Metabase connects to ClickHouse via a plugin driver over the HTTP port and suits less SQL-savvy business users through its drag-and-drop "question" builder, while a SQL editor handles complex charts by pushing all transformation into the query. Worked examples on NOAA weather, forex and UK house price datasets produce region, grid and pin maps, waterfall, combo and funnel charts using ClickHouse functions such as geohashEncode, dictGet, window functions, arrayJoin and -If combinators. Compared with Grafana (time series, SQL-heavy) and Superset (analyst-focused SQL editor and reusable datasets), Metabase trades visual breadth and customization for a simpler workflow.

  • How LINE MANGA used ClickHouse to enable real-time analysis without moving a single row

    ClickHouse easyNovice

    LINE MANGA uses ClickHouse as a federated query layer over its horizontally and vertically sharded MySQL fleet, querying data in place rather than ingesting it. Virtual tables built with the MySQL Table and Database Engines push filter conditions down to each MySQL shard and aggregate the results in ClickHouse. That lets engineers join product metadata with user purchases across servers and total platform-wide sales in a single SQL query, with no ETL lag and no copying of sensitive or audit-restricted data. Engineers test queries locally with clickhouse-local, Docker Compose and IntelliJ, while production queries go through an audit-compliant gateway. MySQL remains the system of record.

  • Loading Parquet data into MySQL with ClickHouse

    ClickHouse mediumAdept

    MySQL has no native Parquet import, but clickhouse-local can read a Parquet file over HTTP with the `url` table function and write it straight into a MySQL table via `INSERT INTO FUNCTION mysql(...)`. In the walkthrough, 2.3M StackOverflow vote rows load in about 16.6 seconds using roughly 227 MiB of memory. The same `mysql` table function can query MySQL back. An inline subquery is written in ClickHouse SQL and rewritten into MySQL syntax, while the `query()` form is sent to MySQL verbatim, so ClickHouse-only functions like `tuple` fail there. Credentials can be kept in config-defined named collections instead of being passed on every call.

  • Corsearch replaces MySQL with ClickHouse for content and brand protection

    ClickHouse easyNovice

    Corsearch replaced a pre-aggregated, heavily partitioned MySQL setup with ClickHouse to serve interactive anti-piracy search-engine analytics across 10+ filterable dimensions with daily, weekly and monthly rollups. It began as a drop-in prototype with a nearly identical table structure and was in production for all clients by 2019. Compression gains, helped further by LowCardinality columns, cut server count. Corsearch also runs SQL-based vector distance searches over language-model embeddings in ClickHouse instead of a dedicated vector database, and built a two-table SQL-based observability setup with Grafana that stores over 10 billion rows across four years in under 325 GB.

  • HIFI’s migration from BigQuery to ClickHouse

    ClickHouse mediumAdept

    HIFI moved music royalty analytics from BigQuery to ClickHouse because BigQuery's per-query pricing discouraged exploratory use and slot reservations didn't fit a startup's shifting workloads. Dashboard loads for accounts with 25M+ rows dropped from up to 30 seconds (with timeouts) to a few seconds. The migration surfaced ClickHouse-specific join behaviour: bulk updates work better via a Join engine table and joinGet, and LEFT joins from PostgreSQL to large ClickHouse tables can exhaust memory because the hash join loads the right side into memory, which pre-aggregating the right side with GROUP BY fixes (under 1 second). A community Node.js client also silently converted NULLs to empty strings on insert, which they patched.

The quest for software engineering knowledge.

Look:
Layout: