Cloud Data Warehouses

Snowflake, Redshift, and BigQuery, The Modern Data Warehouse Revolution

Why Data Warehouses Matter: OLAP vs OLTP

Most applications use OLTP (Online Transaction Processing) databases like PostgreSQL, MySQL, or MongoDB. These are optimized for handling thousands of small, fast transactions, inserting orders, updating inventory, processing payments. But when you need to analyze trends, aggregate millions of records, or generate reports, OLTP databases struggle. That's where OLAP (Online Analytical Processing) systems like data warehouses excel.

What is a Data Warehouse?

A data warehouse is a centralized repository optimized for analytics and reporting. Unlike traditional databases designed for transactional workloads (OLTP), data warehouses are built for analytical processing (OLAP), running complex queries across massive datasets to extract business insights. Think of it as the single source of truth for your organization's data, where data from multiple sources is integrated, cleaned, and structured for analysis.

OLTP (Transactional)
  • Purpose: Run applications, process transactions
  • Operations: INSERT, UPDATE, DELETE single records
  • Query Pattern: Simple, fast lookups (ms latency)
  • Data Volume: Current, operational data only
  • Users: Thousands of concurrent app users
  • Optimization: Row-based storage, indexes for fast writes
SELECT * FROM orders WHERE id = 12345;
OLAP (Analytical)
  • Purpose: Analyze data, generate insights
  • Operations: Complex aggregations, JOINs across millions of rows
  • Query Pattern: Complex, scan large datasets (seconds)
  • Data Volume: Historical data, years of records
  • Users: Analysts, BI tools, data scientists
  • Optimization: Columnar storage, compression, parallel processing
SELECT region, SUM(revenue) FROM orders WHERE year = 2025 GROUP BY region;
The Key Difference: OLTP databases are optimized for writing data quickly (row-based storage). Data warehouses are optimized for reading and analyzing data (columnar storage). When you query "What were total sales by region last quarter?" on an OLTP database with 100 million rows, it might take minutes or crash. The same query on a data warehouse takes seconds.
Why You Can't Just Use Your Production Database for Analytics
Performance ImpactComplex analytical queries can lock tables, consume CPU, and slow down your application for actual users trying to place orders or load pages.
Wrong Storage ModelRow-based storage (OLTP) stores entire records together. Columnar storage (OLAP) stores each column separately, reading only needed columns for 10-100x speedup.
Data IntegrationAnalytics require combining data from CRM, marketing, sales, finance, multiple operational databases. Warehouses integrate these sources.
Historical AnalysisOLTP keeps recent data; old records are archived. Warehouses retain years of history for trend analysis and year-over-year comparisons.
Key Characteristics
Subject-OrientedOrganized around business subjects (customers, sales, products) rather than applications
IntegratedCombines data from multiple sources into a consistent format
Time-VariantStores historical data to enable trend analysis over time
Non-VolatileData is stable, not frequently updated or deleted once loaded
Traditional vs. Cloud Data Warehouses: Legacy warehouses (Oracle, Teradata) required expensive on-premise hardware and manual scaling. Modern cloud data warehouses (Snowflake, Redshift, BigQuery) offer elastic scaling, pay-as-you-go pricing, and minimal infrastructure management.

Why Data Warehouses Matter

Fast Analytics

Columnar storage and query optimization enable sub-second response times on billions of rows. What takes hours in traditional databases happens in seconds in a data warehouse.

Unified View

Integrate data from CRM, ERP, marketing platforms, IoT sensors, and more into a single source of truth. No more siloed data across departments.

Business Intelligence

Power BI, Tableau, and Looker dashboards query warehouses to deliver real-time insights to executives and analysts across the organization.

Scalability

Start small and scale to petabytes. Cloud warehouses automatically handle infrastructure, so you pay only for what you use without capacity planning headaches.

When to Use a Data Warehouse

✅ Good Fit
  • Complex analytical queries (aggregations, JOINs)
  • Business intelligence and reporting
  • Historical trend analysis
  • Data from multiple sources needs integration
  • Need for consistent query performance at scale
  • Semi-structured data (JSON, Parquet)
❌ Poor Fit
  • High-frequency transactional workloads
  • Low-latency single-row lookups
  • Real-time streaming (use stream processing instead)
  • Unstructured data (images, videos, use data lakes)
  • Frequent updates/deletes on individual records
  • Applications requiring ACID transactions

Snowflake: The Cloud-Native Pioneer

Snowflake revolutionized data warehousing with a cloud-native architecture built from scratch for the cloud. Unlike competitors that adapted legacy systems, Snowflake separates compute from storage, enabling independent scaling and near-zero maintenance.

Architecture Highlights

Storage Layer

Automatically compressed and optimized cloud storage (S3, Azure Blob, GCS). Pay only for stored data.

Compute Layer

Virtual warehouses (compute clusters) that can be scaled up/down or paused independently. No impact on storage.

Cloud Services

Authentication, metadata management, query optimization, and infrastructure management handled automatically.

Key Features

Snowpipe: Continuous Data Ingestion

Automatically loads data as it arrives in cloud storage (S3, Azure, GCS) without manual ETL jobs. Uses serverless compute for near-real-time ingestion.

-- Create a Snowpipe for auto-loading S3 data
CREATE PIPE sales_pipe AUTO_INGEST = TRUE AS
COPY INTO sales_table
FROM @s3_sales_stage
FILE_FORMAT = (TYPE = 'JSON');

-- Snowpipe continuously monitors S3 for new files
-- and loads them within seconds, no manual intervention
Zero-Copy Cloning

Create instant, full copies of databases, schemas, or tables with zero storage cost or latency. Perfect for dev/test environments, experiments, or backups.

-- Clone production database instantly for testing
CREATE DATABASE dev_db CLONE production_db;

-- Clone a table at a specific point in time
CREATE TABLE orders_clone CLONE orders AT(TIMESTAMP => '2026-01-01 00:00:00');

-- No data duplication, shares underlying storage until modified
Time Travel & Fail-Safe

Query or restore data from any point in the past (up to 90 days). Recover from accidental deletes or analyze historical states without backups.

-- Query table as it existed 1 hour ago (3600 seconds)
SELECT * FROM orders AT(OFFSET => -3600);

-- Restore accidentally deleted data
CREATE TABLE orders_restored CLONE orders AT(OFFSET => -7200);

-- Time Travel retention: Standard = 1 day, Enterprise = 90 days
-- Fail-Safe: Additional 7 days for disaster recovery
Snowpark: Data Engineering in Python/Java/Scala

Write data transformations using Python, Java, or Scala DataFrames that execute natively in Snowflake. No data movement, all processing happens inside the warehouse.

from snowflake.snowpark import Session
from snowflake.snowpark.functions import col, sum

# Create Snowpark session
session = Session.builder.configs(connection_params).create()

# DataFrame operations execute in Snowflake, not locally
df = session.table("orders") \
    .filter(col("amount") > 1000) \
    .group_by("customer_id") \
    .agg(sum("amount").alias("total_spent")) \
    .sort("total_spent", ascending=False)

# Write results back to Snowflake
df.write.save_as_table("high_value_customers")
Secure Data Sharing

Share live data with partners, customers, or other business units without copying or moving data. Shared data updates in real-time with zero latency.

-- Create a share
CREATE SHARE sales_share;
GRANT USAGE ON DATABASE sales_db TO SHARE sales_share;
GRANT SELECT ON TABLE sales_db.public.transactions TO SHARE sales_share;

-- Share with another Snowflake account
ALTER SHARE sales_share ADD ACCOUNTS = partner_account;

-- Consumer accesses data without copying (zero data movement)
Additional Features
Search OptimizationPoint lookups 100x faster with search optimization service
Materialized ViewsAutomatically maintained views for faster query performance
Semi-Structured DataNative support for JSON, Avro, Parquet, XML with SQL queries
End-to-End EncryptionAutomatic encryption at rest and in transit, SOC 2 Type II certified
Why Choose Snowflake: Best for multi-cloud deployments, organizations needing data sharing capabilities, and teams that value zero administration. Excellent for workloads with unpredictable demand due to instant scaling.

Amazon Redshift: AWS-Native Data Warehouse

Amazon Redshift is a fully managed, petabyte-scale data warehouse deeply integrated with the AWS ecosystem. It excels when your data pipeline already uses S3, Glue, EMR, and other AWS services, offering tight integration and optimized data transfer costs.

Architecture Overview

Cluster-Based

Leader node coordinates queries, compute nodes execute them. Massively Parallel Processing (MPP) distributes work across nodes.

Columnar Storage

Data stored in columns with advanced compression (up to 10:1 ratio), optimized for analytics that scan specific columns.

Key Features

Redshift Spectrum

Query exabytes of data directly in S3 without loading it into Redshift. Combines data warehouse and data lake queries in a single SQL statement.

-- Query data in S3 without importing
CREATE EXTERNAL SCHEMA spectrum_schema
FROM DATA CATALOG DATABASE 'my_database'
IAM_ROLE 'arn:aws:iam::account:role/SpectrumRole';

-- Join Redshift table with S3 data
SELECT r.customer_id, r.name, SUM(s.amount) as total
FROM redshift_customers r
JOIN spectrum_schema.s3_transactions s ON r.id = s.customer_id
GROUP BY r.customer_id, r.name;

-- Spectrum auto-scales compute for S3 queries
Concurrency Scaling

Automatically adds cluster capacity to handle spikes in concurrent queries. Users experience consistent performance even during peak demand.

-- Enable concurrency scaling
ALTER WORKLOAD MANAGEMENT CONFIGURATION
ADD CONCURRENCY SCALING MODE AUTO;

-- Redshift automatically provisions additional clusters
-- when query queue exceeds threshold
-- Users don't notice any latency increase

-- Free concurrency scaling credits provided daily
Auto-Refreshing Materialized Views

Precompute expensive aggregations and JOINs. Redshift automatically refreshes them incrementally when base tables change.

CREATE MATERIALIZED VIEW customer_summary AS
SELECT
    customer_id,
    COUNT(*) as order_count,
    SUM(total_amount) as lifetime_value,
    MAX(order_date) as last_order_date
FROM orders
GROUP BY customer_id;

-- Auto-refresh when orders table changes
ALTER MATERIALIZED VIEW customer_summary AUTO REFRESH YES;
RA3 Nodes with Managed Storage

Newer node type that separates compute from storage (like Snowflake). Scale compute and storage independently, reducing costs for large datasets.

RA3 Benefits: Hot data cached on local SSD for speed, cold data in S3-managed storage for cost savings. Automatically manages data placement.

Federated Query

Query data in Amazon RDS (PostgreSQL, MySQL) or Aurora directly from Redshift without ETL. Join operational data with warehouse analytics in real-time.

-- Create external schema pointing to RDS
CREATE EXTERNAL SCHEMA rds_schema
FROM POSTGRES
DATABASE 'production_db'
URI 'mydb.rds.amazonaws.com'
IAM_ROLE 'arn:aws:iam::account:role/RedshiftFederatedRole'
SECRET_ARN 'arn:aws:secretsmanager:region:account:secret:rds-creds';

-- Join live RDS data with Redshift warehouse
SELECT w.product_name, SUM(r.quantity) as total_sold
FROM warehouse.sales w
JOIN rds_schema.live_inventory r ON w.product_id = r.id
WHERE r.last_updated > CURRENT_DATE - 1;
Additional Features
Automatic Workload ManagementML-powered query prioritization and resource allocation
AQUA (Advanced Query Accelerator)Hardware-accelerated cache for 10x faster queries on RA3
Data SharingShare data across Redshift clusters without copying (within AWS)
Automatic Table OptimizationAuto-adjusts sort keys, distribution styles, and compression
ML IntegrationCreate ML models using SQL with Amazon SageMaker integration
Redshift ServerlessZero infrastructure management, pay only for queries run
Why Choose Redshift: Best for AWS-centric architectures where you already use S3, Glue, EMR, and other AWS services. Excellent price-performance ratio, especially with RA3 nodes. Choose Redshift Serverless for variable workloads or Provisioned for predictable usage.

Google BigQuery: Serverless Analytics at Scale

BigQuery is Google's fully managed, serverless data warehouse that separates storage from compute and uses Google's Dremel query engine to analyze petabytes of data in seconds. No infrastructure to manage, no cluster sizing decisions, just load data and query.

Architecture Highlights

Serverless

No clusters to manage. BigQuery auto-allocates compute resources for each query from a massive shared pool.

Dremel Engine

Google's proprietary distributed query engine processes queries across thousands of machines in parallel.

Colossus Storage

Data stored in Google's distributed file system with automatic replication, encryption, and optimization.

Key Features

True Serverless Architecture

No need to provision or manage clusters. BigQuery automatically allocates resources for each query from shared compute pools. Scale to thousands of concurrent queries instantly.

Benefits: Zero administration overhead, infinite scalability, pay only for queries executed and storage used. No idle cluster costs.

BigQuery ML: SQL-Based Machine Learning

Build and deploy ML models using just SQL, no Python or TensorFlow required. Train models on petabyte-scale datasets directly in BigQuery.

-- Create and train a linear regression model
CREATE OR REPLACE MODEL `project.dataset.customer_ltv_model`
OPTIONS(
  model_type='linear_reg',
  input_label_cols=['lifetime_value']
) AS
SELECT
  customer_age,
  purchase_frequency,
  avg_order_value,
  lifetime_value
FROM `project.dataset.customer_features`;

-- Make predictions with SQL
SELECT customer_id, predicted_lifetime_value
FROM ML.PREDICT(MODEL `project.dataset.customer_ltv_model`,
  (SELECT * FROM `project.dataset.new_customers`));
BI Engine: In-Memory Analysis

In-memory analysis service that accelerates BI tool queries (Looker, Tableau, Data Studio) from seconds to milliseconds. Sub-second response for interactive dashboards.

-- Create BI Engine reservation (managed memory)
bq mk --reservation   --project_id=my-project   --location=US   --bi_engine_capacity=100GB

-- BigQuery automatically caches frequently accessed data
-- Dashboard queries hit memory instead of storage
-- 100x faster response times for interactive exploration
BigQuery Data Transfer Service

Automated, scheduled data imports from SaaS applications (Google Ads, YouTube, Facebook, Salesforce) and data warehouses. No code required.

-- Schedule daily Google Ads data import
bq mk --transfer_config   --data_source=google_ads   --display_name='Daily Ads Data'   --target_dataset=marketing_data   --schedule='every day 02:00'   --params='{
    "customer_id": "123-456-7890",
    "start_date": "2026-01-01"
  }'

-- Supports: Google Ads, YouTube, S3, Teradata, Redshift, and more
Advanced Partitioning & Clustering

Partition tables by time (daily, hourly, monthly) or integer ranges. Cluster by frequently filtered columns to reduce query costs by 90%+.

-- Create partitioned and clustered table
CREATE TABLE `project.dataset.events`
PARTITION BY DATE(event_timestamp)
CLUSTER BY user_id, event_type
AS SELECT * FROM source_table;

-- Queries only scan relevant partitions
SELECT COUNT(*) FROM `project.dataset.events`
WHERE DATE(event_timestamp) = '2026-01-15'
  AND user_id = 'user123'
-- Scans only 1 day of data, 1 cluster, not entire table
Additional Features
Native JSON, Array, Struct SupportQuery nested/repeated fields with SQL, no flattening needed
GIS FunctionsBuilt-in geospatial analysis with BigQuery GIS
Scheduled QueriesRun queries on a schedule to materialize results
Analytics HubDiscover and share datasets across organizations
Column-Level SecurityFine-grained access controls and data masking policies
BigQuery OmniQuery data in AWS S3 and Azure Blob from BigQuery
Why Choose BigQuery: Best for serverless simplicity, Google Cloud users, ML-driven analytics, and teams that want zero infrastructure management. Excellent for ad-hoc analysis and variable workloads. Unbeatable speed for large scans (petabytes in seconds).

Pricing Models & Comparison

Pricing Models

Snowflake Pricing
Storage

$23-$40 per TB/month (depends on cloud provider and region)
Compressed data, billed for actual usage after compression

Compute (Credits)

$2-$4 per credit-hour
X-Small: 1 credit/hour, Small: 2, Medium: 4, Large: 8, etc.
Only billed when warehouse is running

Example: 1 TB storage + Medium warehouse (4 credits/hour) running 8 hours/day × 30 days = $40 storage + ~$1,920 compute (at $2/credit) = ~$1,960/month
Amazon Redshift Pricing
Provisioned Clusters (RA3)

RA3.xlplus: $1.086/hour (4 TB managed storage included)
RA3.4xlarge: $3.26/hour (128 TB included)
Additional storage: $0.024 per GB/month

Redshift Serverless

$0.375 per RPU-hour (Redshift Processing Unit)
Base: 32 RPUs minimum
Storage: Same as provisioned ($0.024/GB/month)

Example (Serverless): 32 RPU base running 24/7 + 1 TB storage = $0.375 × 32 × 730 hours + $24.60 = $8,784/month (use Pause for lower costs)
Google BigQuery Pricing
Storage

Active: $0.020 per GB/month
Long-term (90+ days no edits): $0.010 per GB/month
Cheaper than competitors for cold storage

Query (On-Demand)

$6.25 per TB scanned (first 1 TB/month free)
Only pay for data scanned, not time
Use partitioning/clustering to reduce costs

Example: 1 TB storage + scanning 10 TB/month in queries = $20.48 storage + $56.25 queries (9 TB after free tier) = $76.73/month

Feature Comparison Matrix

FeatureSnowflakeRedshiftBigQuery
ArchitectureShared-nothing, separate compute/storageMPP cluster (RA3 separates compute/storage)Serverless, fully managed
ScalingManual resize, auto-suspend/resumeManual resize, concurrency scaling, serverless optionAutomatic, infinite scale
Data Sharing✅ Excellent (cross-cloud, zero-copy)✅ Good (within AWS accounts)✅ Good (Analytics Hub)
ML IntegrationSnowpark ML (Python/Java)SageMaker integration✅ Excellent (BigQuery ML native)
Semi-Structured Data✅ Excellent (VARIANT type, JSON)Good (SUPER type)✅ Excellent (nested/repeated fields)
Pricing ModelPer-second billing (compute + storage)Hourly (provisioned) or per-query (serverless)Per-TB scanned + storage
Best ForMulti-cloud, data sharing, variable workloadsAWS ecosystem, cost-conscious teams, predictable workloadsGoogle Cloud, serverless needs, ad-hoc analytics
Time Travel✅ Up to 90 days (Enterprise)Snapshots (manual)7 days
Zero-Copy Clone✅ Yes (instant)Limited (data sharing)Snapshots (similar concept)
Ecosystem IntegrationCloud-agnostic, broad tool support✅ Deep AWS integration✅ Deep Google Cloud integration

Cost Optimization Tips

Snowflake
  • Auto-suspend warehouses (default 5 min)
  • Use smaller warehouses for development
  • Leverage clustering to reduce scans
  • Monitor query performance with Query Profile
Redshift
  • Use RA3 nodes for large datasets
  • Pause clusters when not in use
  • Use Spectrum for infrequent queries on S3
  • Reserved instances for 75% savings
BigQuery
  • Partition tables by date
  • Cluster frequently filtered columns
  • Avoid SELECT *, specify columns
  • Use flat-rate pricing for predictable costs

Key Takeaways

  • Data warehouses are purpose-built for analytics, not transactions. They excel at complex queries across massive datasets using columnar storage and MPP.
  • Snowflake leads in data sharing and multi-cloud flexibility. Best for organizations needing to share data with partners or run across AWS/Azure/GCP.
  • Redshift offers the best AWS integration and price-performance. Ideal when your infrastructure is AWS-centric and you need tight integration with S3, Glue, and EMR.
  • BigQuery excels at serverless simplicity and ML. Zero infrastructure management, built-in ML capabilities, and unbeatable speed for petabyte-scale scans.
  • Pricing models differ significantly: Snowflake charges for compute-seconds, Redshift for hourly clusters, BigQuery for data scanned. Choose based on query patterns.
  • Modern features are table stakes: All three support semi-structured data, materialized views, data sharing, and ML integration. Choose based on ecosystem fit.
  • Cost optimization is critical. Partition tables, use clustering, avoid full table scans, and leverage auto-suspend/pause features to control spending.

Decision Guide: Which Warehouse Should You Choose?


Choose Snowflake if: You need multi-cloud deployment, extensive data sharing capabilities, or want to avoid cloud vendor lock-in. Best for variable workloads and data marketplaces.

Choose Redshift if: Your infrastructure is AWS-heavy, you need deep integration with S3/Glue/EMR, or you want the best price-performance ratio. Best for predictable, sustained workloads.

Choose BigQuery if: You're on Google Cloud, want zero infrastructure management, need built-in ML capabilities, or run ad-hoc analytics with unpredictable query patterns. Best for serverless simplicity.