impera Open Impera

A levels Computer Science · Networks and databases

Big data

1What is big data?

Big data is data so large or complex that it cannot be stored and processed by traditional relational databases on one computer. It is often described by three Vs:

VMeaningExample
volumefar too much data for one serverbillions of social media posts
velocitydata arrives very fast and must be processed quickly, often in real timesensor readings every millisecond
varietymany types and formats, much of it unstructured (no fixed fields)text, images, video, GPS traces

Unstructured data does not fit neatly into rows and columns, which is why relational databases struggle.

Check yourself

What does "velocity" mean in big data?

  • Data arrives very quickly and needs processing fast

  • The data is accurate and trustworthy

  • The data comes in many different formats

  • The data is very large in total size

Show the answer

Data arrives very quickly and needs processing fast

Speed.

2Distributed processing

Big data is too large for one machine, so it is spread across many servers (a cluster) that work in parallel.

  • Data is split into chunks, and each server processes its own chunk.
  • Copies of each chunk are kept on different servers, so the system keeps working if one fails.
  • Adding more servers increases capacity: this is scaling out.

Programs for distributed processing are hard to write with shared changing variables, because servers would interfere with each other. Functional programming helps: pure functions with immutable data can run on any server in any order and still give the right answer.

Check yourself

Why does functional programming suit distributed processing?

  • Pure functions with no side effects can run on many servers at once without interfering

  • It uses more memory, so large data sets fit more easily on each server

  • It is always faster to write than other kinds of programs

  • It needs only one server, so data does not have to be shared between servers

Show the answer

Pure functions with no side effects can run on many servers at once without interfering

No shared state.

3MapReduce

MapReduce is a way of processing big data across a cluster, built from the functional ideas of map and reduce (fold).

MapReduce counting words. Map makes (word, 1) pairs, shuffle groups them by word, and reduce adds up each group.

Worked example

Counting words

  1. Split: the text is divided between servers.
  2. Map: each server turns its text into pairs (word, 1), for example ("data", 1), ("big", 1), ("data", 1).
  3. Shuffle: pairs with the same word are sent to the same server.
  4. Reduce: each server adds up the counts for its words: ("data", 2), ("big", 1).
  5. The final counts are combined into one result.
Check yourself

In MapReduce word counting, what does the map step produce?

  • A sorted list of servers

  • A relational table

  • Pairs of (word, 1) for every word

  • The final total for each word

Show the answer

Pairs of (word, 1) for every word

Key-value pairs.

4Fact-based models and graph schemas

In a fact-based model, each piece of data is stored as a separate, immutable fact with a timestamp: for example, "user 1042 moved to Leeds on 3 March". Facts are never changed or deleted; new facts are added instead.

Benefits: the full history is kept, mistakes can be corrected by adding newer facts, and data can be queried as it was at any time.

A graph schema shows how facts relate:

  • nodes are entities, such as people or places;
  • edges are relationships, such as "follows" or "lives in";
  • properties store details, such as a name or a date.

Graph databases are very good at relationship questions, like "friends of friends" or "who bought what others bought".

Check yourself

Why are facts in a fact-based model immutable?

  • To save storage space by keeping only the latest value

  • So the full history is kept and errors are fixed by adding new facts

  • Because they cannot be read once they have been stored

  • Because timestamps cannot be changed after they are added

Show the answer

So the full history is kept and errors are fixed by adding new facts

Never overwrite.

5Uses of big data

AreaUse
retailrecommendations ("customers who bought this also bought ...")
bankingspotting unusual card payments to detect fraud
healthfinding patterns in patient data and tracking outbreaks
transportlive traffic data for route planning
scienceanalysing results from telescopes and particle colliders
machine learningtraining models on huge data sets

Big data analysis often uses machine learning, where programs find patterns in data rather than following hand-written rules.

Check yourself

How can a bank use big data to detect fraud?

  • By deleting old transactions that are no longer needed

  • By spotting card payments that do not fit a customer's normal pattern

  • By printing monthly statements for every customer

  • By checking each payment by hand at the end of the day

Show the answer

By spotting card payments that do not fit a customer's normal pattern

Unusual patterns.

6Issues with big data

  • Privacy: data may be collected without people fully understanding how it is used; combining data sets can identify individuals even when names are removed.
  • Bias: if the data reflects past unfairness, decisions based on it (for example in hiring or lending) may repeat that unfairness.
  • Security: huge stores of personal data are attractive targets for attackers.
  • Accuracy: errors in data, or patterns found by chance, can lead to wrong conclusions. Correlation does not prove causation.
  • Cost and energy: storing and processing big data needs large data centres that use a lot of electricity.

Laws such as data protection law control how personal data may be collected, used and kept.

Check yourself

Why can removing names from a data set fail to protect privacy?

  • Names are needed to store data in a database

  • Big data never contains any personal data

  • Removing names deletes the rest of the data

  • Combining it with other data can still identify individuals

Show the answer

Combining it with other data can still identify individuals

Re-identification.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera