Fast data serving

Customized ClickHouse for direct S3 reads and loaded data, paired with OpenMetadata context for people and agents.

Illustrative reference architecture 3 min read

A public reference design based on the capabilities I built. Components, data contracts, and controls are illustrative; internal sources, schemas, endpoints, policies, and deployment details are omitted.

Reference diagram

Two data paths, one serving layer, and a separate context layer

Serve data

  1. S3 objectsExplicit scope, supported format, and schema contract
    Read objects directly; no metastore lookup required
  2. Customized ClickHouseAuthorize and query direct S3 data or loaded serving tables
    Apply query limits and preserve the data boundary
  3. Bounded resultsRequested data with version or freshness information

Load from other sources

  1. Starburst, Trino, and other sourcesSupported connectors and bounded extractions
    Read through source-specific access and mappings
  2. Custom data loaderMap, validate, and reconcile batches and retries
    Publish an accepted load under a defined contract
  3. ClickHouse serving tablesLoaded data with schema, load identity, and freshness

Discover and request

  1. Customized OpenMetadataContext engine: definitions, discovery, and source references
    Return permitted context to guide data selection
  2. Humans and AI agentsUnderstand the dataset and formulate the request
    Submit a query under the caller identity
  3. Scoped data requestSelected dataset, filters, and required freshness

Connections between paths

  • ClickHouse serving tables→Customized ClickHouse

    Serve published loaded data alongside the separate direct-S3 path.

  • Customized ClickHouse→Customized OpenMetadata

    Publish dataset metadata and freshness; query result rows stay on the data path.

  • Scoped data request→Customized ClickHouse

    Check data permissions independently of context access before execution.

  • Bounded results→Humans and AI agents

    Return the authorized result with its data boundary.

S3 data can be read directly or data can be loaded through supported connectors. OpenMetadata supplies context; it is not a required metastore for the direct S3 read and does not grant data access.

Give each layer a clear job

I built a customized engine based on open-source ClickHouse, with direct S3 access that does not require a separate metastore. I also built a custom loader into ClickHouse from sources such as Starburst and Trino. Customized OpenMetadata provides the context layer for both people and AI agents.

The serving layer reads and returns data. The context layer supplies meaning, source references, and discovery. The diagram keeps those responsibilities separate and shows two data paths: reading objects directly, or loading selected data into serving tables.

Read S3 without a metastore dependency

The direct path uses an explicit object scope and a supported data format. ClickHouse's S3 table function is a public example of reading objects through a table-like interface. This study describes the capability of my customized engine without exposing its implementation.

No metastore does not mean no metadata: the reader still needs a schema contract, object selection, and access credentials. Use explicit schemas or controlled inference, and define which object versions belong to a read. A changing object listing is not a consistent table snapshot. OpenMetadata can describe the dataset without becoming a mandatory metastore in the object-read path.

Load source data through an explicit contract

The second path extracts from supported sources, including Starburst and Trino, and loads ClickHouse serving tables. Connector support is implemented per source; the design does not assume that every database or query engine is interchangeable.

A reference loader records the extraction boundary, schema mapping, and load identity. Validate decimals, timestamps, nulls, rejected rows, and expected coverage before publishing a load. Incremental checkpoints need a defined ordering and late-change policy; a successful query alone does not prove a complete extract.

Make retries and publication deliberate

Prepare a load separately from the data exposed to consumers. Define a promotion mechanism appropriate to the table engine and deployment, then make the accepted dataset version visible. Do not advertise a complete refresh while only some batches have arrived.

If an insert times out after sending data, reconcile whether the batch was accepted before retrying. Stable batch identity, reconciliation, and a documented replacement or deduplication strategy are needed. A MergeTree primary key is not a uniqueness constraint. Advance checkpoints only after confirming the write, and retain enough state to recover an interrupted publication.

Use context to choose data, then authorize the query

The context engine exposes permitted definitions, dataset identities, source references, and freshness information. A person or agent uses that context to select the right dataset and formulate a bounded request. Semantic similarity alone does not establish that two datasets have the same grain or meaning.

The serving interface independently checks the caller, allowed datasets, filters, and resource limits before executing. Metadata access is not data access. Keep storage and loader credentials out of model context, and prevent generated queries from choosing arbitrary object paths or bypassing the authorized serving interface.

Keep context freshness and data freshness separate

Publish dataset identities, schema versions, and load or read boundaries to the context layer. These are metadata, not a copy of query results. A recently indexed description does not establish that the served data is current.

Return the data version or observation boundary with a result where available. Expose stale feeds and incomplete loads; reject a request when its required freshness or schema contract cannot be met. Context updates and data publication can lag independently, so incompatible versions need reconciliation rather than a silent assumption that both layers agree.

Choose the data path for the workload

Direct S3 reads reduce the need to maintain another data copy, but query cost and latency depend on object layout, formats, selected data, and storage access. Loaded ClickHouse tables allow workload-specific organization while adding storage, refresh, and recovery work.

Measure these paths separately using representative queries, concurrent readers, and stated freshness requirements. Track load lag, scanned data, query latency, and failures. This design makes no benchmark claim and does not assume that every direct object read is as fast as querying prepared serving tables.

References

Search the site

Search experience, studies, articles, projects, and contributions.

Try a topic