levo

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.

Your recallNot started
Key term

What is statelessness, and why does it matter for distributing work?

Key term

What is an immutable data structure, and why does it help across machines?

Key term

What is a higher-order function?

Questions from this subtopic

Each one with the model answer underneath.

  1. 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. 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. 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. 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. 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. 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.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Fundamentals of Programming
Fundamentals of Data Structures
Fundamentals of Algorithms
Theory of Computation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A driver is .
softwarehardwarestorage

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AThe integer 5 is 0101.
B0.75 is 1/2 + 1/4.
CThe fraction bits are 1100.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

Head means the first single element of a non-empty list.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

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.