1.3.2 Databases pt2 Flashcards
Normalisation
A process to come up with the best possible design for a database, organising tables so data is not duplicated in the same table or different tables.
First Normal Form
- All field names must be unique
- Values in fields should be from the same domain (only contain one piece/type of information)
- Values in fields should be atomic (only one piece of information in each field)
- No two records can be identical
- Each table needs a primary key
Second Normal Form
- It should already be in 1NF
- Any partial dependencies have been removed (every field is dependent on the primary key)
- Any many-to-many relationships should have been removed
Removing partial dependencies
Creating a second table for fields which can be inferred from another which isn’t the primary key. Create a linking table with each table’s primary key
Third Normal Form
- The data is already in 2NF
2. Any transitive dependencies have been removed
Removing transitive dependencies
Create extra tables where the value of a field is determined by another which isn’t the primary key.
Normalisation advantages
Easier to maintain and manage
No unnecessary duplication of data
Data integrity is maintained
Faster searches and savings in storage (smaller table)
EDI
Electronic Data Interchange - exchanges data between documents between computer systems, all documents must be in a standard format (can use EDI translation systems)
Transaction
A single logical operation in a database, may consist of several operations, all of which must be processed.
ACID
Atomicity, Consistency, Isolation, Durability - ensures the integrity of a database
Atomicity
Requires that a transaction will be processed in its entirety or not at all
Consistency
Ensures that no transaction can violate any of the defined validation rules
Isolation
Ensures that each transaction will be isolated and dealt with in a way that does not affect others
Durability
Once a transaction has been committed, it will remain so, even after a power cut. The data is held in a buffer
Record locking
Prevents simultaneous access to objects in a database in order to prevent updates being lost or any inconsistencies.
Deadlock
Where two users are trying to access the same record, serialism techniques are used to prevent it
Timestamp Ordering
If the read timestamp of an object is different to when you opened it, another user must have accessed it so the transaction is cancelled
Commitment Ordering
Orders transactions in terms of their dependencies on one another as well as the time of opening
Redundancy
Stops systems going down with duplicate hardware in another location, now run on a backup
Data integrity
Changes are consistent across a database so removing a record removed all references to that record
Indexing
A method to store the position of each record ordered by an attribute. The private key is automatically indexed but rarely queried