AWS Sales Data Pipeline

completed

30-second summary

Architecture diagram · AWS Sales Data Pipeline
Architecture diagram · Click to enlarge ↗

An event-driven AWS pipeline that validates, cleans and transforms retail sales CSV files uploaded to S3, separates bad records, and tracks file metadata in DynamoDB; infrastructure is defined with AWS CDK.

Raw CSV files need schema validation, cleaning and splitting of valid and invalid records before they can feed metrics such as daily revenue, top products, payment success rate and orders per customer.

Author of a personal project.

Verified — AWS Sales Data Pipeline has a public GitHub repository owned by Duy. Existence of the public repository

Context and problem

Retail sales data arrives as CSV files; the project automates processing from upload to analytics-ready output. A personal project listed in Duy's CV; the sales data is fictional sample data, not from a real company.

Raw CSV files need schema validation, cleaning and splitting of valid and invalid records before they can feed metrics such as daily revenue, top products, payment success rate and orders per customer.

Individual role

Author of a personal project.

Used AWS CDK to deploy S3, Lambda and DynamoDB; configured an S3 event source so that new objects in the raw bucket invoke the Lambda function directly; wrote Python and Pandas scripts to clean, transform and partition CSV data; wrote Pytest tests for the data logic (per Duy's CV and the README).

Personal project; no team.

Constraints

Time constraints left alerting, retries, idempotency and BI integration unimplemented.

Architecture

CSV upload to an S3 raw bucket; the S3 object-created event invokes a Lambda function directly (an S3 event source defined in AWS CDK, with no service in between), and Lambda validates the schema, cleans data and splits valid from invalid records. Clean data goes to a processed bucket, invalid data to an error bucket and metadata to DynamoDB; logs go to CloudWatch; infrastructure is in AWS CDK. Output storage is partitioned.

Decisions and alternatives

Lambda for simple, scalable processing; S3 for storage and as the event source that triggers Lambda directly; three S3 buckets (raw, processed, error) for a clear data flow; DynamoDB for fast, simple file-status tracking. Least-privilege IAM scoped to the required resources and blocked public access on S3.

For processing, EC2 was considered but needs server management, and ECS is more complex; Lambda is easy to use and scales automatically (source: the repository's architecture decision notes).

Implementation

Repository layout: infrastructure, src, tests, evidence and docs, with an app entry point and a local runner. Deployed with cdk bootstrap and cdk deploy; torn down with cdk destroy.

Validation

Five Pytest cases: happy path, missing data, duplicate records, invalid values and error handling. The repository holds execution screenshots for pytest, deploy, processed data, error handling, DynamoDB metadata, business metrics and CloudWatch logs.

Results and evidence

An example run on the sample file produced 99 clean records and 4 error records with status COMPLETED (sample data, not a performance metric). Bad records are separated into the error bucket and logs are available in CloudWatch. Throughput, latency and cost were not measured.

Verified — AWS Sales Data Pipeline has a public GitHub repository owned by Duy. Existence of the public repository

Limits and lessons — If I did it again

Known gaps to address next: CloudWatch alarm and SNS alerting, a retry mechanism, idempotency for duplicate processing, and Athena or QuickSight integration.

Public links

Source code