Skip to content

Chapter 6

AJ Williams edited this page Mar 31, 2020 · 4 revisions

Databases- what I tend to avoid due to my self identified lack in expertise.

This chapter lightly covers the concepts for good database structure and the use of them.

Relational- each table is related to a class create retrieve update delete

6 Rules of Normalization:

  1. The rows can be rearranged without changing the meaning of the table (i.e., there’s no implicit ordering or functional interdependency among the rows).
  2. The columns (attributes) can be rearranged without changing the meaning of the table (i.e., there’s no implicit ordering or functional interdependency among the columns).
  3. No two rows of a table are identical. This is often accomplished by defining one column whose values are mutually unique. This column is known as the table’s primary key.
  4. No row has any hidden components, such as an object id or a timestamp.
  5. Every entry in the table has exactly one value of the appropriate type.
  6. No attribute in the table is redundant with (i.e., appears as an explicit substring of) the primary key.

Normalization is not the be-all end-all of database management. Sometimes choices must be made that may ommit some rules to make more sense in a project.

Security:
A secure database is able to avoid unauthorized and accidental access and deletion of data, protect confidential information, and maintain data integrity.

This starts with managing permissions with the 4 levels of access.

  1. Server level: privileges that apply to all databases on the server
  2. Database level: privileges that apply to all tables in a particular database on the server
  3. Table level: privileges that apply to all columns of a particular table in the database
  4. Column level: privileges that apply to an individual column of a table in the database

Integrity of data is handled by the process of handling collisions. Users may attempt to edit data while someone else is editing or retrieving it. There must be a way to handle these collisions. Similar to work in Operating Systems class, there must be locks on data when it is being accessed.

Clone this wiki locally