مقدمة في قواعد البيانات ومستخدميها
تغطي هذه الوحدة المفاهيم الأساسية لقواعد البيانات، بيئة نظام إدارة قواعد البيانات، خصائص نهج قواعد البيانات، أنواع المستخدمين، ومتى يجب عدم استخدام قواعد البيانات.
Introduction to Database and Database Users
This module covers the basic concepts of databases, the DBMS environment, characteristics of the database approach, types of users, and when NOT to use a database.
أهداف التعلم
- شرح المفاهيم الأساسية لقواعد البيانات وأنظمة إدارتها.
- تحديد الخصائص الرئيسية لنهج قواعد البيانات مقارنة بالأنظمة التقليدية.
- تصنيف أنواع مستخدمي قواعد البيانات وأدوارهم المختلفة.
- تقييم الحالات التي يكون فيها استخدام نظام إدارة قواعد البيانات غير ضروري أو غير مناسب.
- Explain the basic concepts of Database and DBMS.
- Identify the main characteristics of the database approach compared to traditional systems.
- Classify the types of Database Users and their different roles.
- Evaluate situations where using a DBMS is unnecessary or inappropriate.
1 التعريفات الأساسية لقواعد البيانات
1 Basic Database Definitions
البيانات هي الحقائق، وقاعدة البيانات هي تجميعها، ونظام الإدارة (DBMS) هو البرنامج الذي يتحكم بها، تماماً مثل المكتبة والكتب وأمين المكتبة.
Data are facts, a Database is the collection, and the DBMS is the software managing it, just like books, a library, and a librarian.
تتكون بيئة قواعد البيانات من عدة مصطلحات أساسية:
البيانات (Data) وهي حقائق معروفة يمكن تسجيلها ولها معنى ضمني.
قاعدة البيانات (Database) هي مجموعة من البيانات المترابطة.
نظام إدارة قواعد البيانات (DBMS) هو نظام برمجي محوسب يتيح للمستخدمين إنشاء وصيانة قاعدة البيانات.
عندما نجمع بين قاعدة البيانات وبرنامج DBMS، نحصل على نظام قاعدة البيانات (Database System).
The database environment consists of several core terms:
Data are known facts that can be recorded and have implicit meaning.
A Database is a collection of related data.
A Database Management System (DBMS) is a computerized software system that enables users to create and maintain a database.
Together, the database and DBMS software form the Database System.
يجب التمييز بدقة بين DBMS (البرنامج نفسه مثل MySQL) ونظام قاعدة البيانات (البرنامج + البيانات الفعلية).
يتضمن تعريف قاعدة البيانات تحديد أنواع البيانات والهياكل والقيود، بينما تتضمن المعالجة (Manipulating) الاستعلام والتحديث.
كما يتم تخزين البيانات الوصفية (Meta-data) في كتالوج النظام، مما يجعل قاعدة البيانات تصف نفسها بنفسها.
A strict distinction must be made between the DBMS (the software engine, e.g., MySQL) and the Database System (the software + the actual stored data).
Defining a database involves specifying data types, structures, and constraints, while manipulating involves querying and updating.
Furthermore, Meta-data is stored in the system catalog, making the database self-describing.
لماذا نعتبر 'البيانات الوصفية' (Meta-data) ضرورية لعمل نظام إدارة قواعد البيانات (DBMS)؟ Why is 'Meta-data' essential for the operation of a DBMS?
لأنها تسمح لبرنامج DBMS بأن يكون مستقلاً عن التطبيقات المحددة؛ فهو يقرأ الكتالوج ليعرف هيكل البيانات بدلاً من أن يكون الهيكل مبرمجاً داخل التطبيق نفسه.
Because it allows the DBMS software to be independent of specific applications; it reads the catalog to know the data structure rather than having the structure hard-coded into the application.
2 الخصائص الرئيسية لنهج قواعد البيانات
2 Main Characteristics of the Database Approach
قواعد البيانات تصف نفسها، تفصل البيانات عن البرامج، تدعم وجهات نظر متعددة، وتسمح لعدة مستخدمين بالعمل معاً في نفس الوقت.
Databases are self-describing, insulate data from programs, support multiple views, and allow multiple users to work concurrently.
يتميز نهج قواعد البيانات بأربع خصائص رئيسية:
- الطبيعة الوصفية الذاتية (Self-describing): حيث يخزن النظام وصفاً لنفسه (البيانات الوصفية).
- العزل بين البرامج والبيانات (Insulation): ويتحقق من خلال تجريد البيانات (Data Abstraction)، مما يوفر استقلالية البرامج عن البيانات.
- دعم وجهات نظر متعددة (Multiple views): كل مستخدم يرى فقط البيانات التي تهمه.
- مشاركة البيانات ومعالجة المعاملات متعددة المستخدمين: السماح لعدة مستخدمين بالوصول المتزامن مع ضمان التحكم في التزامن (Concurrency control).
The database approach has four main characteristics:
- Self-describing nature: The system stores a description of itself (meta-data).
- Insulation between programs and data: Achieved through data abstraction, providing program-data independence.
- Support of multiple views: Each user sees only the data of interest to them.
- Sharing of data and multi-user transaction processing: Allowing concurrent access while ensuring concurrency control and recovery.
مفهوم استقلالية البرامج عن البيانات (Program-data independence) يعني أن تغيير هيكل تخزين البيانات لا يتطلب تغيير البرامج التي تصل إليها.
كما أن معالجة المعاملات عبر الإنترنت (OLTP) تعد جزءاً رئيسياً من التطبيقات الحديثة، حيث تضمن أنظمة التحكم في التزامن تنفيذ المعاملات بشكل صحيح أو إلغائها بالكامل (Aborted) لمنع تضارب البيانات.
The concept of program-data independence means that changing the data storage structure does not require changing the access programs.
Furthermore, Online Transaction Processing (OLTP) is a major part of modern applications, where concurrency control subsystems guarantee that transactions are either correctly executed or completely aborted to prevent data inconsistency.
كيف يمنع 'التحكم في التزامن' (Concurrency control) المشاكل عند حجز تذكرتي طيران في نفس اللحظة؟ How does 'Concurrency control' prevent issues when booking two flight tickets at the exact same moment?
يضمن أن معاملة واحدة فقط يمكنها تعديل حالة المقعد في وقت واحد، بينما تنتظر المعاملة الأخرى أو يتم إلغاؤها إذا لم يعد المقعد متاحاً.
It ensures that only one transaction can modify the seat's status at a time, while the other waits or is aborted if the seat is no longer available.
3 أنواع مستخدمي قواعد البيانات (الممثلون على المسرح)
3 Types of Database Users (Actors on the scene)
ينقسم المستخدمون إلى: مدير (DBA) يتحكم بالنظام، مصمم يبني الهيكل، ومستخدم نهائي (End-user) يتعامل مع البيانات يومياً.
Users are divided into: DBA (controls the system), Designer (builds the structure), and End-user (interacts with data daily).
يوجد عدة أنواع من المستخدمين:
- مديرو قواعد البيانات (DBA): مسؤولون عن التصريح بالوصول، مراقبة الاستخدام، وتوفير الموارد.
- مصممو قواعد البيانات: مسؤولون عن تحديد الهيكل والقيود.
- المستخدمون النهائيون (End-users): وهم من يستخدمون البيانات، وينقسمون إلى:
- عرضيون (Casual): وصول متقطع.
- سذج/نمطيون (Naïve/Parametric): الشريحة الأكبر، يستخدمون برامج جاهزة (Canned transactions) مثل موظفي البنوك.
- متمرسون (Sophisticated): محللون ومهندسون يستخدمون أدوات متقدمة.
- مستقلون (Stand-alone): يديرون قواعد بيانات شخصية.
There are several types of users:
- Database Administrators (DBA): Responsible for authorizing access, monitoring use, and acquiring resources.
- Database Designers: Responsible for defining structure and constraints.
- End-users: Those who use the data, categorized into:
- Casual: Occasional access.
- Naïve (Parametric): Largest section, use previously implemented programs (Canned transactions) like bank tellers.
- Sophisticated: Analysts and engineers using advanced tools.
- Stand-alone: Maintain personal databases.
يتحمل الـ DBA المسؤولية الكاملة عن الاختراقات الأمنية وضعف وقت الاستجابة للنظام.
من ناحية أخرى، يعتمد المستخدمون السذج (Naïve) بشكل كامل على 'المعاملات المعلبة' (Canned transactions) التي تم برمجتها واختبارها مسبقاً، مما يقلل من الأخطاء البشرية ويضمن سلامة البيانات في بيئات العمليات الكثيفة (OLTP).
The DBA is accountable for security breaches and poor system response time.
On the other hand, Naïve users rely entirely on 'Canned transactions' which are pre-programmed and tested, reducing human error and ensuring data integrity in high-volume OLTP environments.
| Naïve (Parametric) End-users | Sophisticated End-users | |
|---|---|---|
| طريقة التفاعل مع النظام Interaction Method | استخدام برامج ومعاملات جاهزة (Canned transactions) Use previously implemented programs (Canned transactions) | استخدام أدوات متقدمة وحزم برمجيات للتحليل Use advanced tools and software packages for analysis |
| حجم الشريحة Population Size | القسم الأكبر من المستخدمين Largest section of end-user population | شريحة متخصصة (محللون، مهندسون) Specialized section (analysts, engineers) |
إذا كان النظام بطيئاً جداً في الاستجابة، من هو المستخدم المسؤول عن حل هذه المشكلة؟ If the system is very slow to respond, which user is responsible for resolving this issue?
مدير قاعدة البيانات (DBA) هو المسؤول عن مراقبة كفاءة العمليات ووقت استجابة النظام.
The Database Administrator (DBA) is accountable for monitoring efficiency and system response time.
4 متى لا نستخدم نظام إدارة قواعد البيانات
4 When NOT to use a DBMS
لا تستخدم DBMS إذا كان تطبيقك بسيطاً جداً، أو يتطلب استجابة فورية حرجة (Real-time)، أو لا يحتاج لمشاركة البيانات بين عدة مستخدمين.
Do not use a DBMS if your app is very simple, requires strict real-time response, or doesn't need multi-user data sharing.
رغم فوائد DBMS، إلا أن له تكاليف (Inhibitors) مثل الاستثمار الأولي المرتفع والحاجة لأجهزة إضافية، بالإضافة إلى العبء الإضافي (Overhead) لتوفير الأمان والتحكم في التزامن.
قد يكون DBMS غير ضروري إذا: كانت قاعدة البيانات والتطبيقات بسيطة ومحددة جيداً ولا يتوقع تغيرها، أو إذا كانت هناك متطلبات صارمة للوقت الفعلي (Real-time) قد يعيقها عبء النظام، أو إذا لم يكن الوصول المتعدد مطلوباً.
وقد لا يكون كافياً إذا: كانت هناك قيود في النمذجة تمنع التعامل مع بيانات معقدة، أو إذا كان المستخدمون يحتاجون عمليات خاصة لا يدعمها النظام.
Despite its benefits, a DBMS has costs (inhibitors) such as high initial investment, need for additional hardware, and overhead for providing security and concurrency control.
A DBMS may be unnecessary if: the database and applications are simple, well-defined, and not expected to change; there are stringent real-time requirements hindered by DBMS overhead; or multi-user access is not required.
It may not suffice if: modeling limitations prevent handling complex data, or users need special operations not supported by the DBMS.
العبء الإضافي (Overhead) في DBMS يأتي من الطبقات المتعددة للتجريد، التحقق من الأمان، وتسجيل المعاملات (Logging) للاسترداد.
في الأنظمة المدمجة (Embedded Systems) أو أنظمة التوجيه الشبكي التي تتطلب استجابة في أجزاء من الملي ثانية، هذا العبء غير مقبول، ولذلك تُفضل هياكل البيانات المخصصة في الذاكرة (In-memory custom structures) على أنظمة DBMS التقليدية.
The overhead in a DBMS comes from multiple layers of abstraction, security checks, and transaction logging for recovery.
In embedded systems or network routing systems requiring sub-millisecond responses, this overhead is unacceptable, hence custom in-memory data structures are preferred over traditional DBMSs.
| Using a DBMS | Not Using a DBMS | |
|---|---|---|
| التكلفة الأولية Initial Investment | مرتفعة (برمجيات وأجهزة) High (software and hardware) | منخفضة Low |
| أداء الوقت الفعلي (Real-time) Real-time Performance | قد يعاني من تأخير بسبب العبء الإضافي (Overhead) May suffer delays due to overhead | سريع ومباشر (مناسب للمتطلبات الصارمة) Fast and direct (suitable for stringent requirements) |
| التحكم في التزامن والأمان Concurrency & Security | مدمج وموثوق Built-in and reliable | يجب برمجته يدوياً (عرضة للأخطاء) Must be programmed manually (error-prone) |
لماذا لا تستخدم أنظمة توجيه الصواريخ أنظمة إدارة قواعد بيانات علائقية (RDBMS) قياسية؟ Why don't missile guidance systems use standard Relational DBMSs?
لأنها تمتلك متطلبات صارمة للوقت الفعلي (Stringent real-time requirements)، والعبء الإضافي (Overhead) لنظام DBMS قد يؤدي إلى تأخيرات كارثية.
Because they have stringent real-time requirements, and the overhead of a DBMS could cause catastrophic delays.