-
Notifications
You must be signed in to change notification settings - Fork 0
Chapter 6
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:
- 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).
- 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).
- 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.
- No row has any hidden components, such as an object id or a timestamp.
- Every entry in the table has exactly one value of the appropriate type.
- 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.
- Server level: privileges that apply to all databases on the server
- Database level: privileges that apply to all tables in a particular database on the server
- Table level: privileges that apply to all columns of a particular table in the database
- 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.