تخطيط السعة: الأقسام والنسخ المتماثلة
تعلّم تحديد حجم الموضوعات بعدد الأقسام وعامل النسخ المتماثل المناسبين للموازنة بين معدل المعالجة والتوازي والمتانة والتكلفة التشغيلية.
تخطيط السعة: الأقسام والنسخ المتماثلة درس مجاني في Advanced Spring Boot 4: Event-Driven Architecture (Kafka) على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Advanced Spring Boot 4: Event-Driven Architecture (Kafka)، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Why Sizing Matters
Partition count and replication factor are hard to change after launch and directly shape throughput, parallelism, and durability. Good capacity planning avoids painful migrations later.
Partitions Drive Parallelism
A consumer group can have at most as many active consumers as there are partitions. More partitions allow more parallel consumers and higher throughput.
Estimating Partition Count
A common heuristic: divide target throughput by per-partition throughput.
- Measure max producer throughput per partition (p).
- Measure max consumer throughput per partition (c).
- partitions = max(target/p, target/c).
partitions = ceil( targetMBs / min(producerMBs, consumerMBs) )The Cost of Too Many Partitions
More partitions are not free:
- More open file handles and memory on brokers.
- Longer leader-election and rebalance times.
- Higher end-to-end latency.
Plan headroom, but do not wildly over-provision.
Replication Factor
The replication factor is how many copies of each partition exist across brokers. A factor of 3 is standard for production durability.
In-Sync Replicas
With min.insync.replicas=2 and acks=all, a write succeeds only when at least two replicas confirm. This tolerates one broker failure without data loss.
min.insync.replicas=2
replication.factor=3Creating a Sized Topic
Specify partitions and replication when creating a topic so it starts correctly sized.
kafka-topics.sh --create --topic orders \
--partitions 12 --replication-factor 3 \
--bootstrap-server localhost:9092Planning for Growth
You can increase partitions later but never decrease them, and adding partitions breaks key-based ordering. Pick a count with growth headroom from the start.
Retention and Disk Sizing
Disk need = throughput x retention x replication factor. A topic at 10 MB/s with 7-day retention and RF 3 needs roughly 17 TB. Plan storage accordingly.
Spreading Across Brokers
Ensure partitions and replicas are evenly distributed so no broker becomes a hotspot. Rack-awareness places replicas across failure domains.
Putting It Together
Capacity planning balances parallelism, durability, latency, and cost. Size partitions from throughput, use RF 3 with min ISR 2, and plan disk from retention.
Quick Check
Test your understanding of capacity planning.
Recap
You learned capacity planning.
- Partition count drives consumer parallelism and throughput.
- Too many partitions add latency and broker overhead.
- RF 3 with min ISR 2 tolerates one broker failure.
- Plan disk from throughput x retention x replication.
تعلم Advanced Spring Boot 4: Event-Driven Architecture (Kafka) مع معلم ذكاء اصطناعي — مجانًا
اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.
- الدورات
- 12
- الدروس
- 48
الأسئلة الشائعة
هل درس «تخطيط السعة: الأقسام والنسخ المتماثلة» مجاني؟
نعم — نص درس «تخطيط السعة: الأقسام والنسخ المتماثلة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Advanced Spring Boot 4: Event-Driven Architecture (Kafka)، انتقل إلى CoddyKit PRO. تتضمن دورة Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 4 دروس في المجموع.
ماذا ستتعلم في «تخطيط السعة: الأقسام والنسخ المتماثلة»؟
تعلّم تحديد حجم الموضوعات بعدد الأقسام وعامل النسخ المتماثل المناسبين للموازنة بين معدل المعالجة والتوازي والمتانة والتكلفة التشغيلية. تتمرن على Advanced Spring Boot 4: Event-Driven Architecture (Kafka) مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Advanced Spring Boot 4: Event-Driven Architecture (Kafka)؟
لا تُشترط خبرة سابقة. Advanced Spring Boot 4: Event-Driven Architecture (Kafka) على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «تخطيط السعة: الأقسام والنسخ المتماثلة»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Advanced Spring Boot 4: Event-Driven Architecture (Kafka) هذا؟
نعم. كل درس في Advanced Spring Boot 4: Event-Driven Architecture (Kafka) يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- نصائح لضبط أداء Kafka
- المنتجون والمستهلكون غير المتأثرين بالتكرار
- نشر تطبيقات Spring Boot وKafka على السحابة
- تخطيط السعة: الأقسام والنسخ المتماثلة