This mini-lesson covers OCR 1.3 β Exchanging data: how data is squeezed, secured, stored in databases and moved across networks and the web.
Work through each screen, answer the questions as you go (some are recall, some are calculations you must actually work out) and collect β stars. Press Start when you're ready.
Lossless compression discards nothing β the original is restored bit for bit. Essential for text, code and executables.
Lossy compression permanently discards data that human perception will not miss β MP3 removes inaudible frequencies, JPEG throws away fine colour detail. Far smaller files, and the discarded data is gone forever.
RLE's weakness: on data with no runs β ordinary English text, for instance β every single character becomes a (character, 1) pair, so the file gets bigger. No compression algorithm can shrink every possible input; that is a mathematical impossibility, not an engineering failure.
| Symmetric | Asymmetric |
|---|---|
| One shared key encrypts and decrypts | A public key encrypts; only the matching private key decrypts |
| Fast β used for the bulk of the data | Slow β used to exchange a symmetric key and to sign |
| The hard problem: how do you get the key to the other party securely? | Solves it β the public key may be published openly |
Digital signatures: the sender hashes the message and encrypts the hash with their private key. Anyone can decrypt it with the public key, hash the message themselves, and compare β proving both authenticity and integrity.
Hashing is one-way: it turns input of any size into a fixed-size digest that cannot be reversed. It is used to index hash tables and, crucially, to store passwords β so a stolen database yields nothing usable.
Hashing is not encryption. Encryption is designed to be reversed by whoever holds the key. Hashing is designed never to be reversed at all. Confusing them is the single commonest error in this topic.
A flat file holds everything in one table, so data is repeated in row after row. That redundancy causes update anomalies: change a customer's address and you must edit every row that mentions them β miss one and the database now contradicts itself.
A relational database splits data into linked tables:
| Form | Rule |
|---|---|
| 1NF | Atomic values only β no repeating groups or lists in a cell |
| 2NF | In 1NF, and no partial dependency on part of a composite key |
| 3NF | In 2NF, and no transitive dependency (a non-key field depending on another non-key field) |
The mantra: every non-key attribute depends on the key, the whole key, and nothing but the key. A many-to-many relationship must be resolved with a link table.
A transaction must succeed or fail as one indivisible unit. The ACID guarantees:
Record locking stops two users updating the same record at once (the lost update problem) β at the risk of deadlock, where each transaction waits for a lock the other holds. Redundancy (mirrored servers) protects against hardware failure.
The most dangerous line in SQL: DELETE FROM Student; β with the WHERE clause forgotten, that removes every row. Write the WHERE clause first, then the rest.
| Layer | Job | Examples |
|---|---|---|
| Application | Protocols the user's program speaks | HTTP, HTTPS, FTP, SMTP, POP3, IMAP |
| Transport | Splits data into packets, adds port numbers, handles acknowledgements and retransmission | TCP, UDP |
| Network | Adds source and destination IP addresses; routers forward packets | IP |
| Link | Adds MAC addresses for the physical hop | Ethernet, Wi-Fi |
Packet switching: data is split into packets, each routed independently and possibly by a different route, then reassembled in order using their sequence numbers. This uses the network efficiently and routes automatically around failure and congestion. Circuit switching instead reserves a dedicated path for the whole call β guaranteed bandwidth, but the line sits idle whenever nobody is speaking.
DNS is a distributed, hierarchical database that resolves a domain name to an IP address. Client-server centralises control on a server; peer-to-peer makes every machine both client and server, with no single point of failure and capacity that grows with the number of peers.
| Client-side processing | Server-side processing |
|---|---|
| Runs in the browser; instant response; reduces server load | Runs on the server; the code and the database are never exposed |
| Can be read, altered or disabled by the user β so validation here is a convenience, never a security control | Cannot be tampered with by the client; slower (a round trip) |
Search engine indexing: web crawlers follow links, and the pages are indexed by keyword. PageRank then ranks them: a page is important if important pages link to it. A link from a highly ranked page passes on more weight than a link from an obscure one β which is why simply creating thousands of junk pages that link to you does not work.
The security rule you must never forget: always validate on the server, even if you have already validated on the client. Client-side code runs on a machine the attacker controls completely β they can simply switch it off and post whatever they like.
Tap an item, then tap the layer it belongs to.
Tap an item on the left, then its partner on the right.
Compression: lossless (RLE, dictionary) recovers exactly Β· lossy (MP3, JPEG) discards permanently Β· RLE can enlarge run-free data
Security: symmetric = fast, key exchange is the problem Β· asymmetric = solves it, slow Β· digital signatures Β· hashing is one-way
Databases: primary/foreign/secondary keys Β· referential integrity Β· 1NF, 2NF, 3NF Β· link table for many-to-many
SQL & ACID: SELECT/INSERT/UPDATE/DELETE/INNER JOIN Β· atomicity, consistency, isolation, durability Β· record locking, deadlock
Networks: TCP/IP stack: application, transport, network, link Β· packet vs circuit switching Β· DNS Β· client-server vs peer-to-peer
Web: HTML structure, CSS presentation, JavaScript behaviour Β· PageRank Β· always validate on the server
That is the whole of OCR 1.3. Press Finish to see your score.
You've worked through Exchanging data for OCR A-level Computer Science (H446). π
Your stars: 0 / 0
Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.