All Products
Search
Document Center

ApsaraMQ for Kafka:Comparison between storage engines

Last Updated:Jul 19, 2023

ApsaraMQ for Kafka supports two types of storage engines: cloud storage and local storage. This topic compares the storage engines to help you choose a storage engine based on your business requirements.

Usage notes

  • Cloud storage fully makes use of the underlying storage of Alibaba Cloud. Compared with local storage, cloud storage provides higher auto-scaling performance, reliability, availability, and cost-effectiveness. In most cases, we recommend that you use cloud storage.
  • If you have special requirements on specific features, such as compaction, idempotency, transactions, and partitionally ordered messages, we recommend that you use local storage.

Comparison between cloud storage and local storage

ItemCloud storageLocal storage
Underlying algorithmAlibaba Cloud disk algorithmIn-Sync Replicas (ISR) algorithm of native Apache Kafka
Requirements on instance editionNone
Replica mechanismThree replicas in distributed mode
  • Standard Edition: If you purchase a disk with 300 GB of storage space, you can store 100 GB of business data on the disk. The remaining 200 GB of storage space is used to store the two replicas of your business data.
  • Professional Edition: If you purchase a disk with 300 GB of storage space, you can store 300 GB of business data on the disk. The system provides another 600 GB of storage space for the two replicas of your business data free of charge.

Three replicas in distributed mode

If you purchase a disk with 300 GB of storage space, you can store 100 GB of business data on the disk. The remaining 200 GB of storage space is used to store the two replicas of your business data.

Message sending latencyLowHigh
Partition consumption ratio1:1

If you create a topic that requires 12 partitions, 12 partitions are deducted from the partition quota of the instance that contains the topic.

1:3

If you create a topic that requires 12 partitions, 36 partitions are deducted from the partition quota of the instance that contains the topic.

Fragmented storageNoYes
CompactionNot supportedSupported
IdempotenceNot supportedSupported
TransactionNot supportedSupported
Message typeNormal messages

If restarts or failures occur in a cluster, a small number of messages in the cluster may be out of order.

Partitionally ordered messages

If failures occur in a cluster, the system automatically selects a new leader from the ISR.

Note
  • For information about the Apache Kafka versions that different editions of ApsaraMQ for Kafka support, see Instance editions.
  • When you create a topic in a Professional Edition instance, you can set the value of the Storage Engine parameter to Cloud Storage or Local Storage. When you create a topic in a Standard Edition instance, the Storage Engine parameter is unavailable. For information about how to choose a storage engine, see Step 1: Create a topic.
  • Local storage does not refer to local disks. Instead, it refers to the use of the native ISR algorithm.