Message Queue for Apache Kafka supports two storage engines: cloud storage and local storage. This topic compares the storage engines to help you select a storage engine based on your business requirements.
|Item||Cloud storage (recommended)||Local storage|
|Underlying algorithm||Alibaba Cloud disk algorithm||Apache Kafka-native algorithm for in-sync replicas (ISR)|
|Requirements on instances||N/A|
|Replica mechanism||Three replicas in distributed mode
||Three replicas in distributed mode
If you purchase a disk of 300 GB storage space, you can store 100 GB of business data on the disk. The other 200 GB of storage space is used to store the two replicas of your business data.
|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.
If you create a topic that requires 12 partitions, 36 partitions are deducted from the partition quota of the instance that contains the topic.
|Message type||Normal messages
After a cluster goes down or is restarted, a small number of messages in the cluster may be reordered.
|Partitionally ordered messages
After a cluster goes down, the system automatically selects a new leader from the ISR.
- For information about the Apache Kafka versions that different editions of Message Queue for Apache 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, you do not need to configure the Storage Engine parameter. For information about how to select a storage engine, see Step 1: Create a topic.
- Cloud storage fully make use of the underlying storage of Alobaba Cloud. Compared with local storage, cloud storage provides higher auto-scaling performance, higher reliability, higher availability, and higher cost-effectiveness. In most cases, we recommend that you use cloud storage.
- If you have special requirements for specific features, such as compaction, idempotency, transactions, and partitionally ordered messages, we recommend that you use local storage. These special requirements occur in rare scenarios.
- Local storage does not refer to local disks. It refers to the storage engine that uses the Apache Kafka-native ISR algorithm.