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
Item | Cloud storage | Local storage |
Underlying algorithm | Alibaba Cloud disk algorithm | In-Sync Replicas (ISR) algorithm of native Apache Kafka |
Requirements on instance edition | None | |
Replica mechanism | Three replicas in distributed mode
| 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 latency | Low | High |
Partition consumption ratio | 1: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 storage | No | Yes |
Compaction | Not supported | Supported |
Idempotence | Not supported | Supported |
Transaction | Not supported | Supported |
Message type | Normal 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. |
- 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.