Logo

dev-resources.site

for different kinds of informations.

Query DynamoDB with SQL using Athena - Leveraging DynamoDB Exports to S3 (1/2)

Published at
11/5/2024
Categories
aws
dynamodb
athena
serverless
Author
serverlessl
Categories
4 categories in total
aws
open
dynamodb
open
athena
open
serverless
open
Author
11 person written this
serverlessl
open
Query DynamoDB with SQL using Athena - Leveraging DynamoDB Exports to S3 (1/2)

Export DynamoDB to S3 and query with Athena using SQL, unlocking powerful, scalable, and serverless data analytics

This is the first part of a two-part series covering how to copy data from DynamoDB to S3 and query it with Athena.

We will build two solutions using AWS CDK and TypeScript, covering both single-table and multiple-table designs.

Unlocking New Possibilities

The DynamoDB is a NoSQL database, and that fact comes with both the good and the bad. Among others, the good is that it is ultimately scalable; the bad is that it has limited query capabilities. You can squeeze out some additional query capabilities with a single-table approach, but it is still not comparable to any SQL database. However, for reporting, the SQL query language is extremely useful or almost essential.

One option is to copy data to an SQL database and execute queries there. However, if the database is large, this can be impractical or too expensive. A more scalable solution is to transfer data to S3 and query it with Athena using SQL, which we will explore in this article.

This approach is ideal for serverless solutions where the amount of data or cost makes an SQL database impractical. Athena is a powerful alternative and can be very cost-effective. At $5 per terabyte of queried data, it is significantly cheaper than provisioning an SQL instance capable of handling that volume. However, if you're running many queries, Athena may become expensive. Athena is best for creating offline reports. It's usually too slow for direct synchronous responses to users.

There are several ways to copy data from DynamoDB to S3, but the most useful and serverless-friendly are:

  • Using native full or incremental exports from DynamoDB to S3
  • Using EventBridge Pipes and Firehose for a near real-time copy of the data

This article focuses on the first approach. The second approach will be covered in Part 2. We will look at both solutions in the context of single-table and multiple-table designs.

...continue reading

dynamodb Article's
30 articles in total
Favicon
Efficient Batch Writing to DynamoDB with Python: A Step-by-Step Guide
Favicon
Advanced Single Table Design Patterns With DynamoDB
Favicon
DynamoDB GUI in local
Favicon
Stream Dynamo para RDS Mysql
Favicon
Alarme Dynamo Throttle Events - Discord
Favicon
What I Learned from the 'Amazon DynamoDB for Serverless Architectures' Course on AWS Skill Builder
Favicon
A Novel Pattern for Documenting DynamoDB Access Patterns
Favicon
Making dynamodb queries just a little bit easier.
Favicon
Replicate data from DynamoDB to Apache Iceberg tables using Glue Zero-ETL integration
Favicon
Deploying a Globally Accessible Web Application with Disaster Recovery
Favicon
Practical DynamoDB - Locking Reads
Favicon
Databases - Query Data with DynamoDB
Favicon
Database Management in the cloud (RDS, DynamoDB)
Favicon
Securing Customer Support with AWS Services and Slack Integration
Favicon
Help! I Think I Broke DynamoDB – A Tale of Three Wishes πŸ§žβ€β™‚οΈ
Favicon
Mastering DynamoDB in 2025: Building Scalable and Cost-Effective Applications
Favicon
Syncing Data in Near Real-Time: Integrate DynamoDB and OpenSearch
Favicon
DynamoDB and the Art of Knowing Your Limits πŸ’₯When Database Bites Back πŸ§›β€β™‚οΈ
Favicon
DynamoDB Transactions with AWS Step Functions
Favicon
Create an API to get data from your DynamoDB Database using CDK
Favicon
AWS Database - Part 2: DynamoDB
Favicon
Building event-driven workflows with DynamoDB Streams
Favicon
Setting up a REST API in Python for DynamoDB
Favicon
How to Create a (Nearly) Free Serverless Rate Limiter on AWS
Favicon
Query DynamoDB with SQL using Athena - Leveraging EventBridge Pipes and Firehose (2/2)
Favicon
Schema Validation in Amazon DynamoDB
Favicon
Use Cases for DynamoDB in Provisioned Mode vs. Auto Scaling: Advantages and Disadvantages
Favicon
Mastering DynamoDB: Batch Operations Explained
Favicon
Not only dynamoDb migration or seed scripting
Favicon
Query DynamoDB with SQL using Athena - Leveraging DynamoDB Exports to S3 (1/2)

Featured ones: