1. MooseStack
  2. Table Engines

On this page

MergeTree (default, can omit engine property)ReplacingMergeTree (deduplicate by key, optional version + soft delete)SummingMergeTree (sum numeric columns for the same key)OptionsMergeTree FamilyReplicatedSpecial PurposeSee Also

Table Engines

ClickHouse table engines determine how data is stored, indexed, queried, and replicated.

MooseOLAP selects the engine in the OlapTable config:

You set the engine in the OlapTable config with the engine property:

import { OlapTable, ClickHouseEngines } from "@514labs/moose-lib"; interface EngineExampleRow {  id: string;  timestamp: Date;  updated_at: Date;  deleted: number;  date: Date;  page: string;  views: number;  click_sum: number;}; // MergeTree (default, can omit engine property)const MergeTree = new OlapTable<EngineExampleRow>("merge_tree_table", {  orderByFields: ["timestamp", "id"],}); // ReplacingMergeTree (deduplicate by key, optional version + soft delete)const ReplacingMergeTree = new OlapTable<EngineExampleRow>("replacing_merge_tree_table", {  engine: ClickHouseEngines.ReplacingMergeTree,  orderByFields: ["id"],  ver: "updated_at",  isDeleted: "deleted",}); // SummingMergeTree (sum numeric columns for the same key)const SummingMergeTree = new OlapTable<EngineExampleRow>("summing_merge_tree_table", {  engine: ClickHouseEngines.SummingMergeTree,  orderByFields: ["date", "page"],  columns: ["views", "click_sum"],});

Options

ClickHouseEngines includes the following categories:

MergeTree Family

  • MergeTree
  • ReplacingMergeTree
  • SummingMergeTree
  • AggregatingMergeTree
  • CollapsingMergeTree
  • VersionedCollapsingMergeTree

Replicated

  • See Replicated Engines

Special Purpose

  • S3Queue
  • S3
  • IcebergS3
  • Buffer
  • Distributed
  • Kafka

See Also

  • Tables — Full table configuration reference
  • Aggregate Types — Using SimpleAggregateFunction with AggregatingMergeTree
  • 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
    • MergeTree
    • ReplacingMergeTree
    • AggregatingMergeTree
    • SummingMergeTree
    • Replicated Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506