Big Data and Functional Programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is Big Data?

A

Big data is data that is collected on such a large scale that it cannot be easily analysed.

Healthcare – patients, medical records, clinical data.

Google – 24 petabytes of data per day 24 x 10^15.

Amazon – vast amounts of sales data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe volume as a characteristic of Big Data.

A

Big Data is too big to be handled by one server.
In the UK, there were 3.5billion card purchases in the first quarter of 2016.
Google processes more than three billion search queries every day and saves every single one.
Tesco collects 70 million refrigerator-related data points from its units and analyses them to keep better tabs on performance, to gauge when machines might need to be serviced and cut down on energy use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe velocity as a characteristic of Big Data.

A

Continuous streams of data being collected in real time, that may also require a response within milliseconds.
Smartphones, sensor networks, and CCTV all create large volumes of data, continuously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe variety as a characteristic of Big Data.

A

Big data comes in many forms: structured, unstructured, text, audio, and image.
60 million new photos are uploaded daily on Instagram.
48 hours of videos are uploaded every minute on YouTube.
There are 3billion views of YouTube videos every day.
Spotify has 100 million users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why are relational databases not suited to Big Data?

A

Volume – they don’t scale well to large datasets.
Variety – they don’t understand unstructured data (Links between data items are too complex for traditional database relationships to represent).
Velocity – relational databases are designed for steady data retention, rather than rapid growth.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why is functional programming suitable for Big Data?

A

Processing Big Data often needs to be distributed across multiple servers.
Useful properties of functional programming for Big Data:
- Immutable data structures, which cannot be accidentally altered in a function.
- Statelessness, so the program’s behaviour does not depend on the order in which functions are called.
- Higher-order functions, such as map and fold allow functions to be input as arguments.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the higher-order function ‘map’ do?

A

Applies a function to each element of a list and returns a new list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the higher-order function ‘fold’/’reduce’ do?

A

Applies a function recursively over a list and returns a value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why are traditional programming paradigms unsuitable for Big Data?

A

When data is stored over multiple servers, as is the case with big data, the processing associated with using the data must also be split across multiple machines. This would be incredibly difficult with conventional programming paradigms as the machines would all have to be synchronised to ensure that no data is overwritten or otherwise damaged.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is the fact-based model suitable for representing Big Data?

A

Because big data doesn’t conform to the row and column format typically used to represent data, it must be represented differently. One way of representing big data is with the fact-based model.
In the fact-based model, each piece of information is stored as a fact. Facts are immutable and can’t be overwritten.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How are timestamps used in fact-based models?

A

Stored with each fact is a timestamp, indicating the date and time at which a piece of information was recorded. Seeing as facts are never deleted or overwritten, multiple different values could be held for the same attribute. This is where timestamps come in, allowing a computer to discern which value is the most recent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the benefits of facts in fact-based models being immutable?

A

Thanks to facts being immutable (and therefore not overwritable), using the fact-based model for storing big data reduces the risk of accidentally losing data due to human error.
Moreover, the model does away with an index for the data and instead simply appends new data to the dataset as it is created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How are graph schema used to represent Big Data?

A

Graph schema uses graphs consisting of nodes and edges to graphically represent the structure of a dataset. Nodes in a graph represent entities and can contain the properties of the entity.
Edges are used to represent relationships between entities and are labelled with a brief description of the relationship.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Are timestamps included in graph schema?

A

Timestamps are rarely included in graph schema diagrams, instead you should assume that each node contains the most recent information available.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are functional languages in programming?

A

Functional languages are declarative which means they are concerned with what
needs to be performed as opposed to how it should be performed as is the case
with procedural imperative languages.
Functional languages rely on recursion (the function calling itself) and not
iteration.
Functional programs are shorter than codes written in procedural languages. This
results in code that is likely to contain fewer errors because there are fewer lines
of source code and opportunities to introduce errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Properties of functional programs

A

Immutability - Immutable objects cannot have their values changed. More strictly when changing the value of an object, we copy to another location in memory and reference that value.
No side effects - Functional programs have no side effects. Side effects occur when a function changes the values outside its own scope.
Statelessness - Given the same input to a function you will always have the same output. The local state is independent of the global state.
Therefore functions can be called in any order without affecting the outcome.

17
Q

What is a domain in reference to functions?

A

The set of values from which the input is taken.

18
Q

What is a codomain in reference to functions?

A

The set of values which can be output.

19
Q

First class objects

A

In procedural programming Integers, characters and other data types are
examples of first-class objects. This means they can be assigned to variables, passed as arguments to other functions, returned from other functions, and stored in data structures.
In functional programming, functions can also be used as first-class objects.

20
Q

Higher-order functions

A

Higher-order functions are function that can take a function as an argument
and/or return a function as a result.