1. MooseStack
  2. Engines
  3. Distributed

On this page

See Also

Distributed

The Distributed engine creates a distributed table across a ClickHouse cluster for horizontal scaling:

import { OlapTable, ClickHouseEngines } from '@514labs/moose-lib'; // Distributed table across clusterexport const distributedTable = new OlapTable<Record>("distributed_data", {  engine: ClickHouseEngines.Distributed,  cluster: "my_cluster",  targetDatabase: "default",  targetTable: "local_table",  shardingKey: "cityHash64(id)"  // Optional: how to distribute data});
Distributed Table Requirements
  • Requires a configured ClickHouse cluster with remote_servers configuration
  • The local table must exist on all cluster nodes
  • Distributed tables are virtual - data is stored in local tables
  • Cannot use orderByFields, partitionBy, or sampleByExpression on distributed tables
  • The cluster name must match a cluster defined in your ClickHouse configuration

See Also

  • ClickHouse Distributed — ClickHouse official documentation
import { OlapTable, ClickHouseEngines } from '@514labs/moose-lib'; // Distributed table across clusterexport const distributedTable = new OlapTable<Record>("distributed_data", {  engine: ClickHouseEngines.Distributed,  cluster: "my_cluster",  targetDatabase: "default",  targetTable: "local_table",  shardingKey: "cityHash64(id)"  // Optional: how to distribute data});
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506
  • Overview
  • Quick Start
  • Templates / Examples
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
MooseStack in your App
  • App / API frameworks
Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework