Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:4paradigm OpenMLDB Stream Data Ingestion

From Leeroopedia
Knowledge Sources
Domains Streaming, Data_Ingestion
Last Updated 2026-10-12 12:00 GMT

Overview

A data ingestion pattern where streaming message brokers (Kafka, Pulsar) continuously deliver real-time data into a database for immediate query processing.

Description

Stream data ingestion connects external messaging systems to a database so that incoming data is automatically written to online tables without manual intervention. In OpenMLDB, Kafka and Pulsar connectors subscribe to topics, parse messages according to a schema mapping, and write rows into OpenMLDB online tables. This enables real-time feature computation: as new events arrive, they are immediately available for deployed SQL queries to compute up-to-date features.

The key problem solved is data freshness: batch-loaded data has inherent latency between event occurrence and feature availability. Stream ingestion minimizes this latency to seconds or sub-seconds.

Usage

Use this principle when building real-time ML pipelines where features must reflect the most recent events. Common use cases include real-time fraud detection, recommendation systems, and monitoring dashboards.

Theoretical Basis

Stream ingestion follows the publish-subscribe pattern with schema-aware ingestion:

Latencyfeature=Latencybroker+Latencyingest+Latencyquery

Where:

  • Latency_broker is message delivery time (typically < 10ms)
  • Latency_ingest is connector write time to OpenMLDB
  • Latency_query is deployed SQL execution time (sub-millisecond)

Pseudo-code for stream ingestion:

# Abstract algorithm (NOT real implementation)
def stream_ingest(topic, table_schema):
    consumer = subscribe(topic)
    while True:
        messages = consumer.poll()
        for msg in messages:
            row = parse(msg, table_schema)
            openmldb.insert(table, row)
            # Data now available for deployed queries

Practical Guide

  • Configure the connector with the correct schema mapping from message fields to table columns
  • Ensure the OpenMLDB table schema matches the connector's expected schema
  • Monitor consumer lag to detect ingestion bottlenecks
  • Use partitioned topics for higher throughput

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment