Skip to main content

Real architecture · Senior

QuintoAndar: customer data, from Lambda architecture to a single path in ClickHouse

A real case of simplification: hot path (Postgres "Datazord") plus cold path (expensive Kafka Connect and Delta with MERGE) become an event gateway writing straight to ClickHouse.

17 min read · Source: QuintoAndar · Content reviewed on October 23, 2026

Short answer

A real case of simplification: hot path (Postgres "Datazord") plus cold path (expensive Kafka Connect and Delta with MERGE) become an event gateway writing straight to ClickHouse. QuintoAndar's customer data platform (CDP) team collects, integrates, and unifies data about tenants, landlords, and real estate agents.

01 · CONTEXT

QuintoAndar's customer data platform

QuintoAndar's customer data platform (CDP) team collects, integrates, and unifies data about tenants, landlords, and real estate agents. According to the team's tech lead, the platform collects more than 1 billion events per month from more than 14 million users, with almost 900 million raw events per month going to ClickHouse.

This data flows back to chatbots and internal services in about 300 million API requests per month. It originates in user tracking on mobile devices and in change data capture (CDC) from transactional databases, streamed through Kafka, and reaches an in-house event gateway, where the team applies governance, runs transformations, and enriches the events along the way.

02 · PREVIOUS ARCHITECTURE

Classic Lambda: a hot path and a cold path

The previous architecture was split along the classic lines of the Lambda architecture. The hot path was Datazord, another in-house service built on Postgres, which consumed the gateway's output topics and served user information to chatbots and other internal consumers from its own Postgres database, chosen for low-latency reads.

The cold path used Kafka Connect to dump everything into a landing zone in the data lake, where always-on Databricks workflows processed it into a silver layer. From that layer, the analytical ETLs and Hightouch, the company's user activation tool, could pull data.

  1. Mobile tracking and CDC events arrive at the event gateway, which applies governance, transformations, and enrichment.

    Architecture diagram: QuintoAndar CDP: previous Lambda architecture
    CLMobile and CDC events
    CPEvent gatewaygoverns and enriches
    QOutput topics
    CPDatazord
    DBDatazord Postgres
    CLChatbots and internal services
    CPKafka Connect
    DBData lake landing zone
    CPWorkflows Databricks
    DBSilver layer
    CLAnalytical ETLs and Hightouch
  2. On the hot path, Datazord consumes the output topics and serves chatbots and internal consumers from its own Postgres.

    Architecture diagram: QuintoAndar CDP: previous Lambda architecture
    CLMobile and CDC events
    CPEvent gateway
    QOutput topics
    CPDatazordhot path
    DBDatazord Postgreslow-latency reads
    CLChatbots and internal services
    CPKafka Connect
    DBData lake landing zone
    CPWorkflows Databricks
    DBSilver layer
    CLAnalytical ETLs and Hightouch
  3. On the cold path, Kafka Connect dumps the data into the landing zone and the Databricks workflows build the silver layer.

    Architecture diagram: QuintoAndar CDP: previous Lambda architecture
    CLMobile and CDC events
    CPEvent gateway
    QOutput topics
    CPDatazord
    DBDatazord Postgres
    CLChatbots and internal services
    CPKafka Connect
    DBData lake landing zonelanding zone
    CPWorkflows Databrickscontinuous processing
    DBSilver layer
    CLAnalytical ETLs and Hightouch
  4. The analytical ETLs and Hightouch read from the cold path's silver layer.

    Architecture diagram: QuintoAndar CDP: previous Lambda architecture
    CLMobile and CDC events
    CPEvent gateway
    QOutput topics
    CPDatazord
    DBDatazord Postgres
    CLChatbots and internal services
    CPKafka Connect
    DBData lake landing zone
    CPWorkflows Databricks
    DBSilver layer
    CLAnalytical ETLs and Hightouchanalytical consumption
  5. The pain points at the time: constant MERGE INTO operations on Delta tables on the cold path and a Postgres that seemed like the wrong tool for the event volume on the hot path.

    Architecture diagram: QuintoAndar CDP: previous Lambda architecture
    CLMobile and CDC events
    CPEvent gateway
    QOutput topics
    CPDatazord
    DBDatazord Postgresseemed unsuitable
    CLChatbots and internal services
    CPKafka Connect
    DBData lake landing zone
    CPWorkflows Databricksconstant MERGE INTO
    DBSilver layer
    CLAnalytical ETLs and Hightouch

03 · THE PROBLEM

The cost of maintaining two paths

According to the tech lead, there were three problems. First, the team maintained two separate codebases, a well-known tax for anyone who has operated a Lambda architecture. Second, on the cold path, huge volumes of duplicate events required constant MERGE INTO operations on Delta tables. Third, the Postgres instance in the hot layer was starting to look like the wrong tool for the volume of events passing through it.

In his words, deduplicating all those millions of events every time became expensive, not just in cost but in time.

04 · THE DECISION

A gateway writing directly to ClickHouse

The team's answer was to stop treating the Kafka topics as the pipeline's output and have the event gateway write directly to ClickHouse. In the new architecture, Datazord would serve its API requests from ClickHouse, instead of its own Postgres, still responding in under a second. This would eliminate the landing zone, the constant MERGE INTO operations, and the need for a second codebase.

  1. The event gateway writes directly to ClickHouse, and the output topics are no longer the pipeline's destination.

    Architecture diagram: QuintoAndar CDP: single path on ClickHouse
    CLMobile and CDC events
    CPEvent gateway
    DBClickHouse Cloudsingle destination
    CPDatazord
    CLChatbots and internal services
    CPTrino and Spark
    DBDelta tables in the data lake
  2. Datazord now serves the API from ClickHouse, no longer from its own Postgres.

    Architecture diagram: QuintoAndar CDP: single path on ClickHouse
    CLMobile and CDC events
    CPEvent gateway
    DBClickHouse Cloud
    CPDatazordreads from ClickHouse
    CLChatbots and internal services
    CPTrino and Spark
    DBDelta tables in the data lake
  3. With this design, the landing zone, the constant MERGE INTO operations, and the second codebase go away.

    Architecture diagram: QuintoAndar CDP: single path on ClickHouse
    CLMobile and CDC events
    CPEvent gateway
    DBClickHouse Cloudsingle path
    CPDatazord
    CLChatbots and internal services
    CPTrino and Spark
    DBDelta tables in the data lake
  4. Trino and Spark reach the CDP tables through connectors, and ClickHouse reads Delta tables from the data lake.

    Architecture diagram: QuintoAndar CDP: single path on ClickHouse
    CLMobile and CDC events
    CPEvent gateway
    DBClickHouse Cloud
    CPDatazord
    CLChatbots and internal services
    CPTrino and Sparkconectores
    DBDelta tables in the data lakeDelta read
AspectoAntesDepois
Gateway outputOutput Kafka topicsDirect write to ClickHouse
API readDatazord serves from its own PostgresDatazord serves from ClickHouse
Landing zone and MERGE INTOPresent on the cold pathRemovidos
CodebaseTwo separate codebasesNo need for a second one

The team feared isolating itself from the rest of the data organization, which uses Superset on top of Trino. In practice, ClickHouse's connectors let Trino and Spark reach the CDP tables, and ClickHouse also reads Delta tables from the company's data lake.

05 · THE OBSTACLE

Where is ClickHouse?

The marketing team wanted to use Hightouch's Customer Studio to build audiences, segment users, run A/B tests, and build multi-step journeys. But the list of sources the feature supports, with Snowflake, Databricks, BigQuery, Redshift, Athena, Synapse, MS SQL Server, PostgreSQL, Greenplum, and Microsoft Fabric, did not include ClickHouse.

Databricks was the only compatible engine already in the stack, but the central data team had decided to move off Databricks SQL Warehouse because of its high cost, preferring open-source alternatives such as Trino. Trino was not supported either, which left one option: Postgres.

06 · THE BRIDGE

Managed Postgres as a universal interface

The mechanism is the pg_clickhouse extension. According to the lead, the setup is simple: create the extension, create a foreign server pointing to ClickHouse, create a schema, and import the foreign tables. After that, ClickHouse tables can be queried like ordinary Postgres tables, with joins and aggregations pushed down to ClickHouse instead of being pulled back into Postgres.

  1. Hightouch did not have ClickHouse among the Customer Studio sources.

    Architecture diagram: QuintoAndar CDP: Hightouch via managed Postgres
    CPEvent gateway
    DBClickHouse Cloud
    DBPostgres managed by ClickHouse
    CLHightouchno compatible source
  2. Since Trino was not supported either, the remaining option was to connect Hightouch to a Postgres.

    Architecture diagram: QuintoAndar CDP: Hightouch via managed Postgres
    CPEvent gateway
    DBClickHouse Cloud
    DBPostgres managed by ClickHouseManaged Postgres
    CLHightouch
  3. The managed Postgres pushes analytical queries down to ClickHouse, where the gateway already writes the events.

    Architecture diagram: QuintoAndar CDP: Hightouch via managed Postgres
    CPEvent gateway
    DBClickHouse Cloudruns the queries
    DBPostgres managed by ClickHouseforwards queries
    CLHightouch
  4. Lightning Sync state, with a planning table and an audit table, lives in Postgres itself, on NVMe storage.

    Architecture diagram: QuintoAndar CDP: Hightouch via managed Postgres
    CPEvent gateway
    DBClickHouse Cloud
    DBPostgres managed by ClickHousestores Hightouch state
    CLHightouch
  5. For the Hightouch case, the lead says the round trip between Postgres and ClickHouse is negligible.

    Architecture diagram: QuintoAndar CDP: Hightouch via managed Postgres
    CPEvent gateway
    DBClickHouse Cloud
    DBPostgres managed by ClickHouse
    CLHightouch

For the lead, the connection does two jobs: Postgres persists data like an OLTP database, while analytical queries run on ClickHouse. This does not open everything up: you still need to create users and roles and grant the desired access.

With this, ClickHouse becomes a plug-and-play database to which any third-party tool that supports Postgres can connect.

07 · LESSONS

What to take into your interview

Frequently asked questions

What is QuintoAndar: customer data, from Lambda architecture to a single path in ClickHouse?

A real case of simplification: hot path (Postgres "Datazord") plus cold path (expensive Kafka Connect and Delta with MERGE) become an event gateway writing straight to ClickHouse.

What does the QuintoAndar: customer data, from Lambda architecture to a single path in ClickHouse design cover?

It is organized in these sections: QuintoAndar's customer data platform, Classic Lambda: a hot path and a cold path, The cost of maintaining two paths, A gateway writing directly to ClickHouse, Where is ClickHouse?, and Managed Postgres as a universal interface.

How long is QuintoAndar: customer data, from Lambda architecture to a single path in ClickHouse and what level is it?

It takes about 17 minutes to read and is rated Senior level.

Now design it yourself

Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.