We value your privacy

This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content. See our Privacy Policy.

  1. MooseStack
  2. Migrate
  3. Lifecycle Management

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

On this page

Lifecycle ModesConfiguration SyntaxOlapTable ConfigurationStream ConfigurationIngestPipeline ConfigurationUse CasesSee Also
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackHostingTemplatesGuides
Release Notes
Source531
  • Overview
Build a New App
  • 5 Minute Quickstart
  • Browse Templates
  • Existing ClickHouse
Add to Existing App
  • Next.js
  • Fastify
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Language Server
  • Data Modeling
Moose Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs & Web Apps
Deployment & Lifecycle
  • Moose Dev
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Release Notes
Contribution
  • Documentation
  • Framework
import { OlapTable, OlapConfig, LifeCycle } from "@514labs/moose-lib"; const table = new OlapTable<DataType>("table_name", {  lifeCycle: LifeCycle.FULLY_MANAGED});
import { Stream, StreamConfig, LifeCycle } from "@514labs/moose-lib"; const stream = new Stream<DataType>("stream_name", {  destination: table,  lifeCycle: LifeCycle.FULLY_MANAGED});
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  }});