أنواع NoSQL: المستندات والمفتاح-القيمة والأعمدة والرسوم البيانية
سيقارن المتعلمون بين عائلات NoSQL الأربع، ويربطون كل عائلة بحالات استخدام واقعية.
أنواع NoSQL: المستندات والمفتاح-القيمة والأعمدة والرسوم البيانية درس مجاني في MongoDB Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MongoDB Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MongoDB Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
The NoSQL Family Tree
"NoSQL" isn't one thing — it's a family of four: document, key-value, wide-column, and graph stores. MongoDB is a document store. Let's meet them all.
Document Stores: Rich Nested Data
Document stores keep data as flexible JSON-like documents, with nested objects and arrays all in one place. MongoDB leads here — the most versatile NoSQL type.
// Document store example - a product document
{
_id: 'prod_001',
name: 'Wireless Headphones',
category: 'Electronics',
specs: { battery: '30h', connectivity: 'Bluetooth 5.0' },
reviews: [
{ user: 'alice', rating: 5, comment: 'Great!' }
],
price: 79.99
}Key-Value Stores: Blazing Fast Simplicity
Key-value stores like Redis are the simplest: every item is just a key and a value. Lookups are instant, perfect for caches, sessions, and leaderboards.
// Redis key-value example
SET session:user_42 '{"userId":42,"token":"abc123","expiresAt":1700000000}'
GET session:user_42
// Returns the JSON string immediately - O(1) lookup
// Redis also supports richer structures per key:
LPUSH leaderboard 'alice:9500'
LPUSH leaderboard 'bob:8700'
LRANGE leaderboard 0 9 // top 10Wide-Column Stores: Analytical Scale
Wide-column stores like Cassandra spread data across many machines and swallow huge write loads. Ideal for IoT sensors, logs, and time-series data.
// Cassandra CQL - wide-column table design
CREATE TABLE sensor_readings (
device_id UUID,
recorded_at TIMESTAMP,
temperature FLOAT,
humidity FLOAT,
PRIMARY KEY (device_id, recorded_at)
) WITH CLUSTERING ORDER BY (recorded_at DESC);
// Partition key = device_id; clustering key = recorded_atGraph Databases: Relationships First
Graph databases like Neo4j store connections as first-class data, so they fly through relationships. Great for social networks, fraud rings, and recommendations.
// Neo4j Cypher query - find friends of friends
MATCH (me:Person {name: 'Alice'})
-[:FRIENDS_WITH]->(friend)
-[:FRIENDS_WITH]->(foaf)
WHERE NOT (me)-[:FRIENDS_WITH]->(foaf)
AND foaf <> me
RETURN foaf.name AS suggestion
LIMIT 10;Comparing the Four Families
Each family shines somewhere: documents for most apps, key-value for caching, wide-column for IoT, graph for relationships. Always ask: how will I query my data?
When to Use a Document Store
Reach for a document store like MongoDB when your data is nested, your schema keeps changing, and you want rich queries without painful JOINs.
Multi-Model Databases
Big systems often mix databases — a pattern called polyglot persistence. MongoDB for data, Redis for caching, each tool doing what it does best.
NewSQL: The Best of Both Worlds?
NewSQL databases like CockroachDB try to blend NoSQL's scaling with SQL's safety. The SQL vs NoSQL choice is less black-and-white than it used to be.
MongoDB in the NoSQL Landscape
MongoDB leads document stores thanks to its BSON format, rich queries, ACID transactions, and the Atlas cloud platform. Often your first and best NoSQL stop.
Choosing the Right NoSQL Family
Quick guide: single-key lookups go to Redis, relationships to Neo4j, time-series to Cassandra, rich nested data to MongoDB. Unsure? MongoDB is a safe start.
Quick Check
Test your understanding of MongoDB & NoSQL Databases concepts from this lesson.
Lesson Recap
You met the four NoSQL families, saw why MongoDB's documents fit most apps, and learned how polyglot persistence mixes tools. Next: the CAP theorem.
تعلم JavaScript مع معلم ذكاء اصطناعي — مجانًا
اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.
- الدورات
- 30
- الدروس
- 120
الأسئلة الشائعة
هل درس «أنواع NoSQL: المستندات والمفتاح-القيمة والأعمدة والرسوم البيانية» مجاني؟
نعم — نص درس «أنواع NoSQL: المستندات والمفتاح-القيمة والأعمدة والرسوم البيانية» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MongoDB Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MongoDB Academy 4 دروس في المجموع.
ماذا ستتعلم في «أنواع NoSQL: المستندات والمفتاح-القيمة والأعمدة والرسوم البيانية»؟
سيقارن المتعلمون بين عائلات NoSQL الأربع، ويربطون كل عائلة بحالات استخدام واقعية. تتمرن على MongoDB Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ MongoDB Academy؟
لا تُشترط خبرة سابقة. MongoDB Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «أنواع NoSQL: المستندات والمفتاح-القيمة والأعمدة والرسوم البيانية»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس MongoDB Academy هذا؟
نعم. كل درس في MongoDB Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- عنق زجاجة قواعد البيانات العلائقية
- أنواع NoSQL: المستندات والمفتاح-القيمة والأعمدة والرسوم البيانية
- مبرهنة CAP بلغة بسيطة
- موضع MongoDB