Unit 3 Cloud Pipelines Notes

Unit 3 — S3 as a Data Inbox | DataSoSi
Cloud Data Pipelines · Unit 3 of 12 · Cloud Storage

S3 as a Data Inbox

Learn how Amazon S3 acts as the front door of a data pipeline — where files land, how they are organized, and how the rest of the system knows they have arrived.

Think about your email inbox. Every message arrives in one place, automatically. You do not need to go and collect it — it just lands there. Amazon S3 works exactly the same way for data files. Sales reports, HR exports, bank transactions — they all arrive in one organized cloud location, ready for the pipeline to act on them.
4 Sections
No Coding Required
Hands-On Setup
1 2 3 4 5 6 7 8 9 10 11 12

Learning Objectives

  • Explain what Amazon S3 is and why businesses use cloud storage instead of local drives or email
  • Describe what an S3 bucket is and how folders inside it organize pipeline data
  • Create your own S3 bucket, build a folder structure, and upload a real file
  • Explain why separating raw, cleaned, and archived data matters in a real business workflow
  • Trace how a file uploaded to S3 connects to Lambda and Databricks to start the pipeline automatically
Four sections. Select individually or expand all.

Amazon S3 stands for Simple Storage Service. It is a cloud-based storage system — meaning your files live on Amazon’s servers, accessible from anywhere in the world, rather than on a physical hard drive sitting in your office.

Everyday Analogy — The Post Office Box

Imagine your business rents a post office box. Every day, suppliers, partners, and customers drop packages into it. You do not need to be there when the packages arrive — they accumulate safely, and you collect them when ready. Amazon S3 is that post office box for data. Files arrive from any source, are stored securely, and wait there until the pipeline is ready to process them.

What Types of Files Does S3 Store?

S3 is format-agnostic — it can store any type of file. In data pipelines, the most common arrivals are:

Structured Data
CSV files, Excel spreadsheets, and TSV files containing rows and columns of business data — sales figures, payroll records, inventory counts, transaction logs.
Reports and Documents
PDF reports, Word documents, and summary files that organizations generate daily, weekly, or monthly and need to store reliably for audit or reference purposes.
System Logs
Application event logs, error records, and activity trails produced automatically by software systems. These are often the input for fraud detection and operational monitoring pipelines.
Why Not Just Use a Shared Drive or Email?
MethodThe Problem at ScaleHow S3 Solves It
Email attachmentsFiles get buried in inboxes. There is no reliable trigger when a file arrives. Version control is impossible.S3 stores files in a defined location. Lambda can detect every single upload automatically — nothing gets missed.
Shared network driveAccess is limited to people inside the office network. No automatic triggers exist. Storage does not scale easily.S3 is accessible from anywhere. It scales to billions of files. Every upload can trigger a downstream workflow.
Local hard driveIf the computer fails, the data is gone. Only one person can access it at a time. No automation is possible.S3 is redundant — Amazon stores copies across multiple locations. Many systems can read the same file simultaneously.
The Key Insight

S3 is not just storage — it is the entry point to automation. The moment a file lands in S3, the pipeline can respond. This is what makes cloud storage fundamentally different from a shared folder on a server: it is designed to be the trigger for action, not just a passive place to keep files.

Everyday Analogy — The Filing Cabinet

Picture a large filing cabinet in an office. The cabinet itself is the bucket — it is the main container that holds everything. Inside the cabinet are labelled drawers: one for incoming documents, one for processed records, one for archived files. Each drawer has a clear purpose so that anyone who opens the cabinet knows exactly where to look. An S3 bucket works identically — the bucket is the cabinet, and the folders are the labelled drawers.

What Is an S3 Bucket?

A bucket is the top-level container in S3. Every file you store in S3 lives inside a bucket. Each bucket has a globally unique name — no two buckets anywhere in the world can share the same name. Think of it like a website domain: only one person can own datasosi-pipeline-demo at a time.

The Standard Pipeline Folder Structure

Inside a bucket, folders organize files by their stage in the pipeline. The industry-standard structure used in real business pipelines looks like this:

📦 datasosi-pipeline-demo/
📁 raw/ — original files, exactly as they arrived
📄 sales_data.csv
📄 hr_export_march.csv
📁 cleaned/ — processed outputs from Databricks
📄 sales_data_clean.csv
📁 archive/ — completed files no longer in active use
📄 sales_data_jan.csv
Why Does Folder Structure Matter?
Clarity
Anyone who opens the bucket immediately understands where things are. The raw folder contains unprocessed files. The cleaned folder contains pipeline outputs. There is no guessing, no searching, no confusion about which version of a file is the authoritative one.
Automation
Lambda triggers can be scoped to specific folders. You can configure Lambda to watch only the raw/ folder — so it fires when a new input file arrives, not when the pipeline writes its own output to the cleaned/ folder. Without clear structure, triggers fire at the wrong moments.
Safety
Keeping raw files untouched in their own folder means you always have the original. If the cleaning logic has an error, you can rerun the pipeline from the raw input without data loss. Overwriting originals is one of the most common and costly mistakes in data workflows.
Never Overwrite Raw Files

The raw folder is read-only in a well-designed pipeline. Databricks reads from it, but never writes back to it. Outputs always go to the cleaned or output folder. Think of the raw folder as the original receipt — you might make a photocopy and annotate it, but you never write on the original.

This is a hands-on unit — everything is done through the AWS console, which is a visual interface, not a coding environment. Follow these steps in order. Each one builds on the previous.

