TutorialsAIPostgreSQLMySQL

How to Query DynamoDB Without Writing Code

Amazon DynamoDB is one of the most widely used databases in cloud infrastructure. It's fast, fully managed, and scales automatically. But if you've ever trie...

Marcus Chen· Solutions EngineerMarch 26, 20268 min read

Amazon DynamoDB is one of the most widely used databases in cloud infrastructure. It's fast, fully managed, and scales automatically. But if you've ever tried to get answers out of it without writing code, you already know the problem: DynamoDB's query interface is deeply technical, and asking even a simple business question requires knowing table structure, partition keys, sort keys, and filter expressions.

This article walks through what makes DynamoDB hard to query for non-developers, what your options are, and how AI-powered tools are making it possible to get insights from DynamoDB using plain English.

Why DynamoDB Is Harder to Query Than You'd Think

Most relational databases (PostgreSQL, MySQL, SQLite) let you write SELECT statements. DynamoDB doesn't work that way. It's a NoSQL key-value and document store, which means:

  • No SQL support by default. DynamoDB uses its own API you call GetItem, Query, or Scan operations, not SQL.
  • Schema is flexible but unpredictable. Items in the same table can have different attributes, making it hard to know what data is even available.
  • Queries require knowing your keys. To query efficiently, you need to know the partition key and (optionally) the sort key. Without them, you're doing a full table scan, which is slow and expensive.
  • Filter expressions are verbose. Filtering results in DynamoDB requires a specific expression syntax that trips up even experienced developers.
  • Here's what a basic DynamoDB query looks like in Python:

    import boto3
    from boto3.dynamodb.conditions import Key, Attr
    
    dynamodb = boto3.resource('dynamodb')
    table = dynamodb.Table('Orders')
    
    response = table.query(
        KeyConditionExpression=Key('customerId').eq('cust-00142'),
        FilterExpression=Attr('status').eq('completed') & Attr('totalAmount').gt(100)
    )
    
    items = response['Items']

    That's what you need just to answer "Show me completed orders over $100 for customer cust-00142." If you're not a developer, that's not accessible. And even if you are, writing this for every business question is tedious.

    The Standard Workarounds and Their Limitations

    Most teams dealing with DynamoDB data access end up in one of three places:

    Option 1: Export to another database. Many teams replicate DynamoDB data into a data warehouse (Redshift, BigQuery, Snowflake) or a relational database (PostgreSQL via DynamoDB Streams + Lambda) so they can query it with SQL. This works, but it adds infrastructure, latency, and maintenance overhead. You're also querying yesterday's data, not live data.

    Option 2: Build internal dashboards. Teams build pre-canned dashboards in tools like Metabase or Grafana. The problem: every question has to be pre-answered. When someone asks a question you didn't anticipate, you're stuck until an engineer writes a new query.

    Option 3: Ask a developer. Non-technical stakeholders email or Slack a developer every time they need a data point. This works exactly as well as you'd expect slowly, and with a lot of friction.

    None of these options let non-technical people ask ad-hoc questions of live DynamoDB data directly.

    How Natural Language Querying Changes This

    AI-powered database tools are making it practical to ask questions of DynamoDB in plain English. The AI layer handles the translation: you type your question, the system figures out the right API call or query structure, executes it, and returns the result.

    For DynamoDB, this means the tool needs to understand your table's schema what the keys are, what attributes exist, what the data looks like and construct the right Query or Scan operation behind the scenes.

    A few examples of what this looks like in practice:

    You ask: "How many orders did we receive in the last 7 days?"

    The system generates:

    table.scan(
        FilterExpression=Attr('createdAt').between('2026-03-19', '2026-03-26')
    )

    You ask: "What's the average order value for customers in the US?"

    The system generates:

    table.scan(
        FilterExpression=Attr('country').eq('US'),
        ProjectionExpression='totalAmount'
    )
    # Then computes average across results

    You never write the code. You just ask the question and read the answer.

    What to Look for in a DynamoDB Query Tool

    Not all AI database tools handle DynamoDB well. When evaluating options, check for:

    1. Direct DynamoDB connection

    Some tools only support SQL databases (PostgreSQL, MySQL, etc.) and require you to first export your data to a relational database. That defeats the purpose. You want a tool that connects to DynamoDB directly.

    2. Schema awareness

    The tool should be able to inspect your DynamoDB table structure partition keys, sort keys, available attributes before trying to answer questions. Without schema context, the AI is guessing.

    3. Scan vs. Query optimization

    DynamoDB charges for reads. A tool that always does a full table scan is expensive. A good tool tries to use targeted Query operations when it knows the partition key, and falls back to Scan only when necessary.

    4. Handles mixed attribute sets

    DynamoDB tables often have items with different attributes (e.g., a Users table where some users have subscriptionTier and others don't). The tool should handle null/missing attributes gracefully.

    5. Results you can act on

    Raw DynamoDB items are JSON. A useful tool formats results as tables or charts, not raw JSON blobs.

    AI for Database supports DynamoDB connections directly, inspects your table schemas automatically, and handles ad-hoc questions from non-technical users without requiring them to understand DynamoDB's query model.

    Step-by-Step: Connecting DynamoDB and Asking Your First Question

    Here's how the process typically works with AI for Database:

    Step 1: Connect your DynamoDB account

    You'll provide AWS credentials (access key + secret key, or an IAM role ARN). The tool needs read access to your tables no write access required for querying.

    Step 2: Select the tables you want to query

    The system scans your available DynamoDB tables and lets you select which ones to include. It then inspects the schema of each table sampling items to understand what attributes exist.

    Step 3: Ask questions in plain English

    Once connected, you type questions directly:

  • "Show me the top 10 customers by total spend this month"
  • "How many sessions had errors in the last 24 hours?"
  • "What percentage of orders were fulfilled within 2 days?"
  • The AI translates each question into the appropriate DynamoDB operation and returns results as a table or chart.

    Step 4: Pin results to a dashboard

    Useful queries can be pinned to a dashboard that auto-refreshes on a schedule daily, hourly, or whatever cadence makes sense. No rebuilding queries. The dashboard stays current automatically.

    Common DynamoDB Business Questions You Can Now Answer Without Code

    Here are examples of questions non-technical team members ask regularly and which are now answerable directly:

    For product teams:

  • "How many users activated in the last 30 days?"
  • "What's the distribution of users by subscription plan?"
  • "Which features have the most logged usage events?"
  • For operations:

  • "Are there any orders stuck in 'processing' status for more than 48 hours?"
  • "What's the error rate on API calls this week vs. last week?"
  • For customer success:

  • "Which of our enterprise customers haven't logged in this month?"
  • "What's the average time between signup and first active session?"
  • For finance:

  • "What's total revenue for this quarter broken down by product line?"
  • "How many subscription upgrades happened in March?"
  • Ready to try AI for Database?

    Query your database in plain English. No SQL required. Start free today.