Foundations: Databases & Users الأساسيات: قواعد البيانات والمستخدمين

Understanding the architecture, actors, and fundamental concepts that power modern data systems. فهم البنية التحتية، والجهات الفاعلة، والمفاهيم الأساسية التي تشغل أنظمة البيانات الحديثة.

Data vs Info Data vs Info DBMS DBMS Meta-data Meta-data Transaction Processing معالجة المعاملات End Users المستخدمون النهائيون

Basic Definitions تعريفات أساسية

The Basics المصطلحات الأساسية

  • Data: Data (البيانات): Known facts that have implicit meaning (e.g., Names, Numbers). حقائق معروفة لها معنى ضمني (مثل: الأسماء، الأرقام).
  • Database: Database (قاعدة البيانات): A collection of related data. It represents a Miniworld (Universe of Discourse). مجموعة من البيانات المرتبطة ببعضها. وهي تمثل Miniworld (عالم الخطاب).
  • Meta-data: Meta-data (وصف البيانات): "Data about Data". The description of the database structure (types, constraints) stored in the DBMS catalog. "بيانات عن البيانات". هو وصف لهيكل قاعدة البيانات (الأنواع، القيود) المخزنة في كتالوج الـ DBMS.

The System النظام

  • DBMS: DBMS: A software system to create, maintain, and control access to the database (e.g., Oracle, MySQL). نظام برمجي لإنشاء وصيانة والتحكم في الوصول إلى قاعدة البيانات (مثل: Oracle, MySQL).
  • Database System: Database System (نظام قاعدة البيانات): The combination of the Database + DBMS Software + Application Programs. المزيج المكون من قاعدة البيانات + برنامج DBMS + البرامج التطبيقية.

Simplified Database Environment بيئة قاعدة البيانات المبسطة

Why Use Databases? لماذا نستخدم قواعد البيانات؟

Traditional file processing (saving data in text files) has many issues. The Database Approach solves them via four main characteristics: معالجة الملفات التقليدية (حفظ البيانات في ملفات نصية) تعاني من مشاكل عديدة. يحل "نهج قاعدة البيانات" هذه المشاكل عبر أربع خصائص رئيسية:

1. Self-Describing Nature 1. Self-Describing Nature (الطبيعة الوصفية الذاتية)

The system contains not only the data but the structure of the data (Meta-data) in a catalog. This allows the DBMS to work with any database application. النظام لا يحتوي فقط على البيانات بل على هيكل البيانات (Meta-data) في الكتالوج. وهذا يسمح لـ DBMS بالعمل مع أي تطبيق قاعدة بيانات.

2. Insulation (Data Abstraction) 2. Insulation / Data Abstraction (العزل / تجريد البيانات)

Program-Data Independence: You can change the data structure (e.g., add a field) without rewriting the application code. The DBMS handles the mapping. استقلالية البرامج عن البيانات: يمكنك تغيير هيكل البيانات (مثل إضافة حقل) دون إعادة كتابة كود التطبيق. الـ DBMS يتولى عملية الربط (Mapping).

3. Multiple Views 3. Multiple Views (تعدد وجهات النظر)

Different users see different subsets of the data. A student sees grades; an admin sees transcripts. يرى المستخدمون المختلفون مجموعات فرعية مختلفة من البيانات. الطالب يرى الدرجات؛ والمشرف يرى السجلات الأكاديمية.

4. Multi-user Transaction Processing 4. Transaction Processing (معالجة المعاملات)

Allows concurrent access. The DBMS ensures Concurrency Control (e.g., two people booking the same seat) and OLTP (Online Transaction Processing). يسمح بالوصول المتزامن. يضمن الـ DBMS Concurrency Control (مثل شخصين يحجزان نفس المقعد) و OLTP.

Actors on the Scene الجهات الفاعلة (Actors)

DBA (Administrator) DBA (مدير قاعدة البيانات)

Controls access, coordinates use, acquires resources, and ensures efficiency. Accountable for security. يتحكم في الوصول، ينسق الاستخدام، يوفر الموارد، ويضمن الكفاءة. وهو المسؤول عن الأمان.

Database Designers Database Designers

Identify data, choose structures/constraints, and communicate with users. يحددون البيانات، يختارون الهياكل/القيود، ويتواصلون مع المستخدمين.

End Users End Users

The people who query/update the data. الأشخاص الذين يستعلمون/يحدثون البيانات.

Categories: الفئات:
  • Casual:Casual: Occasional access. وصول عرضي (غير دائم).
  • Naive (Parametric):Naive (Parametric): Use "canned" transactions (e.g., Bank Tellers). يستخدمون معاملات "جاهزة" (Canned) (مثل صرافي البنوك).
  • Sophisticated:Sophisticated: Scientists/Analysts using tools. علماء/محللون يستخدمون أدوات.

When NOT to use a DBMS? متى لا نستخدم DBMS؟

Using a DBMS incurs high costs (Investment, Hardware, Training, Overhead). Avoid it if: استخدام DBMS يترتب عليه تكاليف عالية (استثمار، أجهزة، تدريب، تكاليف تشغيلية). تجنبه إذا:

  • The database and applications are simple, well-defined, and not expected to change. قاعدة البيانات والتطبيقات بسيطة، محددة جيداً، وغير متوقع تغييرها.
  • Stringent real-time requirements (Overhead is too high). متطلبات الوقت الفعلي صارمة (التكاليف التشغيلية Overhead مرتفعة جداً).
  • Multiple user access is NOT required. تعدد وصول المستخدمين (Multiple user access) غير مطلوب.

The Exam Vault خزنة الاختبار

Professor's Secrets & Trap Avoidance أسرار البروفيسور وتجنب الفخاخ

TRAP: Casual vs Naive Users فخ: Casual vs Naive

Naive (Parametric) users make up the largest group (e.g., Bank Tellers). They use standard, pre-programmed queries ("Canned Transactions").
Casual users access the DB occasionally and may need different info each time. Do not swap them!
المستخدمون Naive (Parametric) هم المجموعة الأكبر (مثل صرافي البنوك). يستخدمون استعلامات قياسية مبرمجة مسبقاً ("Canned Transactions").
المستخدمون Casual يصلون لقاعدة البيانات بشكل عرضي وقد يحتاجون معلومات مختلفة في كل مرة. لا تخلط بينهم!

TRAP: Program-Data Independence فخ: استقلالية البرامج والبيانات

In traditional file processing, if you change the data format (e.g., change zip code from 5 to 9 digits), you must rewrite every program that uses it. In a DBMS, you change the structure in the catalog (Meta-data) only. This is "Independence". في معالجة الملفات التقليدية، إذا غيرت تنسيق البيانات (مثلاً الرمز البريدي)، يجب إعادة كتابة كل برنامج يستخدمه. في DBMS، تقوم بتغيير الهيكل في الكتالوج (Meta-data) فقط. هذه هي "الاستقلالية".

SECRET: Meta-data سر: Meta-data

If an exam question asks "What makes a database system self-describing?", the answer is Meta-data (stored in the Catalog). It describes the structure, types, and constraints. إذا سأل الاختبار "ما الذي يجعل نظام قاعدة البيانات يصف نفسه ذاتياً؟"، الإجابة هي Meta-data (المخزنة في الكتالوج). فهي تصف الهيكل والأنواع والقيود.

KEY CONCEPT: The Goal مفهوم أساسي: الهدف

The ultimate goal of the database approach is to control (not necessarily eliminate) Redundancy. Controlled redundancy improves performance; uncontrolled redundancy leads to Inconsistency. الهدف النهائي لنهج قاعدة البيانات هو التحكم في (وليس بالضرورة إلغاء) Redundancy (التكرار). التكرار المنضبط يحسن الأداء؛ التكرار غير المنضبط يؤدي إلى عدم الاتساق (Inconsistency).