Modern organisations produce huge amounts of data. The cloud gives the storage and the computing power to keep and to analyse it, without buying a large cluster.

Big Data

Big data is data so large, fast or varied that normal tools cannot handle it. It is described by the Vs: volume, the amount, velocity, the speed at which it arrives, variety, the many forms, such as text, images and logs, and veracity, its quality. It comes from social media, sensors, logs, transactions and more. Big data is stored in a data lake, which keeps raw data of all kinds cheaply, often in object storage such as S3, or in a data warehouse, which holds structured data for fast queries, such as Amazon Redshift, Google BigQuery and Snowflake.

Definition: Big data. Data sets so large, fast-growing or varied that they cannot be stored and processed with traditional tools, and which need distributed systems for analysis.

Why the Cloud Suits Big Data

The cloud gives elastic computing, so that a large cluster can be started for a job and released after it, cheap and almost unlimited storage, managed services that remove the work of running clusters, and global reach. The user pays only for the analysis that is done.

Processing Models and Tools

Batch processing handles large stored data sets at one time, using Hadoop MapReduce or Apache Spark. In MapReduce, a map step turns the data into key and value pairs, and a reduce step combines the values of each key, as in a word count. Stream processing handles data as it arrives, using Apache Kafka, Apache Flink or Spark Streaming, for example to find fraud as it happens. Managed services include Amazon EMR, Google Dataproc, Azure HDInsight, AWS Glue for ETL, and Amazon Kinesis. ETL, meaning extract, transform and load, moves data into the warehouse.

Analytics and AI in the Cloud

Descriptive analytics tells what has happened, diagnostic why, predictive what will happen, and prescriptive what to do. Cloud platforms give machine learning services, such as Amazon SageMaker, Azure Machine Learning and Google Vertex AI, and ready-made services for vision, speech and language. Business intelligence tools such as Power BI, Tableau and Looker draw dashboards.

Table 4.2: Big data tools in the cloud

Need Open-source tool Cloud service
Batch processing Hadoop, Spark Amazon EMR, Dataproc
Streaming Kafka, Flink Kinesis, Dataflow
Warehouse Hive Redshift, BigQuery
Machine learning TensorFlow SageMaker, Vertex AI

Example 4.2: Word count by MapReduce

Problem: Show the map and reduce steps of a word count for the text "cloud is big cloud is fast".

Solution:

  1. Map gives the pairs: (cloud,1), (is,1), (big,1), (cloud,1), (is,1), (fast,1).
  2. Group by key: cloud: [1,1], is: [1,1], big: [1], fast: [1].
  3. Reduce adds the values: cloud 2, is 2, big 1, fast 1.

Result: The counts are cloud 2, is 2, big 1, fast 1.

from collections import Counter
text = "cloud is big cloud is fast"
pairs = [(w, 1) for w in text.split()]
counts = Counter()
for k, v in pairs:
    counts[k] += v
print(dict(counts))

Output

{'cloud': 2, 'is': 2, 'big': 1, 'fast': 1}

Common mistakes

  • Using a small single machine for data that needs a distributed system.
  • Keeping all raw data in the expensive warehouse instead of a data lake.
  • Moving large data sets between regions without counting the transfer cost.

Key takeaways

  • Big data is described by volume, velocity, variety and veracity.
  • A data lake stores raw data, and a warehouse stores structured data for queries.
  • MapReduce has a map step and a reduce step.
  • The cloud gives elastic computing for big data jobs.

Practice questions

  1. What are the Vs of big data?
  2. Distinguish a data lake and a data warehouse.
  3. What is stream processing?

Answers to the practice questions

  1. Volume, velocity, variety and veracity.
  2. A data lake holds raw data of all kinds, a warehouse holds structured data for fast queries.
  3. Processing data as it arrives, instead of in large stored batches.

Sources

  • Official BCA syllabus Cloud Computing, course code 25BCA405DS03, Unit IV