VIP 👤
🏠 الرئيسية
المقاييس
📊 جميع المقاييس 🦖 ديناصور v1 🦖 ديناصور v2 ✅ تطبيقات قائمة المهام 🎨 صفحات حرة إبداعية 🎯 FSACB - العرض النهائي 🌍 مقياس الترجمة
النماذج
🏆 أفضل 10 نماذج 🆓 نماذج مجانية 📋 جميع النماذج ⚙️ كيلو كود
الموارد
💬 مكتبة الأوامر 📖 قاموس الذكاء الاصطناعي 🔗 روابط مفيدة 🔌 واجهات API والموجّهات
Advanced

Horizontal Sharding Strategy for Social Graph

#database #sharding #scalability #sql

Develop a sharding strategy for a social media platform's database.

You are the Database Architect for a rapidly growing social network with 500 million users. The current monolithic Postgres instance is hitting I/O limits. Propose a horizontal sharding strategy for the 'Users', 'Posts', and 'Follows' tables. Your solution must address: 1. Choice of shard key and justification (e.g., hash-based vs range-based). 2. How to handle 'fan-out' queries (retrieving a user's timeline) efficiently across shards. 3. Strategies for rebalancing data when adding new nodes to the cluster with minimal downtime. 4. Handling cross-shard transactions for operations like sending a message.