AQA A-Level Computer Science 7517
Fundamentals of Programming
Fundamentals of Data Structures
Fundamentals of Algorithms
Theory of Computation
Fundamentals of Data Representation
Fundamentals of Computer Systems
Fundamentals of Computer Organisation and Architecture
Fundamentals of Communication and Networking
Consequences of Uses of Computing
Systematic Approach to Problem Solving
Fundamentals of Databases
Big Data
Big Data
Distributed Processing and Functional Programming
- 3 things to know
- Paper 2
Overview
Recall questions on distributing work across machines, immutable data, statelessness, higher-order functions, and why this style suits code that runs in many places at once.
What you need to know
Answer each one before you reveal it.
What is an immutable data structure, and why does it help across machines?
What is a higher-order function?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What has to change about processing once data no longer fits on a single server?
Model answer
The processing has to be distributed across more than one machine. Since no single server can hold the data, no single server can work through it either, so the dataset is divided into portions held on different machines and each machine processes the portion it holds. The results are then combined. This removes the single-machine limit, but it introduces the problem of writing code that stays correct while running in many places at once.
- 2
What is distributed processing?
Model answer
It is carrying out one computation across several machines working at the same time, each on part of the problem, with their results combined into a single answer. The machines are separate computers connected by a network rather than processors sharing one memory. It is what makes very large datasets tractable, because capacity is increased by adding more machines rather than by finding a bigger one, but the coordination between them has to be managed.
- 3
Why is functional programming put forward as a solution for distributed processing?
Model answer
Because correct, efficient code for many machines at once becomes far easier to write in that style. Its restrictions — data that cannot be modified, functions that keep nothing between calls — remove most of the situations where machines running simultaneously interfere with one another. What is a discipline the programmer must impose by hand in other styles is simply built into the language here, so whole categories of distribution error cannot arise.
- 4
What is an immutable data structure?
Model answer
One that cannot be altered once it has been created. Any operation that appears to change it in fact produces a new structure holding the modified values, leaving the original exactly as it was. A function that adds an item to a list returns a new list containing that item rather than modifying the list it was given, so anything else still holding the original sees precisely what it saw before.
- 5
Why does immutability help when the same data is held on many machines?
Model answer
Because a value that can never change is safe to copy freely. Copies cannot fall out of step with one another, so there is no need to coordinate updates between machines or to lock data while one of them writes. Two machines reading the same value at the same time cannot interfere, and a copy sent across the network is guaranteed to still be accurate when it arrives, since nothing at the far end can have modified it.
- 6
What is meant by statelessness?
Model answer
It means a function's result depends only on the arguments it is given. It keeps no stored information between calls and changes nothing outside itself, so it has no memory of what it did previously and no effect on anything else. Everything it needs arrives as input, and everything it produces leaves as its return value — there is no hidden channel through which one call can influence the next.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Big Data, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.