FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplatesGuides
Release Notes
Source514
  1. MooseStack
  2. Migrate
  3. Lifecycle Management

On this page

Lifecycle ModesConfiguration SyntaxOlapTable ConfigurationStream ConfigurationIngestPipeline ConfigurationUse CasesSee Also

Lifecycle Management

The LifeCycle enum is a configuration property that controls how Moose Migrate manages individual OlapTable and Stream resources during schema evolution. Each resource can have its own lifecycle mode, enabling hybrid management models within a single application.

Lifecycle Modes

ModeBehaviorDefault
FULLY_MANAGEDMoose automatically modifies resources to match your code, including destructive operations (drops, deletions).Yes (for new resources)
DELETION_PROTECTEDMoose modifies resources to match your code but blocks destructive operations (drops, deletions).No
EXTERNALLY_MANAGEDMoose does not modify resources. You are responsible for managing the schema manually.No

Configuration Syntax

The lifeCycle/life_cycle property is set in the configuration object when creating OlapTable or Stream instances.

OlapTable Configuration

import { OlapTable, OlapConfig, LifeCycle } from "@514labs/moose-lib"; const table = new OlapTable<DataType>("table_name", {  lifeCycle: LifeCycle.FULLY_MANAGED});

Stream Configuration

import { Stream, StreamConfig, LifeCycle } from "@514labs/moose-lib"; const stream = new Stream<DataType>("stream_name", {  destination: table,  lifeCycle: LifeCycle.FULLY_MANAGED});

IngestPipeline Configuration

For IngestPipeline, you can set lifecycle modes independently for the table and stream components.

import { IngestPipeline, IngestPipelineConfig, LifeCycle } from "@514labs/moose-lib"; const pipeline = new IngestPipeline<DataType>("pipeline_name", {  table: {    lifeCycle: LifeCycle.DELETION_PROTECTED  },  stream: {    lifeCycle: LifeCycle.FULLY_MANAGED  }});

Use Cases

ScenarioRecommended ModeRationale
Development/iterationFULLY_MANAGEDAllows rapid schema changes including destructive operations.
Production tablesDELETION_PROTECTEDPrevents accidental data loss while allowing schema evolution.
Legacy/shared tablesEXTERNALLY_MANAGEDTables managed by another team or system.
CDC-managed streamsEXTERNALLY_MANAGEDTopics created by ClickPipes, PeerDB, or other CDC services.
Moose-managed streamsFULLY_MANAGEDTopics created and managed by Moose.

See Also

  • Fully Managed - Default lifecycle mode
  • Deletion Protected - Safe production mode
  • Externally Managed - Read-only mode
  • Overview
Build a New App
  • 5 Minute Quickstart
  • Browse Templates
  • Existing ClickHouse
Add to Existing App
  • Next.js
  • Fastify
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
Moose Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs & Web Apps
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Release Notes
Contribution
  • Documentation
  • Framework