Apache Amoro Documentation

repository·master·Indexed 22 days ago

https://github.com/apache/amoro

A Lakehouse management system providing a data warehouse experience on open data lake formats including Iceberg, Paimon, and Hudi. It features the Amoro Management Service (AMS) for self-optimization and unified catalog services, supporting pluggable engines such as Flink, Spark, and Trino to enable infra-decoupled, stream-and-batch-fused architectures.

Tokens
76.3K
Snippets
172
Records
250
Agent score
78%

What's inside Apache Amoro

  1. Key features of Mixed-Iceberg format

    master

    Mixed-Iceberg provides several advantages over the standard Iceberg format:

    • Stronger primary key constraints: These constraints apply even when using Spark.
    • Production-ready OLAP performance: Achieved through the auto-bucket mechanism for real-time data warehouses.
    • Low-latency LogStore: Configuration that can reduce data pipeline latency from minutes to milliseconds/seconds.
    • Transaction conflict resolution: Enables concurrent writes using the same primary key.

    Limitations

    • Compatibility: In scenarios where Hive and Iceberg are compatible, primary key uniqueness or conflict resolution might be violated.
    • Primary key constraint: If the primary key does not include partition keys and there are no updates to the stream data, you may need to use normalized operators to ensure primary key uniqueness.
    • Engine support: Currently supports reading/writing with Flink and Spark, and querying with Trino.
  2. Understand the amoro-web directory structure

    master

    The amoro-web project follows this structure:

    • mock/: Mock data files.
    • public/: Static assets like index.html and favicon.ico.
    • src/: Main source code.
      • src/components/: Shared components used across multiple views.
      • src/views/: Page-level views.
      • src/services/: Services used for communication with the AMS server.
      • src/hooks/: Custom Vue hooks.
      • src/store/: State management.
      • src/utils/: Utility functions.
      • src/main.tsx: The project entry point.
      • src/App.vue: The root Vue component.
    • vite.config.ts: Vue 3 configuration file.
    • package.json: Project build scripts and dependency definitions.
    • pnpm-lock.yaml: Dependency lock file.
  3. Choose a supported table format in Amoro

    master

    Amoro supports four primary table formats depending on your use case:

    • Iceberg format: Use this to entrust existing Iceberg tables to Amoro for maintenance. You retain all native Iceberg functions while gaining Amoro's performance and stability enhancements.
    • Mixed-Iceberg format: Optimized for streaming update scenarios. Choose this if you have high-performance requirements for streaming updates or need CDC (Change Data Capture) incremental data reading functions.
    • Mixed-Hive format: Designed for users with existing Hive-based businesses. It allows upgrading Hive tables to the Mixed-Hive format via metadata migration only, ensuring that original Hive tables remain usable and business stability is maintained.
    • Paimon format: Amoro supports displaying Paimon metadata, including Schema, Options, Files, Snapshots, DDLs, and Compaction information.
  4. What is an Optimizer Group and how to manage them

    master

    An Optimizer Group (or optimizer resource group) is a concept used to divide and manage Optimizer resources. A group can contain multiple optimizers sharing the same container implementation, allowing for efficient expansion and contraction of resources based on demand.

    Lifecycle Management

    • Add: Create a new group via the Amoro dashboard by clicking "Add Group" on the Optimizer Groups page.
    • Edit: Modify existing configurations by clicking the edit button on the Optimizer Groups page.
    • Remove: Delete a group by clicking the remove button. Note: A group can only be removed if it is not referenced by any catalog or table and no optimizers belonging to that group are currently running.
  5. What is LogStore in Amoro

    master

    Amoro tables utilize two distinct storage types to bridge the gap between offline data warehouses and real-time needs:

    1. FileStore: Stores massive amounts of full historical data.
    2. LogStore: Stores real-time incremental data, providing sub-second to minute-level data visibility.

    LogStore connects to external message queuing middleware (currently supporting Kafka and Pulsar) to allow users to query a single table while ensuring eventual consistency between real-time and historical data sources. This eliminates the need for developers to manage both HDFS and Kafka separately.

  6. Understand Amoro multi-level configuration management

    master

    Amoro allows you to manage configurations at three distinct levels. When a conflict occurs, the priority is applied in the following order (highest to lowest):

    1. Engine: Used for engine-specific tuning (e.g., Spark or Flink).
    2. Table: Specified during Create Table or modified via Alter Table operations.
    3. Catalog: Used to set default values for all tables within a catalog (e.g., setting default Self-optimizing properties).

    To set global defaults, configure Catalog properties. To apply specific settings to a single table, use table-level configurations.

  7. Understand Amoro metrics types

    master

    Amoro's metrics system uses two primary types to measure table management behaviors and resource usage:

    • Gauge: Provides a snapshot value of a specific metric at a given point in time (e.g., current memory usage or current status).
    • Counter: A cumulative metric that increments or decrements to track totals over time (e.g., total number of failed processes since the AMS service started).

    These metrics can be reported to external systems like Prometheus by configuring a metric reporter.

  8. Use the Amoro Flink Connector for Mixed Format

    master

    The Amoro Flink connector allows the Apache Flink engine to process Amoro table data in both batch and streaming modes. It utilizes a LogStore underlying storage structure to store the latest changelog or append-only real-time data, ensuring data consistency.

    Key capabilities of the Flink Connector include:

    • Flink SQL Select: Read Amoro table data via Flink SQL.
    • Flink SQL Insert: Write data to Amoro tables via Flink SQL.
    • Flink SQL DDL: Create, modify, or delete libraries and tables using DDL statements.
    • FlinkSource: Read Amoro table data using the Flink DataStream (DS) API.
    • FlinkSink: Write data to Amoro tables using the Flink DataStream (DS) API.
    • Flink Lookup Join: Perform real-time reads of Amoro table data for association calculations using Flink Temporal Join grammar.
    # To obtain the runtime jar by self-compiling the project:
    ./mvnw clean package -pl ':amoro-mixed-flink-runtime-1.18' -am -DskipTests
  9. Understand Table Watermark in Mixed Format

    master

    In Amoro's Mixed Format, Table Watermark is used to measure data freshness and describe the writing progress of a table. It is a timestamp attribute indicating that all data with timestamps earlier than this watermark has been successfully written to the table.

    Key Concepts

    • Purpose: Monitors writing progress and can act as a trigger for downstream batch computing tasks.
    • Mechanism: The watermark is calculated based on an event time field in the data. To account for out-of-order writes, a delay threshold is configured.
    • Out-of-order Data: Unlike stream processing where late data might be rejected, in Amoro, data with event times smaller than the current watermark is still accepted but will not advance the watermark.
    • The Tripartite Paradox: Amoro uses watermarks and its self-optimizing mechanism to balance the trade-off between data freshness, query performance, and cost in streaming data warehouses.
  10. Understand Amoro's table format design philosophy

    master

    Amoro is designed as an out-of-the-box data lake system that uses different table formats as storage engines. This allows users to leverage the specific features of various formats while benefiting from Amoro's management, performance, and stability improvements.

    Table formats in Amoro define the relationship between tables, snapshots, and files, providing MVCC (Multi-Version Concurrency Control), ACID compliance, and transaction capabilities to data lakes. They also enable advanced features like schema evolution, hidden partitioning, and data skipping.

  11. Understand the Amoro Architecture

    master

    Amoro is a Lakehouse management system composed of several key components designed to provide a data warehouse experience on top of open data lake formats:

    • AMS (Amoro Management Service): The core service providing Lakehouse management features such as self-optimization (e.g., data expiration) and a unified catalog service for compute engines. It can integrate with existing metadata services like Hive Metastore or AWS Glue.
    • Plugins: An extensible system for various scenarios:
      • Optimizers: An asynchronous execution engine plugin that performs merging, sorting, deduplication, and layout optimization across different table formats.
      • Terminal: SQL command-line tools, including implementations for local Spark and Kyuubi.
      • LogStore: Provides low-latency SLAs (millisecond to second level) for real-time data processing using message queues like Kafka or Pulsar.
  12. Core components of Amoro architecture

    master

    Amoro's architecture is built around three primary pillars that provide Lakehouse management and extensibility:

    • AMS (Amoro Management Service): The central service providing Lakehouse management features such as self-optimizing and data expiration. It also offers a unified catalog service for all compute engines, which can be integrated with existing metadata services.
    • Plugins: A selection of external plugins for specific scenarios:
      • Optimizers: An asynchronous execution engine plugin that performs operations like merging, sorting, deduplication, and layout optimization across all table format types.
      • Terminal: SQL command-line tools with implementations like local Spark and Kyuubi.
      • LogStore: Enables millisecond to second-level SLAs for real-time data processing using message queues like Kafka and Pulsar.