Skip to content
>GLB_
Go back

Sending Athena Query Results to Amazon SQS: Architecture, Costs, and Limitations

Introduction

Amazon Athena is a serverless query service designed for interactive analysis of data stored in Amazon S3. Amazon SQS (Simple Queue Service), on the other hand, is a fully managed message queue used to decouple and scale distributed systems. A common question arises when combining both services: can Athena send query results directly to SQS? The short answer is no. This article explains why, what the correct architecture looks like, and the associated costs.


Why Athena Cannot Send Data Directly to SQS

Amazon Athena is a read-only query engine. Its execution model is limited to:

Athena has no native integration to push data into downstream services such as SQS, SNS, DynamoDB, or Kinesis. This is a deliberate design decision aligned with its role as an analytical service rather than an event producer.

Reference:
https://docs.aws.amazon.com/athena/latest/ug/what-is.html

The Correct Architecture Pattern

To move data from Athena to SQS, an intermediate step is required.

Standard Flow

  1. Athena executes a SQL query.
  2. Query results are written to Amazon S3.
  3. A compute component reads the results from S3.
  4. Each record is published as a message to Amazon SQS.

Common Implementations

This pattern respects AWS service boundaries:

Reference:
https://docs.aws.amazon.com/athena/latest/ug/querying.html


Cost Considerations

Amazon Athena

Reference:
https://aws.amazon.com/athena/pricing/

Amazon SQS

For moderate batch workloads (for example, tens of thousands of messages per month), SQS usage typically remains within the free tier.

Reference:
https://aws.amazon.com/sqs/pricing/


Message Retention and Delivery Semantics

Messages sent to Amazon SQS:

Reference:
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-lifecycle.html


When This Architecture Is Appropriate

This pattern is suitable when:

It is not suitable for:


Conclusion

Amazon Athena cannot send data directly to Amazon SQS. The supported and scalable approach is to use Amazon S3 as an intermediate storage layer and a compute service (such as AWS Lambda or AWS Glue) to publish messages to SQS. This design aligns with AWS best practices, keeps costs predictable, and scales reliably.


Share this post:

Previous Post
Resolving the Node.js Error: Cannot find module jsonwebtoken
Next Post
Extracting and Managing Access Tokens in Postman