Streaming and Analytics on AWS: Kinesis, Firehose, Glue, Athena, EMR, QuickSight and Data Lake Design

AWS Solutions Architect 50 min min read Updated: Nov 17, 2026 Advanced
Streaming and Analytics on AWS: Kinesis, Firehose, Glue, Athena, EMR, QuickSight and Data Lake Design
Advanced Topic 3 of 3

The Analytics Pipeline

text Sources ─► INGEST ─────────► STORE ───────► PROCESS ─────────► ANALYZE / SERVE apps, IoT Kinesis, Firehose S3 data lake Glue ETL, EMR, Athena, Redshift, databases DMS, MSK, Snow (raw → curated) Lambda, Flink QuickSight, OpenSearch, SageMaker

Streaming Ingest: Kinesis

ServiceWhat it doesKey points
Kinesis Data Streams (KDS)Real-time stream you read yourself (custom consumers). Data kept 24 hours up to 365 days, can be replayedShards: each gives about 1 MB/s or 1,000 records/s in and 2 MB/s out. On-demand mode scales automatically. Partition key decides the shard (avoid hot shards). Multiple consumers, enhanced fan-out
Kinesis Data Firehose (Amazon Data Firehose)Fully managed delivery of streams into S3, Redshift, OpenSearch, Splunk, HTTP endpointsNear real-time (buffer by size and time, minimum about 60 seconds, lower with newer options). Optional Lambda transform, convert to Parquet/ORC, compress. No storage or replay, no code for consumers
Managed Service for Apache FlinkReal-time SQL/Java/Python processing on streamsWindowing, aggregations, anomaly detection
Kinesis Video StreamsStream video from devicesCamera, ML analysis
Amazon MSK (Managed Streaming for Apache Kafka)Managed Kafka clusters, MSK ServerlessUse when you already use Kafka or need its ecosystem
KDS vs Firehose: Need custom processing, replay or multiple consumers → Data Streams. Just load streaming data into S3/Redshift/OpenSearch with little work → Firehose.
python import boto3, json kinesis = boto3.client("kinesis") kinesis.put_record(StreamName="clicks", Data=json.dumps({"user": "u42", "page": "/cart"}).encode(), PartitionKey="u42")
bash aws kinesis create-stream --stream-name clicks --stream-mode-details StreamMode=ON_DEMAND aws firehose create-delivery-stream --delivery-stream-name clicks-to-s3 --delivery-stream-type DirectPut \ --extended-s3-destination-configuration RoleARN=arn:aws:iam::123456789012:role/firehose-role,BucketARN=arn:aws:s3:::acme-lake,Prefix=raw/clicks/dt=!{timestamp:yyyy-MM-dd}/,ErrorOutputPrefix=errors/,BufferingHints={SizeInMBs=64,IntervalInSeconds=120},CompressionFormat=GZIP

S3 Data Lake Layout

text s3://acme-lake/ ├─ raw/ exactly as received (JSON, CSV) keep forever, cheap class ├─ curated/ cleaned, typed, Parquet, partitioned dt=2026-11-17/region=ap-south-1/ └─ analytics/ aggregated tables for dashboards Rules: use columnar formats (Parquet/ORC), compress (Snappy/ZSTD), partition by common filters (date, region), aim for files of 128 MB to 1 GB, separate raw from curated, encrypt with KMS, control access with Lake Formatio

AWS Glue

PartPurpose
Data CatalogA central metadata store (databases, tables, schemas) used by Athena, Redshift Spectrum, EMR and Glue
CrawlersScan S3 or databases, infer the schema and create or update catalog tables and partitions
ETL jobsServerless Apache Spark (or Python shell, Ray) jobs to transform data. Job bookmarks process only new data. Glue Studio visual editor
Glue DataBrewNo-code data preparation
Glue Data Quality, Workflows, triggersQuality rules and job orchestration
python # Glue ETL job (PySpark): convert raw JSON to partitioned Parquet import sys from awsglue.context import GlueContext from pyspark.context import SparkContext from pyspark.sql.functions import to_date, col glue = GlueContext(SparkContext.getOrCreate()) df = glue.create_dynamic_frame.from_catalog(database="lake", table_name="raw_clicks").toDF() df = df.withColumn("dt", to_date(col("ts"))).dropDuplicates(["event_id"]) df.write.mode("append").partitionBy("dt").parquet("s3://acme-lake/curated/clicks/")

Amazon Athena

  • Serverless SQL directly on S3 data. Pay per data scanned (about 5 USD per TB, check current price)
  • Uses the Glue Data Catalog. Supports CSV, JSON, Parquet, ORC, Avro and open table formats such as Iceberg
  • Cut cost and time: use Parquet/ORC, compression, partitions, and select only needed columns (columnar formats scan less)
  • Query logs from ALB, CloudTrail, VPC Flow Logs, S3 access logs very easily
  • Federated queries reach RDS, DynamoDB, Redshift and others using Lambda connectors
  • Use workgroups to set query result locations, cost limits and permissions
sql CREATE EXTERNAL TABLE IF NOT EXISTS lake.clicks ( event_id string, user_id string, page string, ts timestamp) PARTITIONED BY (dt date) STORED AS PARQUET LOCATION 's3://acme-lake/curated/clicks/'; MSCK REPAIR TABLE lake.clicks; SELECT page, count(*) AS views FROM lake.clicks WHERE dt BETWEEN date '2026-11-01' AND date '2026-11-17' GROUP BY page ORDER BY views DESC LIMIT 20;

Amazon EMR

  • Managed big data clusters: Spark, Hadoop, Hive, Presto/Trino, HBase, Flink. Run on EC2, EKS or EMR Serverless
  • Use when you need full control of the frameworks, custom libraries or very large jobs. For simple ETL prefer Glue; for SQL on S3 prefer Athena
  • Save money with Spot Instances for task nodes, keep core nodes On-Demand, use transient clusters that stop after the job
  • Data stays in S3 (EMRFS) so clusters can be created and destroyed freely

Visualization and Governance

ServicePurpose
Amazon QuickSightServerless BI dashboards. SPICE in-memory engine, embedded analytics, ML insights, per-user or capacity pricing
AWS Lake FormationBuild and govern a data lake: central permissions at database, table, column and row level, tag-based access, cross-account sharing
Amazon OpenSearch ServiceSearch, log analytics, dashboards (Kibana-style), near real-time
Amazon SageMakerMachine learning on the lake
Redshift Spectrum / RedshiftWarehouse analytics combined with S3 data
AWS Data ExchangeSubscribe to third-party datasets
AWS DMS and zero-ETLContinuous replication from databases into the lake or Redshift

Reference Architectures

ScenarioPipeline
Clickstream dashboard (near real-time)Web/app → Kinesis Data Streams → Firehose → S3 (Parquet) → Athena → QuickSight; or → OpenSearch for live dashboards
Daily batch analyticsDatabases → DMS → S3 raw → Glue ETL → S3 curated → Redshift Spectrum / Athena → QuickSight, orchestrated by Step Functions or MWAA (Airflow)
IoT telemetryDevices → IoT Core → Kinesis/Firehose → S3 and Timestream
Log analysisCloudWatch Logs / ALB logs → Firehose → S3 → Athena, or OpenSearch
Governed enterprise lakeS3 + Glue Catalog + Lake Formation permissions + Athena/Redshift/EMR consumers
Large Spark/ML processingS3 → EMR (Spot task nodes) → S3 → SageMaker

Cost and Performance Tips

  1. Parquet + partitioning + compression often cut Athena cost by 90 percent or more
  2. Right-size shards or use on-demand mode; avoid one hot partition key
  3. Use S3 lifecycle on raw data and Intelligent-Tiering for unknown access
  4. Stop idle EMR/Redshift clusters, or use serverless versions
  5. Keep small files under control (compact them) because many tiny files slow queries
  6. Apply least-privilege with Lake Formation and encrypt the lake with KMS

Practice Tasks

  1. Create a Firehose delivery stream to S3 and send test records with a script
  2. Run a Glue crawler on the raw bucket, then query the table in Athena
  3. Convert JSON to Parquet and compare the bytes scanned by the same Athena query
  4. Calculate shards needed for 5,000 records per second of 1 KB each
  5. Draw a pipeline for ALB logs to a QuickSight dashboard

Conclusion

Ingest with Kinesis Data Streams (custom, replay) or Firehose (load to S3, easy), store in an S3 data lake (raw and curated, Parquet, partitioned), catalog and transform with Glue, query with Athena, process big jobs on EMR, visualize with QuickSight and govern with Lake Formation.

Quick Summary: pipeline diagram; KDS vs Firehose + shard math; lake layout; Glue catalog/crawler/ETL; Athena cost tips; EMR spot; QuickSight/Lake Formation/OpenSearch; reference architectures.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators