Cloud Cost Optimization
Real-time event capture rose from 40% to 100%, and monthly cost fell from $230 to under $2 per month for one workload.
My Role
I implemented and maintained our team's copy, transformation, and recovery workflow. The source team owned snapshot publication.
The Problem
The original pipeline ran as a scheduled batch job that processed snapshots in bulk. It captured only 40% of events in real-time. The batch workload cost approximately $230 per month. The source published snapshots every 1–3 minutes. The pipeline needed to recover failed copies and make the processed data available for reporting without waiting for the next batch run.
How It Worked
Simplified reconstruction of a pipeline I implemented and maintainedLoading diagram…
This diagram reconstructs a pipeline migration I worked on at Amazon. Another team published raw JSON snapshots to its S3 bucket every 1–3 minutes. S3 notifications went through SNS to a copy Lambda, which transferred snapshots into our team's landing bucket. Landing-bucket object creation triggered a processing Lambda that parsed, cleaned, and formatted the data into partitioned Parquet in our production bucket. Glue catalog metadata supported downstream querying, including Redshift external tables, with IAM and S3 policies controlling access. Lake Formation cross-account sharing provided data to other teams in Andes. The replacement captured 100% of events in real-time (up from 40%) and reduced that workload's monthly cost from $230 to under $2. The snapshot publication cadence (1–3 minutes) is separate from downstream processing latency, which was event-driven and near real-time. The 40% and 100% capture figures and the $230 and under-$2 cost figures are my own account of one workload; I have not published the underlying measurements.
Evidence status: This reconstruction is based on my own account of systems I built and maintained. The historical source code and configuration are not available for publication, so these details are owner-confirmed, not independently verified.
Design Decisions
Three distinct timestamps are tracked: snapshot time (when the source captured the operational state), ingestion time (when the snapshot was published/retrieved into the pipeline), and reporting availability (when processed data became queryable). The partition hierarchy uses network type, warehouse ID, ingestion date, and hour. Hourly partitioning is tied to workload volume and query patterns. Partitioning the data in S3 made data sourcing faster, because a query reads only the partitions it needs. Python scripts, ETL jobs, DataNet transforms and Lambda functions all used the partitioned data. My team shared a Python library I wrote for S3, Glue, Athena and Redshift access. It wrote the partition paths and repaired tables automatically. AWS data helpers is my public rebuild of it.
A Glue crawler ran daily for catalog discovery, and my Python code also started crawler runs through boto3 to register new partitions. Processing of incoming data was event-driven and did not wait for the crawler. Redshift supported both external queries and native-table workflows. IAM and S3 policies controlled access. Lake Formation cross-account sharing provided data to other teams in Andes. Internal tables were published for other teams with approximately 40 minutes of lag, making that path suitable for historical consumption.
Glue Data Catalog provides schema and partition metadata. It is not a service through which Parquet bytes pass. S3 stores data, Glue stores metadata, and Redshift executes queries. Access control used IAM and S3 policies. Lake Formation cross-account sharing provided data to other teams in Andes.
Results
- Real-time event capture: 40% → 100%
- Monthly cost for one measured workload: $230 → under $2
- Event-driven processing with near real-time downstream availability
The under-$2 figure covers one workload. It does not include the broader source estate.
AWS documentation for these parts: Redshift Spectrum external tables (tables defined in the Glue Data Catalog), partitioned external tables (partition elimination improves query performance), Glue crawlers (register tables and partitions), and Lake Formation data sharing (share Data Catalog and S3 data with other accounts).
Working through a similar problem?
Discuss a project →