Courseiva
Design for New SolutionseasyMultiple ChoiceObjective-mapped

Designing Log Storage with S3 Lifecycle and Athena for SQL Queries

A company is designing a new solution to store and analyze large amounts of log data from multiple sources. The logs must be retained for 90 days for recent analysis, and then archived to a more cost-effective storage class for an additional 5 years. The solution must support SQL-based queries. Which combination of AWS services should the company use?

Quick Answer

The correct combination is Amazon S3 with lifecycle policies to transition objects to S3 Glacier Deep Archive after 90 days, and Amazon Athena for SQL queries. This works because S3 lifecycle rules automate the movement of log data from a hot storage class to a cold archive tier, meeting the 90-day retention and 5-year archival requirement at minimal cost, while Athena enables serverless SQL querying directly on the data stored in S3 without needing to load it into a separate database. On the AWS Certified Solutions Architect Professional SAP-C02 exam, this scenario tests your ability to distinguish cost-effective, serverless analytics from over-provisioned services like Redshift or RDS, which are unnecessary for simple log querying and incur higher operational overhead. A common trap is choosing Amazon OpenSearch Service, but it lacks native SQL support and is pricier for long-term archival. Memory tip: think “S3 + Athena = logs on a budget” — lifecycle handles the aging, Athena handles the querying.

⚠ Common exam trap

Watch out — candidates often confuse Amazon OpenSearch Service's UltraWarm storage as a long-term archival solution, but it is actually a warm tier for less-frequently accessed data within the same cluster, not a cost-effective cold archive like S3 Glacier Deep Archive, and it does not support SQL queries natively.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Amazon S3 with lifecycle policies to transition objects to S3 Glacier Deep Archive after 90 days, and Amazon Athena for SQL queries.

Amazon S3 with lifecycle policies can automatically transition log objects from S3 Standard to S3 Glacier Deep Archive after 90 days, meeting the 90-day retention for recent analysis and the 5-year archival requirement at the lowest cost. Amazon Athena allows SQL-based queries directly on the log data stored in S3, without needing to load data into a separate database, making it a serverless and cost-effective solution for ad-hoc analysis.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Amazon Redshift with data sharing to retain logs for 5 years.

    Why it's wrong here

    Redshift is for data warehousing, not for simple log storage.

  • Amazon S3 with lifecycle policies to transition objects to S3 Glacier Deep Archive after 90 days, and Amazon Athena for SQL queries.

    Why this is correct

    S3 is cost-effective, lifecycle policies automate archival, Athena allows SQL queries.

  • Amazon OpenSearch Service with UltraWarm storage to archive logs after 90 days.

    Why it's wrong here

    OpenSearch does not natively support SQL and is more expensive for long-term storage.

  • Amazon RDS for PostgreSQL with automated backups to retain logs for 5 years.

    Why it's wrong here

    RDS is not designed for large-scale log storage and is expensive.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

Courseiva writes every SAP-C02 question from scratch — 1,660 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on SAP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company wants to store application logs in a centralized location for analysis. The logs are generated by EC2 instances in an Auto Scaling group. The solution must be cost-effective and support real-time analysis. Which service should be used to collect and analyze the logs?

easy
  • A.Amazon S3
  • B.Amazon Kinesis Data Firehose
  • C.Amazon Elasticsearch Service
  • D.Amazon CloudWatch Logs

Why D: Amazon CloudWatch Logs is the correct choice because it natively integrates with EC2 instances via the CloudWatch Logs agent to collect, monitor, and analyze log data in real time. It provides a centralized log storage with built-in metric filters and subscription filters for real-time analysis, making it cost-effective for logs generated by Auto Scaling groups without requiring additional infrastructure.

Variation 2. A company is building a new data lake on AWS to store and analyze petabytes of data from various sources. The data includes structured (CSV, Parquet), semi-structured (JSON), and unstructured (images, videos) files. The company needs a cost-effective storage solution that allows running SQL queries directly on the data without loading it into a database. Data is accessed infrequently but must be available within minutes. Which solution should a Solutions Architect recommend?

medium
  • A.Store data in Amazon S3 Glacier Deep Archive for cost savings, and use Athena for queries.
  • B.Store data in Amazon Redshift, use Redshift Spectrum to query data in S3.
  • C.Store data in Amazon S3 using lifecycle policies to transition infrequent data to S3 Standard-IA. Use Amazon Athena for SQL queries.
  • D.Store data in Amazon EBS volumes attached to an EC2 instance running a SQL engine.

Why C: Amazon S3 is the ideal storage for a data lake, supporting structured, semi-structured, and unstructured data. Lifecycle policies can transition infrequent data to S3 Standard-IA to reduce costs while maintaining low latency retrieval. Amazon Athena enables serverless SQL queries directly on data stored in S3 without requiring loading into a database. Option A is incorrect because S3 Glacier Deep Archive is for long-term archival with retrieval times of hours, not minutes, making it unsuitable for queries that require availability within minutes. Option B is incorrect because Amazon Redshift is a data warehouse that requires data to be loaded into it; Redshift Spectrum can query S3, but the primary storage is not designed for a data lake scenario where data is queried directly. Option D is incorrect because Amazon EBS is block storage attached to a single EC2 instance, which does not provide the scalability or cost-effectiveness for petabytes of data in a data lake.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.