No history yet

Data Engineering

The Foundation of ML Data

Before a machine learning model can learn anything, it needs data. Lots of it. But you can't just dump raw data from different sources into a folder and hope for the best. You need a centralized, organized, and scalable place to store it. This is where data repositories come in.

In the AWS cloud, the primary data repository for machine learning is Amazon S3 (Simple Storage Service). Think of S3 as an infinitely large storage locker for the internet. Instead of storing files in a traditional folder structure, S3 uses a system called object storage.

object storage

noun

A method for storing data as distinct units, called objects. Each object includes the data itself, a variable amount of metadata, and a globally unique identifier. This structure allows for massive scalability and durability.

In S3, you organize your objects into containers called "buckets." Each bucket must have a unique name across the entire AWS system. You might create one bucket for raw, unprocessed data and another for clean, transformed data that's ready for your ML models. S3 is designed to be highly durable and available, ensuring your data is safe and accessible when you need it.

Getting Data into AWS

Once you have your repository, you need to get data into it. This process is called data ingestion. The right tool for the job depends on the type and volume of your data.

For real-time data that's constantly being generated, like clicks on a website or readings from IoT sensors, you need a streaming solution. AWS Kinesis is perfect for this. It acts like a massive conveyor belt, capturing and processing streams of data in real time and feeding them into your S3 bucket.

Streaming data is like a river; it flows continuously. Batch data is like a lake; you collect it all at once.

What if you have huge amounts of existing data, maybe terabytes or even petabytes, sitting in your own data center? Uploading that over the internet could take weeks or months. For these large-scale, one-time transfers, AWS offers physical devices like the AWS Snowball. It's a rugged, suitcase-sized appliance. You load your data onto it, ship it to AWS, and they upload it directly into your S3 bucket. It's the digital equivalent of using a moving truck instead of mailing boxes one by one.

Lesson image

Cleaning and Preparing Data

Data in its raw form is often messy. It can have missing values, incorrect formats, or irrelevant information. Feeding this messy data into a machine learning model is like trying to bake a cake with spoiled ingredients. You need to clean and prepare it first.

This is where the ETL process comes in. ETL stands for Extract, Transform, and Load. It’s a standard procedure for preparing data for analysis.

Data engineering has emerged as a vital discipline addressing these challenges by providing robust platforms for effective data management, processing, and utilization.

AWS Glue is a fully managed ETL service that automates much of this work. Here’s how it works:

  • Extract: Glue can automatically crawl your data sources (like your raw data bucket in S3) to discover its structure and format. It creates a metadata repository called the AWS Glue Data Catalog, which acts like a library card catalog for your data.

  • Transform: Glue generates code (in Python or Scala) that you can customize to perform transformations. This is where you clean the data, join it with other datasets, and reshape it into a format suitable for your ML model.

  • Load: The final, cleaned-up data is loaded into its destination, which is typically another S3 bucket. This clean data is now ready for the next stage: model training.

Building the Data Pipeline

Putting these pieces together creates a data pipeline: an automated workflow that ingests, transforms, and stores data. A typical pipeline for machine learning on AWS might look like this:

This pipeline takes raw data from different sources, centralizes it, cleans it, and prepares it for machine learning, all in an automated, repeatable fashion. Building a robust data engineering foundation like this is the critical first step to any successful machine learning project.

Quiz Questions 1/5

What is the primary data repository service in AWS used for storing large datasets for machine learning?

Quiz Questions 2/5

A company needs to migrate 100 terabytes of historical data from its on-premises data center to AWS as quickly as possible. Uploading over their internet connection would take weeks. Which AWS service is designed for this specific scenario?