Part 1 — Open Amazon S3
1
Log into AWS
Go to aws.amazon.com and sign in. If you do not have an account, you set one up in Unit 1. Once inside, you land on the AWS Management Console — the central dashboard for all AWS services.
2
Find S3
In the search bar at the top of the console, type S3 and click the S3 result. This opens the S3 dashboard, which shows all the buckets in your account. Right now it will be empty — that is expected.
Part 2 — Create a Bucket
1
Click “Create bucket”
The orange button in the top right of the S3 dashboard. This opens the bucket creation form.
2
Name your bucket
Enter a name following this format: datasosi-pipeline-demo (replace “datasosi” with something unique to you if needed). Bucket names must be globally unique, lowercase, and contain no spaces. Hyphens are fine. If the name is already taken, AWS will tell you — just add a number or variation.
3
Leave all other settings as default
The default settings are appropriate for this course. Do not enable versioning, logging, or encryption unless specifically instructed in a later unit. Scroll to the bottom and click Create bucket.
What Just Happened

You just rented a filing cabinet in Amazon’s warehouse. It has your unique label on it. Amazon handles the physical storage, security, and maintenance. You manage what goes inside it. This is the core value of cloud infrastructure — you get enterprise-grade storage without buying or managing any hardware.

Part 3 — Create Folders Inside the Bucket
1
Open your new bucket
Click the bucket name in the S3 dashboard. You will see an empty bucket — no files, no folders yet.
2
Create the “raw” folder
Click Create folder. Name it raw (lowercase). Leave all other settings as default and click Create folder. This folder will hold all incoming files — the starting point of every pipeline run.
3
Create the “cleaned” folder
Repeat the same steps. Name this folder cleaned. This is where Databricks will write its processed output in later units.
4
Create the “archive” folder
Create a third folder named archive. This holds completed files that are no longer active in the current pipeline run but must be retained for audit, compliance, or historical reference.
Part 4 — Upload a File
1
Open the raw/ folder
Click the raw/ folder inside your bucket. This is where all incoming files land.
2
Upload a CSV file
Click Upload, then Add files. Select any CSV or Excel file from your computer — a sample file named sales_data.csv works well. Click Upload to confirm. Within seconds the file appears in the folder.
3
Inspect the uploaded file
Click on the file name. You will see its storage path, upload timestamp, file size, and storage class. You have just seen what the pipeline sees when it receives a new file — a location, a name, and a timestamp.
Optional — Light Code Activity in Databricks

Open your Databricks notebook and run the following cell. This simulates a pipeline receiving notification that a new file has arrived in S3:

Python Simulating File Detection
file_name = “sales_data.csv”

print(“New file ready for processing:”, file_name)
Expected Output
New file ready for processing: sales_data.csv
What This Represents

file_name = “sales_data.csv” stores the name of the arriving file in a variable. In a real automated pipeline, this value would not be typed manually — Lambda would pass the actual file name to Databricks the moment the upload was detected. For now, you are simulating that handoff: a file has arrived, Databricks knows its name, and processing is ready to begin. You are not reading the file yet — that comes in Unit 5.

S3 is not just a storage service — it is the connective tissue of the pipeline. Every other component either deposits files into it, reads files from it, or watches it for activity. Understanding S3 is understanding how data enters the automated world.

CSV
Business Uploads a File
A sales file, HR export, or transaction log is uploaded — either manually or by an automated system — into the raw/ folder of the S3 bucket.
↓
S3
S3 Stores the File
The file is stored durably in the cloud. S3 logs the upload event — file name, location, timestamp — and makes that event available to other AWS services.
↓
λ
Lambda Detects the Upload
Lambda is watching the raw/ folder. The moment a new file appears, the trigger fires and Lambda sends a signal to Databricks to begin processing. No human action required.
↓
DB
Databricks Processes the File
Databricks reads the raw file from S3, applies cleaning and transformation rules, and writes the cleaned output back to the cleaned/ folder in the same bucket.
↓
OUT
Clean Data Ready for Use
The processed file sits in the cleaned/ folder — or in a Delta table — ready for dashboards, reports, and analysts. The entire sequence ran without anyone clicking a button.
Everyday Analogy — The Airport Baggage Belt

S3 is like the baggage claim belt at an airport. Bags (files) arrive from many different flights (sources) and land in one organized place. Sensors detect each bag as it arrives (Lambda trigger). Handlers collect the right bags and route them to the correct destination (Databricks processing). The traveller at the end just picks up their bag — clean, ready, no manual sorting required.

What You Have Built So Far

By completing this unit, you have created the first physical component of your pipeline: a real S3 bucket with a proper folder structure, containing an actual file. In Unit 5, Databricks will reach into this bucket and read that file. Every unit from here forward builds on the foundation you have just put in place.

Knowledge Check

Five questions covering the key concepts from Unit 3. Select the best answer for each question.

1. What is an Amazon S3 bucket?

2. Why should raw files never be overwritten in a pipeline?

3. In the standard pipeline folder structure, what is the purpose of the archive/ folder?

4. Why is cloud storage like S3 preferable to emailing files for a business data pipeline?

5. What does the optional Databricks code cell in this unit simulate?

Unit 3 Summary

What you covered in this unit

Amazon S3

A cloud storage service that acts as the entry point of the pipeline — a secure, scalable inbox where all incoming data files land.

Buckets & Folders

A bucket is the top-level container. Folders inside it — raw/, cleaned/, archive/ — organize files by their stage in the pipeline workflow.

Raw Folder Rule

Raw files are never overwritten. Outputs always go to cleaned/ or archive/. Preserving the original means any error can be corrected by rerunning.

S3 as a Trigger

When a file lands in S3, Lambda can detect the upload and start Databricks automatically. S3 is not just storage — it is the event that starts the pipeline.

Amazon S3 S3 Bucket raw/ folder cleaned/ folder archive/ folder Cloud Storage Upload Event Lambda Trigger Free Tier Global Unique Name