3. Exchanging Data Flashcards
What is Compression? How do Lossy and Lossless Compression differ?
Compression is a family of techniques which reduce the size of data. Compression is important for saving system resources (Hard Disk space), and increasing the speed of data transmission over Networks.
Lossy Compression will lose some quality in the original data when compressing, but usually creates a higher Compression ratio (i.e. smaller files). The lost data may be exhibited as artifacts in image files. Lossless Compression loses none of the quality of the original data, but has a lower Compression ratio.
How does Run Length Encoding Compress data?
Run Length Encoding (RLE) is used to compress data which has consecutive repetitions of the same symbol. It represents the data as a series of symbols and the number of times they repeat. For example the data:
AAAAAAAABBBBBBBCCCAAAAAABBCCCC
would be encoded as:
A8B7C3A6B2C4
Data, such as text, which does not have many consecutive repetitions will not compress well with RLE.
How does Dictionary Compression Compress data?
Dictionary Compression is used to compress data which has repeating words (like text). The words are stored in a Dictionary, with each word allocated a unique numeric index. The text is then replaced by a sequence of indexes into the Dictionary. This will compress the text if words repeat often.
What is Encryption? What is the difference between Symmetric and Asymmetric Encryption?
Encryption is a family of techniques used to hide the content of a message from third parties. Symmetric Encryption uses the same Encryption Key both for encrypting and decrypting the message. Asymmetric Encryption uses a different Encryption Key for encrypting than for decrypting the message. Symmetric Encryption requires the sender to pass the key to the receiver, when it may be intercepted, this is called the Key Exchange Problem.
How does the Caeser Cipher work?
A Caeser Cipher is a shift cipher which changes each character by moving a certain number of characters to the left or right. The number of places to move each character is the Encryption Key, and this is a type of Symmetric Encryption. For example, the text ‘Hello World’ shifted by 3 characters would give the ciphertext ‘Khoor Zruog’.
How does Public Key Encryption work?
Public Key Encryption is an Asymmetric Encryption Technique commonly used on the Internet. Each device will have a Public Key which is freely available to all devices on the Network, and a Private Key which is kept secret. Both the Public Key and the Private Key are needed to encrypt and then decrypt the message. For example, if the Public Key is used to encrypt a message, then the Private Key must be used to decrypt it (and vice versa).
If device A is sending a message to device B, then it encrypts the message with device B’s Public Key, then transmits the encrypted message, and finally device B can decrypt it with its own Private Key.
Because the Private Key never needs to be shared, this solves the Key Exchange Problem.
How are Checksums used?
Checksums are used for Error Detection.
A Checksum is a value (number) calculated using a mathematical function (a Hash Function) from the data to be transmitted. The Checksum is sent to the receiver along with the data. The receiver then applies the same mathematical function to the received data, and if the calculated Checksum matches the received Checksum then no error has occurred in transmission.
What is a Flat File Database?
A Flat File Database consists of a single file which stores an entire dataset. A spreadsheet is an example of a Flat File Database.
What is a Relational Database?
A Relational Database is a Database which stores information in Relations/Tables. Each Relation will consist of Records/Rows and Attributes/Columns.
What is SQL?
SQL is Structured Query Language, a language for communicating with Relational Databases.
What is a Primary Key?
A Primary Key is a unique identifier for each Record in a Relation.
What is a Foreign Key?
A Foreign Key is an identifier for a Record in another Relation.
What is a Composite Key?
A Composite Key is a Key (Primary or Foreign) which consists of multiple Attrributes.
What is First Normal Form?
A Relation is in First Normal Form if it has no repeating Attribute or group of Attributes.
What is Second Normal Form?
A Relation is in Second Normal Form if it is in First Normal Form and there are no Partial Key Dependencies.
A Partial Key Dependency is when an Attribute is dependent upon only part of a Composite Key.
What is Third Normal Form?
A Relation is in Third Normal Form if it is in Second Normal Form and there are no Non-Key Dependencies.
A Non-Key Dependency is when an Attribute is dependent upon another Attribute which is not part of the Primary Key.
What is Referential Integrity?
Referential Integrity refers to how Foreign Keys reference Records in other Tables. If the Record which is referenced does not exist then the Referential Integrity of the Database has been broken. This can happen when a Record is deleted from a Table. There are various methods for enforcing Referential Integrity including ‘Cascade on Delete’, where Records referencing a deleted Record are also deleted.
What does ACID refer to?
Atomicity - all transactions must be fully processed, or not at all.
Consistency - no transaction can violate any of the validation constraints on the Database, for example rules enforcing Referential Integrity.
Isolation - there will be no difference in the resulting dataset between executing transactions in parallel (concurrently) or sequentially.
Durability - once a transaction is completed, the result of the transaction is permanent.
Why do Databases implement Record Locks?
Record Locks prevent multiple users from changing the same Record in a Relation at the same time which can lead to inconsistent results or corrupt data.
What is DeadLock?
DeadLock is when cyclical dependency appears between the Record Locks that users have created whilst interacting with a Database. For example user A may have locked Table 1 whilst waiting for user B to unlock Table 2, whilst user B is waiting for Table 1 to be unlocked to continue.
What is a Network?
A Network consists of Hardware which allows computers and other devices to communicate with one another.
What is the difference between a LAN and a WAN?
A LAN is a Local Area Network, a Network over a small geographical area.
A WAN is a Wide Area Network, a Network over a large geographical area.