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 Server Role Configuration

From Leeroopedia
Knowledge Sources
Domains Distributed_Systems, Deployment
Last Updated 2026-10-12 12:00 GMT

Overview

A role-based server configuration pattern where a single binary assumes different responsibilities (data serving, metadata management, client interface) based on a configuration flag.

Description

OpenMLDB uses a single-binary, multi-role architecture: the same openmldb binary can run as a tablet server, nameserver, or client depending on the --role flag. This pattern simplifies deployment and version management — only one binary needs to be built and distributed. The tablet role handles data storage and serving; the nameserver role manages metadata, partition assignment, and failover; the ns_client, client, and sql_client roles provide CLI interfaces for administration and SQL execution.

This pattern is analogous to how Google File System separates chunkservers from the master, but uses a single binary with role separation via configuration rather than separate binaries.

Usage

Use this principle when designing a distributed system where components share significant code but have distinct runtime responsibilities. It is particularly effective when deployment simplicity is important and when roles may need to run on the same host during development.

Theoretical Basis

The role configuration pattern separates identity from capability:

Server=(Binary,Role,Configuration)

Where:

  • Binary is the shared codebase
  • Role determines which services and handlers are activated
  • Configuration provides role-specific parameters (ports, paths, cluster addresses)

Role-based flag activation:

# Abstract algorithm (NOT real implementation)
role = flags.role  # tablet | nameserver | client | ...
if role == "tablet":
    activate_data_storage()
    register_with_zookeeper(zk_cluster, zk_root_path, endpoint)
    serve_rpc(endpoint)
elif role == "nameserver":
    connect_to_zookeeper(zk_cluster, zk_root_path)
    discover_tablets()
    manage_metadata()
    serve_rpc(endpoint)

Practical Guide

  • Tablet servers need filesystem paths (db_root_path, recycle_bin_root_path) for data
  • Nameservers need tablet connection info — either via ZooKeeper (cluster) or --tablet flag (standalone)
  • The --interactive=false flag enables scriptable non-interactive mode for clients
  • Heartbeat timeout and check interval should be short for development, longer for production

Related Pages

Implemented By

Page Connections

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