Total Knowledge Projects Jobs Clientele Contact

UU Database

Personal tools
From Total Knowledge
Revision as of 08:51, 13 April 2006 by Alexeyp (Talk | contribs)
Jump to: navigation, search


Database structure requirements

Naming Conventions

  1. All tables should have names of two or three words, separated with underscore. The combination of first letters of these words should be unique in the whole database. In this document, this combination, followed with underscore ('_'), is called table name prefix. Example: teachers_list, course_group_list.
  2. Every field in every table should have table name prefix, followed by the field name. Example: teachers_list(tl_id), course_group_list(cgl_id).
  3. Every index name should start from "ndx_", followed with the table name prefix, and the field names, included in the index, separated with underscore.
  4. The primary key name should start from "pk_" followed by the table name prefix
  5. The foreign key name should start from "fk_" followed by the table name prefix and foreign table name prefix

Structure Requirements

  1. Tables in the database are placed in two domains: main and logs. The logs domain contains tables that contain access logs and statistics information. These tables may be emptied at any given moment without affecting the actual data.
  2. Every table should have a unique primary id (integer,auto-increment), logically not connected to the actual data.
  3. Any application that connects to the database, should have only read-access to the tables. All the modification operations, including insert, update, delete operations, should be performed in the stored procedures. The stored procedures should be implemented in a stored procedure language (most likely PL/SQL or equivalent), that doesn't allow to create a stored procedure without an integrity check. Integrity check should validate every object used in the stored procedure.
  4. Any transaction, performed by the application, should include only one stored procedure call.
  5. The important corner-stones tables should have triggers, logging any modifications in these tables as a set of user name, modification date and time, modification type. (If this is accepted, I'd provide the implementation details).
  6. Under no circumstances tables should use automatic cascade-delete on foreign keys. For any delete of detail records, stored procedure should verify the access rights for the given group of the records within the table (assuming that the user is granted access to the stored procedure removing records).

Security Requirements

  1. The security policy should provide several access roles. Besides the role, every user is granted the set of the (objects,projects,courses) he can access. Modification of access to the critical objects is only allowed if person has relation to the (objects,projects,courses). Every user may be granted several roles, if underlying database supports that.
  2. We have to implement at least the following database roles:
    1. DBO/DBA and backup (already implemented)
    2. Customer service role has access to read everything (may be but security tables), access to all maintenance and all security stored procs
    3. Teacher role has full access to any data within the course he is teaching (multiple courses per teacher are expected), access to data maintenance and user privileges stored procs within the course
    4. Student role has some access (needs to be determined) to data maintenance within the course
    5. Reports role has read access to everything but security tables, access to reporting stored procs

    Automated maintenance should use either "Customer Service", or "Backup" roles..

  3. The most interesting case is the access to shared objects. A shared object, included in the course, can be accessed by students using stored procedures. If the author needs to modify a shared object, the modification request is made through the stored procedure. After modification is completed, the shared object belongs to the author but keeps a referense to the original object. Any details of the versioning are encapsulated within the modification stored procedure. However, the stored procedure must validate the access right of the author upon the modification attempt. Only the owner of the shared object may modify it without creating a new version of the object.