Skip to content

Add Amazon DynamoDB vector search client - #885

Open
eddy-aws wants to merge 1 commit into
zilliztech:mainfrom
eddy-aws:add-dynamodb-vector-client
Open

eddy-aws wants to merge 1 commit into
zilliztech:mainfrom
eddy-aws:add-dynamodb-vector-client

Conversation

@eddy-aws

@eddy-aws eddy-aws commented Oct 6, 2026 •

Copy link
Copy Markdown

Summary

Adds an Amazon DynamoDB vector search client, benchmarking DynamoDB's GA
vector index feature (CreateTable with VectorIndexes + SearchVectors) via
the standard boto3 SDK. No external vector store is required — vectors live in
the DynamoDB table alongside operational data.

What's included

  • vectordb_bench/backend/clients/dynamodb/ — dynamodb.py, config.py, cli.py
  • Registered in the DB enum (init_cls / config_cls / case_config_cls) and
    the vectordbbench CLI
  • dynamodb optional-dependency extra (boto3>=1.40.0)
  • Offline unit tests in tests/test_dynamodb.py

Features

  • Credentials: default boto3 credential chain by default; optional explicit
    access key / secret / session token.
  • Metrics: cosine / euclidean (L2) / dotproduct (IP), mapped to the
    COSINE / EUCLIDEAN / DOT_PRODUCT distance functions.
  • Load: batch_write_item in 25-item batches with two layers of throttling
    defence — boto3 standard retry mode plus bounded exponential backoff (with
    full jitter) on UnprocessedItems re-drive.
  • Partition key (--partition-count): when > 1, defines a SearchSchema
    HASH (vector index partition key), spreads vectors uniformly across
    partition values (id % N), and scopes each SearchVectors call to one
    randomly chosen partition value
    — the realistic single-partition access
    pattern the feature is built for (one scoped call per query, not a
    whole-index fan-out).
    • This uniform spread is a balanced baseline (no hot/empty partitions);
      real-world partition keys are usually skewed, so the figures represent the
      best-case even distribution rather than skewed production behaviour.
    • A scoped search covers only ~1/N of the dataset, while VectorDBBench
      computes recall against whole-dataset ground truth, so recall is expected
      to be ~1/N under partitioning; QPS/latency reflect the scoped access
      pattern. Use --partition-count 1 (default) for a whole-index recall
      benchmark with no partition key.
  • Filters: label equality via an INLINE_FILTER SearchSchema element
    (SearchConditionExpression supports only =, so NumGE is intentionally not
    advertised).
  • TopK capped at the API maximum of 100.

Testing

Offline unit tests cover config/metric parsing, the partition-key SearchSchema,
single-partition-scoped search, filter translation, throttling backoff, and CLI
wiring.

Validated end-to-end against a live DynamoDB vector index in us-east-1:

  • 20k synthetic vectors — search returns the correct nearest neighbours.

  • Real VectorDBBench run — Performance1536D50K (OpenAI, 50k × 1536-dim,
    COSINE, k=10), no partition key:

    Metric Value
    Recall 1.0
    NDCG 1.0
    Max QPS (concurrency 5) 63.3
    Serial latency p99 79.8 ms
    Load duration (50k) 488 s

Notes

  • Vector indexes require on-demand capacity, so the table is created with
    BillingMode=PAY_PER_REQUEST.
  • The vector index backfills asynchronously after load; searches should poll
    until results are returned (the benchmark's load→search ordering handles this).

@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: eddy-aws
To complete the pull request process, please assign xuanyang-cn after the PR has been reviewed.
You can assign the PR to them by writing /assign @xuanyang-cn in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@eddy-aws
eddy-aws force-pushed the add-dynamodb-vector-client branch 2 times, most recently from 4670917 to a456e3b Compare October 6, 2026 03:46
Add a DynamoDB client that benchmarks DynamoDB's GA vector search feature
using the standard boto3 SDK. Validated end-to-end against a live DynamoDB
vector index in us-east-1 (VectorDBBench Performance1536D50K: recall 1.0,
max QPS 63.3, p99 79.8ms).

- create_table with VectorIndexes (VectorAttribute={AttributeName}, SearchSchema
  list of HASH/INLINE_FILTER elements, DistanceFunction COSINE/EUCLIDEAN/
  DOT_PRODUCT) + search_vectors
- default boto3 credential chain; optional explicit keys / session token
- batch_write_item loading (25-item batches); throttling handled by boto3
  standard retry mode plus bounded exponential backoff with jitter on
  UnprocessedItems re-drive, raising if the table cannot drain
- SearchSchema partition key (HASH): --partition-count > 1 defines a vector
  index partition key, spreads vectors id%%N, and scopes each SearchVectors
  call to ONE randomly chosen partition value (realistic single-partition
  access; recall ~1/N vs whole-dataset ground truth)
- INLINE_FILTER equality label filter; NumGE not advertised (search '=' only)
- cosine / euclidean / dotproduct metrics; TopK capped at the API max of 100
- registered in the DB enum and CLI; 'dynamodb' extra (boto3>=1.40.0)
- offline unit tests for config, metrics, partition key, scoped search,
  filters, throttling backoff, and CLI wiring
@eddy-aws
eddy-aws force-pushed the add-dynamodb-vector-client branch from a456e3b to 503bba4 Compare October 6, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants