Ace Your AWS Certification — Save 50% or more on AWS courses on Educative.io today! Claim Discount

arrow

Lesson 4.4: Analytics services for developers

Analytics in AWS is not just about data science. Many modern applications generate logs, clickstreams, IoT telemetry, or event streams that require processing, transformation, query, and indexing.

For developers, the core skill is understanding which service fits which workload, considering data velocity, query requirements, operational overhead, and scaling behavior. In DVA-style exams or scenario questions, AWS evaluates services primarily based on:

  • Ingestion pattern (real-time vs batch)
  • Query flexibility (ad hoc SQL vs search)
  • Operational overhead (managed vs custom consumers)

Analytics decisions often affect cost, latency, durability, and scalability, so architectural reasoning is key.

Amazon Kinesis: real-time streaming ingestion

Amazon Kinesis is designed for processing streaming data in near real-time. It is particularly effective for continuous event ingestion from applications, IoT devices, or logs.

Key services

  1. Kinesis Data Streams (KDS)
    • Provides shard-based streams for custom real-time processing.
    • Each shard preserves order within itself.
    • Consumers independently read and process events.
    • Shard scaling is manual, requiring monitoring to avoid throttling.
  2. Kinesis Data Firehose
    • Fully managed delivery to S3, Redshift, OpenSearch, or Splunk.
    • Buffers records automatically and delivers them without custom consumers.
    • Simplifies operational complexity at the cost of flexibility.

Developer considerations

  • Data Streams when:
    • Low-latency, real-time processing is needed
    • Custom business logic is applied per event
  • Firehose when:
    • Near-real-time delivery to storage or analytics systems is the goal
    • Developers want minimal operational overhead

Scaling & monitoring

  • Monitor ShardIteratorAge and IncomingRecords metrics to detect lag.
  • Adjust shard count for throughput scaling.
  • Set up CloudWatch alarms for throttling and processing delays.

Example

Multiple producers sending events to Kinesis shards, and multiple consumers performing processing or analytics in real time. Include Firehose delivering aggregated records to S3 and OpenSearch.

Amazon Athena: serverless SQL queries on S3

Athena is a serverless query engine for analyzing data stored in S3. It uses schema-on-read, meaning no schema is enforced at write time.

Use cases

  • Query application logs stored in S3
  • Analyze CloudTrail or VPC flow logs
  • Run ad hoc analytics without managing a database

Developer workflow

  1. Register data in the AWS Glue Data Catalog.
  2. Map structured formats such as CSV, JSON, or Parquet.
  3. Execute SQL queries directly against S3 objects.
				
					SELECT COUNT(*) AS purchases
FROM clickstream_logs
WHERE page = '/checkout'
  AND event_date = '2026-03-02';
				
			

Key considerations

  • Athena is not designed for transactional workloads.
  • Performance improves with columnar formats (Parquet/ORC) and partitioning.
  • Queries are serverless and pay-per-query, reducing infrastructure management.

Amazon OpenSearch Service: search and log analytics

OpenSearch Service is optimized for full-text search, log aggregation, and real-time dashboards.

Use cases

  • Real-time search within web applications
  • Indexing application logs for analytics
  • Visualizing operational metrics with dashboards

Developer workflow

  • Index documents via API or streaming ingestion (Kinesis/Firehose).
  • Perform structured or unstructured queries.
  • Visualize with OpenSearch Dashboards (formerly Kibana).

Key considerations

  • Optimized for search, not relational transactions.
  • Supports horizontal scaling via shards and replication.
  • Integrates with CloudWatch for monitoring and alerts.

Example:

A clickstream pipeline:

Kinesis Data Streams -> Lambda -> OpenSearch

  • Lambda function transforms click events to JSON documents suitable for indexing.
  • OpenSearch indexes the data, supporting queries like “find all checkout events in the last 10 minutes.”

Integrating Kinesis, Lambda, and OpenSearch

A common real-time analytics pattern:

  1. Kinesis ingests event streams.
  2. Lambda functions consume Kinesis events:
    • Transform data
    • Filter or enrich events
    • Write to OpenSearch or S3 for storage
  3. OpenSearch enables dashboards and alerts.
  4. Athena allows ad hoc querying of S3 raw logs.
				
					import boto3

from opensearchpy import OpenSearch, RequestsHttpConnection

os_client = OpenSearch(
    hosts=[{'host': 'my-os-domain.us-east-1.es.amazonaws.com', 'port': 443}],
    http_auth=('user', 'password'),
    use_ssl=True,
    verify_certs=True,
    connection_class=RequestsHttpConnection
)

def lambda_handler(event, context):
    for record in event['Records']:
        doc = transform(record['kinesis']['data'])
        os_client.index(index='clickstream', body=doc)
				
			

Architectural Selection Guidance for Analytics

Requirement Recommended Service Notes
Real-time streaming ingestion Kinesis Data Streams Low-latency processing, custom consumers
Near-real-time delivery to storage Kinesis Data Firehose Fully managed, minimal operational overhead
Ad hoc SQL queries on S3 Athena Serverless, schema-on-read, pay-per-query
Full-text search and log dashboards OpenSearch Fast query, real-time indexing

Key Takeaways for Developers:

  • Match data velocity to the service: streaming data goes to Kinesis.
  • Match query type: SQL analytics uses Athena.
  • Match search & aggregation: dashboards or logs use OpenSearch.

Operational Guidance:

  • Monitor metrics and set CloudWatch alarms.
  • Partition S3 and optimize query formats for Athena.
  • Scale shards or nodes appropriately for Kinesis and OpenSearch.
  • Ensure data durability by buffering events in S3 or Kinesis before processing.
Picture of Naeem ul Haq

Naeem ul Haq

My name is Naeem ul Haq. I’ve been working with AWS since its early days and have deep expertise across its evolving ecosystem.

Save up to 70% off on your AWS Certification journey

Are you preparing for AWS certifications or looking to build real-world cloud skills? Get lifetime access to practical courses designed to help you pass your exams and build real-world AWS expertise.

AWS Associate & Professional Guides

Hands-on labs with real AWS scenarios

Cloud architecture & best practices

Real-world case studies & interview prep

Site logo