Cloud Big Data Services

AWS, Azure, and GCP solutions for petabyte-scale data processing

Why Cloud for Big Data?

Building and maintaining your own Hadoop cluster for 100 nodes costs millions upfront and requires a dedicated team of DevOps engineers. Cloud providers offer fully managed big data services where you pay only for what you use, spin up a 1000-node cluster for 2 hours, run your job, and shut it down. This lesson compares AWS, Azure, and Google Cloud's big data offerings, showing when to use each service and how they differ in pricing, performance, and features.

Cloud vs On-Premise Big Data

โ˜๏ธ Cloud (Managed Services)

  • No upfront cost, Pay per hour/query
  • Elastic scaling, Scale from 10 to 1000 nodes instantly
  • Zero maintenance, Provider handles patches, upgrades
  • Fast deployment, Start in minutes, not months
  • Global reach, Deploy in 20+ regions worldwide
Total Cost of Ownership: 40-60% lower

๐Ÿข On-Premise (Self-Managed)

  • High upfront cost, $2-5M for 100-node cluster
  • Fixed capacity, Can't scale up for peak loads
  • Operations team, Need 5-10 dedicated engineers
  • Slow provisioning, 3-6 months to deploy
  • Single location, Limited disaster recovery
Total Cost: $5-10M over 3 years
๐Ÿ’ก Rule of Thumb: Cloud makes sense for 90% of companies. Only consider on-premise if you have: (1) Strict regulatory requirements, (2) Predictable 24/7 workloads at massive scale, or (3) Existing data center infrastructure and expertise.

Big Data Service Categories

All three cloud providers offer similar categories of services. Understanding these categories helps you choose the right tool for each job.

๐Ÿ’พ Storage

Store petabytes of raw data

  • Object storage (S3, Blob, GCS)
  • Data lakes
  • Archive storage
โš™๏ธ Processing

Transform & analyze data

  • Hadoop/Spark clusters
  • Serverless compute
  • Stream processing
๐Ÿ“Š Analytics

Query & visualize insights

  • Data warehouses
  • SQL query engines
  • BI dashboards
๐Ÿ”„ Data Movement

Ingest & transfer data

  • ETL pipelines
  • Data migration
  • Real-time streaming
๐Ÿค– ML & AI

Train & deploy models

  • ML platforms
  • AutoML services
  • Pre-trained models
๐Ÿ” Search & Logs

Full-text search & monitoring

  • Elasticsearch
  • Log analytics
  • APM monitoring

AWS (Amazon Web Services)

Market leader with the most comprehensive ecosystem

AWS pioneered cloud computing and has the largest market share (~32%). It offers the most services (200+) and deepest features, but can be complex to navigate. Best for: enterprises needing comprehensive solutions and startups wanting to scale globally.

Core Big Data Services

S3 (Simple Storage Service), Data Lake Foundation

What it is: Object storage for unlimited data

Pricing: $0.023/GB/month (Standard)

Durability: 99.999999999% (11 nines)

Max object size: 5TB

Best for: Data lakes, backups, logs

Integrations: Everything in AWS

# AWS CLI: Upload data to S3
aws s3 cp large_dataset.parquet s3://my-data-lake/raw-data/

# Query S3 directly with Athena (serverless SQL)
SELECT customer_id, SUM(revenue) as total
FROM "s3://my-data-lake/sales/*.parquet"
WHERE year = 2024
GROUP BY customer_id
LIMIT 100;
Result: Data stored in S3, queryable without loading into database
Cost: 1TB data = $23/month storage + $5/TB scanned

โœ… Pros:

  • Unlimited scalability
  • Tiered storage (Standard, IA, Glacier)
  • Lifecycle policies (auto-archive)

โŒ Cons:

  • Eventual consistency (in some cases)
  • Costs add up for frequent access
EMR (Elastic MapReduce), Managed Hadoop/Spark

What it is: Managed Hadoop, Spark, Presto clusters

Pricing: EC2 cost + 25% EMR fee

Cluster size: 1 to 1000s of nodes

Best for: Large-scale ETL, ML training

# Launch 50-node Spark cluster
aws emr create-cluster \
  --name "ETL Pipeline" \
  --release-label emr-6.15.0 \
  --applications Name=Spark Name=Hadoop \
  --instance-type m5.xlarge \
  --instance-count 50 \
  --use-default-roles

# Submit Spark job
aws emr add-steps \
  --cluster-id j-XXXXXXXXXXXXX \
  --steps Type=Spark,Name="Process Data",\
    Args=[--class,com.example.ETL,s3://my-bucket/etl.jar]
Result: 50-node cluster running in 10 minutes
Cost: ~$50/hour for m5.xlarge ร— 50
Auto-terminate: Cluster shuts down after job completes
Redshift, Petabyte-Scale Data Warehouse

What it is: Columnar SQL data warehouse

Pricing: $0.25/hour/node (on-demand)

Performance: 10x faster than traditional DBs

Max size: 16 PB per cluster

Concurrency: 500 queries simultaneously

Best for: BI dashboards, analytics

-- Load data from S3
COPY sales FROM 's3://my-bucket/sales/'
IAM_ROLE 'arn:aws:iam::xxx:role/RedshiftRole'
FORMAT AS PARQUET;

-- Query 10 billion rows (sub-second)
SELECT product_category, 
       SUM(revenue) as total_revenue,
       COUNT(DISTINCT customer_id) as customers
FROM sales
WHERE order_date >= '2024-01-01'
GROUP BY product_category
ORDER BY total_revenue DESC
LIMIT 10;
Query time: 0.8 seconds (10B rows)
Columnar storage: Only scans needed columns
Result caching: Identical queries return instantly
Athena, Serverless SQL on S3

What it is: Query S3 data with SQL (no servers)

Pricing: $5 per TB scanned

Setup time: Zero (serverless)

Best for: Ad-hoc queries, exploration

-- Create table pointing to S3 Parquet files
CREATE EXTERNAL TABLE logs (
  user_id STRING,
  timestamp TIMESTAMP,
  action STRING,
  page_url STRING
)
STORED AS PARQUET
LOCATION 's3://my-bucket/logs/year=2024/';

-- Query directly (no data loading!)
SELECT action, COUNT(*) as count
FROM logs
WHERE timestamp >= TIMESTAMP '2024-01-01'
GROUP BY action
ORDER BY count DESC;
Data scanned: 2TB (partitioned by year)
Cost: $10 for this query
Time: 15 seconds
Pro tip: Partition data to reduce scans = lower cost
Kinesis, Real-Time Data Streaming

What it is: Managed Kafka-like streaming

Throughput: MB to TB per second

Retention: 24 hours to 365 days

Best for: Real-time analytics, IoT

# Python: Send data to Kinesis
import json
import boto3
kinesis = boto3.client('kinesis')

kinesis.put_record(
    StreamName='clickstream',
    Data=json.dumps({
        'user_id': '12345',
        'action': 'purchase',
        'amount': 99.99
    }),
    PartitionKey='user_12345'
)

# Process with Lambda (serverless)
# Triggered automatically for each record
Latency: <1 second from ingestion to processing
Auto-scaling: Handles spikes automatically
Integration: Lambda, Spark, Flink all supported

AWS Strengths & Weaknesses

โœ… Strengths
  • Most comprehensive service catalog
  • Largest ecosystem & community
  • Best global infrastructure (30+ regions)
  • Mature, battle-tested services
  • Deep integrations between services
  • Extensive third-party tooling
โŒ Weaknesses
  • Complex pricing (hard to estimate)
  • Steeper learning curve
  • Overwhelming number of services
  • UI can be clunky
  • Legacy services still around
  • Can be more expensive than GCP

Microsoft Azure

Enterprise favorite with strong Microsoft integration

Azure is Microsoft's cloud platform, holding ~23% market share. It excels at hybrid cloud (on-premise + cloud) and integrates seamlessly with Microsoft products (Windows, SQL Server, Active Directory). Best for: enterprises already using Microsoft stack.

Core Big Data Services

Azure Blob Storage + Data Lake Gen2

What it is: Object storage with hierarchical namespace

Pricing: $0.018/GB/month (Hot tier)

Unique feature: POSIX-like file system

Best for: Data lakes with directory structure

# Azure CLI: Upload to Blob Storage
az storage blob upload-batch \
  --account-name mydatalake \
  --destination raw-data \
  --source ./local-data/ \
  --pattern "*.parquet"

# Enable hierarchical namespace (Data Lake Gen2)
az storage account update \
  --name mydatalake \
  --enable-hierarchical-namespace true
Advantage over S3: True file/directory operations (rename, atomic)
Synapse Analytics, Unified Analytics Platform

What it is: Data warehouse + Spark + Pipelines in one

Pricing: Pay-per-use or dedicated pools

Serverless SQL: Query without provisioning

Best for: End-to-end analytics workloads

-- Serverless SQL pool (no infrastructure)
SELECT 
    product_category,
    SUM(revenue) as total_revenue
FROM OPENROWSET(
    BULK 'https://mydatalake.dfs.core.windows.net/sales/*.parquet',
    FORMAT = 'PARQUET'
) AS sales
WHERE order_date >= '2024-01-01'
GROUP BY product_category;

-- Also run Spark notebooks in same workspace
spark.read.parquet("abfss://sales@mydatalake.dfs.core.windows.net/")
     .groupBy("category")
     .agg(sum("revenue"))
     .show()
Unique advantage: Switch between SQL and Spark seamlessly
Cost: $5/TB scanned (serverless) or $1.20/hour (dedicated pool)
HDInsight, Managed Hadoop/Spark

What it is: Azure's version of EMR

Pricing: VM cost + 20% HDInsight fee

Clusters: Spark, Hadoop, Kafka, HBase

Integration: Deep Azure ecosystem ties

# Azure CLI: Create Spark cluster
az hdinsight create \
  --name spark-cluster \
  --resource-group myResourceGroup \
  --type spark \
  --cluster-tier Standard \
  --component-version Spark=3.1 \
  --headnode-size Standard_D12_v2 \
  --workernode-count 10 \
  --workernode-size Standard_D13_v2
Note: Microsoft recommends Synapse over HDInsight for new projects
Event Hubs, Kafka-Compatible Streaming

What it is: Kafka as a service

Throughput: Millions of events/second

Kafka compatible: Use existing Kafka code

Best for: Telemetry, logs, clickstream

# Python: Send to Event Hub (Kafka protocol)
from kafka import KafkaProducer

producer = KafkaProducer(
    bootstrap_servers='myeventhub.servicebus.windows.net:9093',
    security_protocol='SASL_SSL',
    sasl_mechanism='PLAIN',
    sasl_plain_username='$ConnectionString',
    sasl_plain_password='Endpoint=sb://...'
)

producer.send('telemetry', b'sensor data')
producer.flush()
Migration-friendly: Existing Kafka apps work with minimal changes

Azure Strengths & Weaknesses

โœ… Strengths
  • Best hybrid cloud support
  • Seamless Microsoft integration (SQL, AD)
  • Enterprise agreements (existing licenses)
  • Strong compliance certifications
  • Synapse Analytics (unified platform)
  • Excellent Windows workloads
โŒ Weaknesses
  • Smaller service catalog than AWS
  • Some services less mature
  • Confusing naming (Data Lake Gen1 vs Gen2)
  • Portal can be slow
  • Fewer regions than AWS
  • Limited open-source tooling

Google Cloud Platform (GCP)

Innovation leader with best data analytics and ML

GCP holds ~11% market share but leads in data analytics and machine learning innovation. Google invented MapReduce, BigTable, and many foundational big data technologies. Best for: data-intensive startups, ML workloads, and companies wanting cutting-edge analytics.

Core Big Data Services

Cloud Storage, Unified Object Storage

What it is: Object storage (like S3)

Pricing: $0.020/GB/month (Standard)

Strong consistency: Always (not eventual)

Best for: Data lakes, ML training data

# gsutil: Upload to Cloud Storage
gsutil -m cp -r ./local-data gs://my-data-lake/raw-data/

# Create external table for GCS data, then query
CREATE EXTERNAL TABLE `project.dataset.sales_external`
OPTIONS (
  format = 'PARQUET',
  uris = ['gs://my-data-lake/sales/*.parquet']
);

SELECT customer_id, SUM(revenue) as total
FROM `project.dataset.sales_external`
GROUP BY customer_id;
Advantage: Strong consistency (no eventual consistency delays)
BigQuery, Serverless Data Warehouse

What it is: Fully serverless, auto-scaling warehouse

Pricing: $5/TB scanned OR $0.04/GB/month storage

Performance: Scans TB in seconds

Max size: Unlimited (petabytes+)

Concurrency: Unlimited (auto-scales)

Best for: Analytics on massive datasets

-- Load data from Cloud Storage
LOAD DATA INTO `project.dataset.sales`
FROM FILES (
  format = 'PARQUET',
  uris = ['gs://my-bucket/sales/*.parquet']
) WITH CONNECTION `project.region.connection_id`;

-- Query 10 billion rows (no cluster to manage!)
SELECT 
  DATE_TRUNC(order_date, MONTH) as month,
  product_category,
  SUM(revenue) as revenue,
  APPROX_COUNT_DISTINCT(customer_id) as customers
FROM `project.dataset.sales`
WHERE order_date >= '2024-01-01'
GROUP BY month, product_category
ORDER BY revenue DESC;
Query time: 2.3 seconds for 10B rows
Data scanned: 1.2 TB
Cost: $6 (1.2 TB ร— $5/TB)
Zero infrastructure: No servers to provision or manage
๐Ÿ’ก BigQuery Secret: Use clustering & partitioning to reduce scans by 10-100x. A well-optimized query on 10TB might only scan 100GB = $0.50 instead of $50!
Dataproc, Fast Hadoop/Spark Clusters

What it is: Managed Spark/Hadoop (like EMR)

Pricing: VM cost + 1ยข/vCPU/hour

Startup time: ~90 seconds (fastest!)

Auto-scaling: Add/remove workers automatically

Preemptible VMs: 80% cost savings

Best for: Spark jobs, batch processing

# Create ephemeral cluster (auto-deletes after job)
gcloud dataproc jobs submit pyspark \
  --cluster-name=temp-cluster \
  --region=us-central1 \
  --cluster-labels=ephemeral=true \
  gs://my-bucket/etl-job.py

# Use preemptible workers (80% cheaper)
gcloud dataproc clusters create my-cluster \
  --num-workers=50 \
  --num-preemptible-workers=100 \
  --worker-machine-type=n1-standard-4
Cluster ready: 90 seconds (vs 10 min on AWS/Azure)
Cost: 50 regular + 100 preemptible = ~$20/hour (vs $40 all regular)
Auto-delete: Cluster terminates when job finishes
Dataflow, Serverless Stream & Batch Processing

What it is: Apache Beam as a service

Pricing: $0.056/vCPU-hour + $0.0035/GB RAM

Auto-scaling: From 1 to 1000s workers

Best for: Real-time ETL, streaming analytics

# Python: Apache Beam pipeline
import json
import apache_beam as beam

with beam.Pipeline() as pipeline:
    (pipeline
        | 'Read from Pub/Sub' >> beam.io.ReadFromPubSub('projects/my-project/topics/events')
        | 'Parse JSON' >> beam.Map(json.loads)
        | 'Extract fields' >> beam.Map(lambda x: (x['user_id'], x['revenue']))
        | 'Sum by user' >> beam.CombinePerKey(sum)
        | 'Write to BigQuery' >> beam.io.WriteToBigQuery('project:dataset.user_revenue')
    )
Unique advantage: Write once, run batch OR streaming
Auto-scaling: Handles traffic spikes automatically
No servers: Fully managed infrastructure
Pub/Sub, Global Message Queue

What it is: Serverless messaging (like Kafka)

Throughput: 100M messages/second

Global: Multi-region by default

Best for: Event-driven architectures

# Python: Publish to Pub/Sub
from google.cloud import pubsub_v1

publisher = pubsub_v1.PublisherClient()
topic_path = publisher.topic_path('my-project', 'events')

# Publish message
future = publisher.publish(
    topic_path,
    b'{"user_id": "123", "action": "purchase"}',
    event_type='purchase'
)
print(f"Published message ID: {future.result()}")
Latency: <100ms end-to-end
Durability: Messages replicated across regions
At-least-once delivery: Guaranteed with acknowledgments

GCP Strengths & Weaknesses

โœ… Strengths
  • Best data analytics (BigQuery)
  • Leading ML/AI services
  • Most serverless options
  • Fastest cluster startup (Dataproc)
  • Simple, predictable pricing
  • Cleanest UI/UX
  • Strong open-source contributions
โŒ Weaknesses
  • Smallest market share (~11%)
  • Fewer services overall
  • Less enterprise adoption
  • Smaller partner ecosystem
  • Fewest regions globally
  • Some services less mature

Service Comparison Across Clouds

CategoryAWSAzureGCP
Object StorageS3Blob Storage / ADLS Gen2Cloud Storage
Data WarehouseRedshiftSynapse (dedicated pool)BigQuery โญ
Serverless SQLAthenaSynapse (serverless pool)BigQuery โญ
Hadoop/SparkEMRHDInsightDataproc โญ
Stream ProcessingKinesisEvent HubsDataflow โญ
Message QueueSQS / KinesisEvent HubsPub/Sub โญ
ETL OrchestrationGlue / Step FunctionsData FactoryCloud Composer (Airflow)
ML PlatformSageMakerAzure MLVertex AI โญ

โญ = Generally considered best-in-class for that category

Pricing Comparison

Cloud pricing is complex and varies by region, but here's a rough comparison for common scenarios:

ScenarioAWSAzureGCP
1TB Storage/month$23 (S3 Standard)$18 (Blob Hot)$20 (Standard) โœ…
Query 1TB data (serverless)$5 (Athena)$5 (Synapse serverless)$5 (BigQuery) โœ…
10-node Spark cluster/hour~$10 + 25% = $12.50~$10 + 20% = $12~$10 + 1ยข/vCPU = $10.40 โœ…
Data Warehouse (reserved)Redshift: $0.25/hr/nodeSynapse: $1.20/hr (DW100c)BigQuery: $0.04/GB storage โœ…
Streaming (1M events)Kinesis: $0.015Event Hubs: $0.028Pub/Sub: $0.040
โš ๏ธ Hidden Costs: Don't forget egress (data transfer out) costs! All clouds charge $0.09-0.12/GB for data leaving their network. Keep data processing in the same region as storage.

Decision Framework: Which Cloud?

Choose Based on Your Situation:

Choose AWS if:
  • You need the most comprehensive service catalog
  • Global reach is critical (30+ regions)
  • You want the largest ecosystem and community
  • You're building a startup that might scale globally
  • You need mature, battle-tested services
Choose Azure if:
  • You're already using Microsoft products (Windows, SQL Server, AD)
  • You have existing Microsoft Enterprise Agreements
  • You need hybrid cloud (on-premise + cloud)
  • You're in a regulated industry (strong compliance)
  • You want unified analytics platform (Synapse)
Choose GCP if:
  • Data analytics is your primary workload (BigQuery)
  • You're building ML/AI-heavy applications
  • You want serverless-first architecture
  • You prefer simple, transparent pricing
  • You value innovation over ecosystem size
  • You're a data-intensive startup

Best Practices for Cloud Big Data

All clouds offer multiple storage tiers. Match your access pattern to the right tier.

Access PatternTierCostUse Case
Daily accessStandard/Hot$0.02/GB/moActive data lake
Monthly accessInfrequent Access$0.01/GB/moHistorical logs
Yearly accessArchive/Glacier$0.004/GB/moCompliance backups
๐Ÿ’ฐ Savings: Moving 100TB from Standard to Archive = $2000/mo โ†’ $400/mo (80% savings!)

Proper partitioning can reduce query costs by 10-100x by avoiding unnecessary data scans.

โœ… Good Partitioning
  • By date: /year=2024/month=01/day=15/
  • By region: /region=us-east/
  • By category: /product_type=electronics/
  • Query: WHERE date = '2024-01-15'
  • Scans: Only 1 day's partition
โŒ Bad Partitioning
  • By user_id: Too many partitions (millions)
  • By minute: Too granular (expensive)
  • No partitioning: Scans all data
  • Query: WHERE user_id = '123'
  • Scans: Entire dataset (wasteful)

Serverless eliminates idle costs, you only pay when queries run.

Scenario: 10 analysts running 50 queries/day

Traditional Data Warehouse:
- Cluster runs 24/7: $1.50/hour ร— 720 hours = $1,080/month
- Utilization: ~15% (most time idle)

Serverless (BigQuery/Athena):
- 50 queries ร— 10 analysts ร— 22 days = 11,000 queries
- Average 100GB scanned per query
- 11,000 ร— 0.1TB ร— $5 = $550/month
- 49% cost savings!
๐Ÿ’ก Rule: Serverless wins when queries are sporadic. Dedicated wins at 24/7 heavy usage.

Automatically move or delete old data to save costs without manual intervention.

# AWS S3 Lifecycle Policy
{
  "Rules": [{
    "Id": "Archive old logs",
    "Status": "Enabled",
    "Transitions": [
      {
        "Days": 90,
        "StorageClass": "STANDARD_IA"  // Move to Infrequent Access
      },
      {
        "Days": 365,
        "StorageClass": "GLACIER"       // Archive after 1 year
      }
    ],
    "Expiration": {
      "Days": 2555                      // Delete after 7 years
    }
  }]
}
Result: Automatic cost optimization
Set once, saves money forever

Cloud costs can spiral out of control. Set up monitoring and budgets from day 1.

Essential Monitoring:
  • Budget alerts: Email when 50%, 80%, 100% of budget spent
  • Cost by service: Identify which services cost most
  • Cost by team/project: Use tags/labels for chargeback
  • Anomaly detection: Alert on unusual spikes
  • Unused resources: Find idle clusters, old snapshots
โš ๏ธ Common Mistake: Leaving test clusters running over the weekend. A 50-node cluster costs $2,400/weekend!

For predictable, 24/7 workloads, commit to 1-3 years for 30-75% savings.

CommitmentDiscountBest For
On-Demand0% (baseline)Variable workloads
1-Year Reserved30-40% offKnown steady usage
3-Year Reserved50-75% offCore infrastructure
Spot/Preemptible70-90% offFault-tolerant batch jobs

Real-World Example: On-Premise to Cloud Migration

Case Study: E-Commerce Company Migration to AWS

Problem: 200TB data warehouse on-premise, aging infrastructure, 12-hour batch jobs, $800K/year operational costs

Migration Strategy:
Phase 1: Data Lake (Month 1-2)
  • Move raw data to S3 (200TB)
  • Partition by date/product
  • Convert to Parquet format
  • Cost: $4,600/month storage
Phase 2: Processing (Month 2-3)
  • Migrate ETL to EMR
  • Use spot instances (70% savings)
  • Auto-terminate after jobs
  • Batch jobs: 12hrs โ†’ 2hrs
Phase 3: Analytics (Month 3-4)
  • Set up Redshift cluster
  • Load hot data (last 2 years)
  • Athena for ad-hoc queries
  • Query time: minutes โ†’ seconds
Phase 4: Optimization (Month 4-6)
  • Implement lifecycle policies
  • Archive old data to Glacier
  • Reserved instances for Redshift
  • Cost monitoring dashboards
โœ… Results After 6 Months:
โ€ข Total cloud cost: $280K/year (65% reduction)
โ€ข Batch processing: 6x faster
โ€ข Query performance: 50x improvement
โ€ข Team reduced from 8 to 3 DBAs
โ€ข ROI: 18 months payback period

Key Takeaways

  • Cloud wins for 90% of companies, lower TCO, faster deployment, elastic scaling
  • AWS = breadth, most services, largest ecosystem, global reach
  • Azure = Microsoft stack, best hybrid cloud, enterprise integration
  • GCP = analytics & ML, BigQuery, serverless-first, innovation
  • Use right storage tier, 80% savings moving cold data to archive
  • Partition your data, 10-100x cost reduction on queries
  • Serverless for variable loads, pay only when processing
  • Monitor costs religiously, set budgets and alerts from day 1
๐Ÿ’ก Final Advice: Start with one cloud, master it, then consider multi-cloud only if you have specific needs. Multi-cloud adds complexity, avoid it unless necessary.