Articles

Amazon DynamoDB Adds Real‑Time Vector Search at Any Scale – What You Need to Know

Amazon DynamoDB now offers general‑availability vector search, letting you store embeddings alongside operational data and run similarity queries with single‑digit millisecond latency. Learn how the serverless feature works, its key capabilities, and how to get started.

Written by:
APin

Senior Technology Analyst • Verified Expert

More from this author
Amazon DynamoDB Adds Real‑Time Vector Search at Any Scale – What You Need to Know

Amazon DynamoDB now offers general‑availability vector search, letting you store embeddings alongside operational data and run similarity queries with single‑digit millisecond latency. Learn how the serverless feature works, its key capabilities, and how to get started.

Introducing Vector Search in DynamoDB

AWS announced the general availability of native vector search in Amazon DynamoDB. The feature adds a new index type that can be defined on any attribute containing a list of floating‑point numbers, allowing similarity queries to be executed directly against the same table that holds the application’s operational data.

Vector embeddings are stored using DynamoDB’s existing List data type; each element is a Number representing a single float from the embedding vector. Because the schema does not change, developers can enrich items such as productId, price, or timestamp with an additional attribute (e.g., descriptionEmbedding) via a standard PutItem or UpdateItem call. This eliminates the need for a separate vector database and the associated data‑movement pipelines.

When creating a vector index you must specify:

  • Number of dimensions (up to 4 096).
  • Distance function – Cosine, Euclidean, or Dot product. The choice should match the metric used during model training for optimal recall.
  • Optional partition key to distribute vectors across partitions and enable scoped searches.
  • Inline filter attributes for exact‑match filtering at query time.

Practical example – adding semantic search to a product catalog:

  1. Generate text embeddings for each product description using a model such as Amazon Bedrock Titan Text Embeddings.
  2. Store the embedding list in a new attribute descriptionEmbedding on the ProductCatalog table.
  3. Create a vector index named ProductDescriptionIndex on that attribute, select Cosine distance, and set marketplace as the partition key with category as an inline filter.
  4. Issue a SearchVectors request with a query vector derived from a natural‑language query, a top‑K value (≤ 100), and optional filter values (e.g., category = 'footwear').

The service delivers single‑digit millisecond latency and 99 %+ recall while scaling horizontally to trillions of vectors. Because it is fully serverless, there are no servers to provision, patch, or manage, and the same pay‑per‑request pricing model applies to both operational and vector workloads.

For teams already using DynamoDB, the recommended approach is to augment existing tables with embedding attributes and enable a vector index rather than deploying a dedicated vector store. This reduces operational overhead, eliminates synchronization complexity, and provides predictable low‑latency similarity search at any scale.

Key Features and Technical Capabilities

Vector search in Amazon DynamoDB is implemented as a native index type that can be added to any existing table. The index stores embeddings as a List<Number> attribute, allowing the same table schema to hold both operational data and high‑dimensional vectors without schema changes.

  • Supported dimensions: up to 4096 per embedding, matching the output of most large‑scale language models.
  • Distance functions: Euclidean, Cosine, and Dot product. Choose the function that aligns with the training objective of your embedding model (e.g., Cosine for semantic text similarity).
  • Storage limits: vector indexes have no predefined storage ceiling; they grow horizontally as data is added.
  • Horizontal scaling: the index is partitioned by a user‑defined partition key, enabling DynamoDB to distribute vectors across partitions and maintain single‑digit‑millisecond latency at any scale.
  • Inline filter attributes: non‑vector attributes (e.g., category) can be declared as filter attributes, allowing exact‑match filtering at query time without a separate scan.
  • API limits: the SearchVectors operation returns up to 100 results per request (the “Top K” parameter).
  • Serverless benefits: no servers to provision or patch, no versioning, and zero‑downtime maintenance; the service operates on a pay‑per‑request model.

Practical example

Assume a product‑catalog table with a descriptionEmbedding attribute. To create a vector index for the US marketplace and enable category filtering:

aws dynamodb create-index \
  --table-name ProductCatalog \
  --index-name ProductDescriptionIndex \
  --vector-attribute descriptionEmbedding \
  --dimensions 768 \
  --distance-function COSINE \
  --partition-key marketplace \
  --inline-filter-attributes category

To query for “lightweight running shoes for summer” and retrieve the top 5 footwear items in the US market:

{
  "TableName": "ProductCatalog",
  "IndexName": "ProductDescriptionIndex",
  "QueryVector": [0.12, -0.03, …],   // 768‑dimensional query vector
  "TopK": 5,
  "PartitionKeyValue": "US",
  "FilterExpression": "category = :cat",
  "ExpressionAttributeValues": { ":cat": "footwear" }
}

The response includes the five most similar items, each with its standard attributes (e.g., name, price) and a similarity score whose interpretation depends on the chosen distance function (lower scores for Euclidean/Cosine, higher for Dot product).

Because the index is serverless, scaling to trillions of vectors requires no operational changes; DynamoDB automatically adds partitions, preserves latency, and eliminates maintenance windows.

How to Enable Vector Search – Step‑by‑Step Walkthrough

Vector search in Amazon DynamoDB works by storing a numeric embedding alongside each item and creating a dedicated vector index that can be queried with a similarity metric. An embedding is a fixed‑length list of floating‑point numbers that represents the semantic meaning of a text field (for example, a product description). When two items have similar meanings, their vectors are close in the chosen distance space, enabling similarity search without a separate vector database.

Step 1 – Prepare the table and add embeddings

Generate embeddings for the attribute you want to search (e.g., description) using one of the supported models: Amazon Bedrock Titan Text Embeddings, Cohere Embed, or OpenAI text‑embedding models. Store the result in a new attribute, such as descriptionEmbedding, using a standard PutItem or UpdateItem call. DynamoDB’s native List type holds the vector, with each element being a Number (float).

aws dynamodb update-item \
    --table-name ProductCatalog \
    --key '{"productId":{"S":"12345"}}' \
    --update-expression "SET descriptionEmbedding = :vec" \
    --expression-attribute-values '{":vec":{"L":[{"N":"0.12"},{"N":"-0.07"}, …]}}'

Step 2 – Create the vector index

In the DynamoDB console, open the table’s Indexes tab and choose Create vector index. Fill in the required fields:

  • Index name: e.g., ProductDescriptionIndex
  • Vector attribute: descriptionEmbedding
  • Dimensions: match the output size of the embedding model (up to 4096)
  • Distance function: Cosine, Euclidean, or Dot product (choose the one used during model training)
  • Partition key (optional but recommended): e.g., marketplace to isolate queries per market
  • Inline filter attributes: add non‑vector fields such as category for exact‑match filtering

Leave the projection set to All if you need the full item in the response, then create the index and wait for its status to become Active.

Step 3 – Execute a search

Generate a query vector from the user’s natural‑language input using the same embedding model. You can run the search either from the console or programmatically with the SearchVectors API.

aws dynamodb search-vectors \
    --table-name ProductCatalog \
    --index-name ProductDescriptionIndex \
    --query-vector file://query-vector.json \
    --k 5 \
    --partition-key-value US \
    --filter-expression "category = :cat" \
    --expression-attribute-values '{":cat":{"S":"footwear"}}'

The response contains up to 100 items (top‑K) ranked by similarity score. For Cosine and Euclidean distances, lower scores indicate higher similarity; for Dot product, higher scores indicate higher similarity.

By keeping embeddings in the same DynamoDB table as operational data, you avoid data duplication, reduce latency to single‑digit milliseconds, and rely on DynamoDB’s serverless scaling and built‑in security controls (e.g., IAM, encryption at rest, and compliance with SOC 2, ISO 27001, and NIST standards).

Real‑World Use Cases and Benefits

Semantic retrieval relies on vector embeddings that capture the meaning of text, images, or signals. By storing these embeddings alongside operational attributes in a single data store, an application can issue a similarity query and receive results that are ranked by semantic closeness without a separate indexing pipeline.

Amazon DynamoDB’s native vector search enables this pattern directly on the operational table. Vectors are stored in the existing List data type, and a dedicated vector index can be created on any attribute that holds the embedding. The index supports up to 4 096 dimensions and three distance functions—Cosine, Euclidean, and Dot product—allowing the developer to match the metric used during model training. Queries are executed through the SearchVectors API, which returns the top‑K results (up to 100) together with the original item attributes.

Typical enterprise scenarios that benefit from this integration include:

  • Semantic retrieval: Users search product catalogs or knowledge bases with natural language; the system returns items whose description embeddings are closest to the query embedding.
  • Retrieval‑augmented generation (RAG): A generation model queries DynamoDB for context documents, reducing latency compared to fetching from a separate vector store.
  • Recommendation engines: By storing user‑item interaction vectors, similarity searches can produce real‑time recommendations without an external service.
  • Personalized experiences: Inline filter attributes (e.g., category or marketplace) let the same query be scoped to a segment, delivering tailored results at query time.
  • Anomaly detection: Embeddings of telemetry streams are indexed; outlier vectors are identified by low similarity scores, enabling near‑real‑time alerts.

Because the vector index lives in the same serverless infrastructure as the operational data, the following operational benefits are realized:

  • Elimination of data‑movement pipelines and associated licensing costs.
  • Zero server provisioning, patching, or version management, aligning with SOC 2 and ISO 27001 requirements for managed services.
  • Predictable low latency—single‑digit millisecond response times with 99 %+ recall—across any scale, including trillions of vectors.
  • Horizontal scaling of storage and throughput without manual sharding, supporting consistent performance under high query volumes.

To adopt this approach, engineers generate embeddings with a model of choice (e.g., Amazon Bedrock Titan, Cohere, or OpenAI), store them via a standard PutItem or UpdateItem call, create a vector index specifying the dimension count and distance function, and then issue SearchVectors requests with optional filter conditions. This workflow removes the need for a separate vector database, reduces operational overhead, and maintains a unified security and compliance posture.

Operational Considerations: Pricing, Regions, and Best Practices

Vector search in Amazon DynamoDB is generally available across all commercial AWS Regions, including AWS GovCloud (US) Regions. The service utilizes the standard DynamoDB pay-per-request pricing model, eliminating the need to provision or manage separate infrastructure for vector-specific workloads. Because vector embeddings are stored as list attributes within existing tables, they share the same operational cost structure as standard DynamoDB items.

Selecting the appropriate index configuration is critical for maintaining performance and retrieval accuracy. When creating a vector index, ensure the specified number of dimensions matches the output of your chosen embedding model (e.g., Amazon Bedrock Titan, Cohere, or OpenAI models). Furthermore, align your distance function with the model's training methodology:

  • Cosine: Best for comparing semantic similarity in text embeddings, as it measures the angle between vectors rather than magnitude.
  • Euclidean: Optimal when vector magnitude is significant, such as when clustering items by numeric intensity or purchase volume.
  • Dot Product: Recommended for recommendation engines where both vector direction and magnitude are required to weight interest alignment and frequency.

For large-scale datasets, define a partition key when creating the index. This limits search scope to a specific partition—such as a marketplace or tenant_id—which facilitates horizontal scaling and ensures consistent, low-latency performance. Index management also supports inline filtering, which allows for narrowing search results using exact-match conditions on non-vector attributes (e.g., category). Note that inline filters do not support range conditions like BETWEEN or BEGINS_WITH.

To optimize accuracy, verify similarity scoring expectations: for Cosine and Euclidean functions, lower scores signify higher similarity, whereas, for Dot Product, higher values indicate closer proximity. By co-locating embeddings with operational data, teams avoid the synchronization pipelines and data movement overhead associated with maintaining disparate vector and operational database systems.

Editorial Policy & Research Methodology

Our findings are based on rigorous internal research, verified industry benchmarks, and direct technical implementation experience from our enterprise client projects. All statistics and technical claims are reviewed by senior engineers before publication to ensure accuracy, transparency, and helpfulness for our readers.

Have an Idea?

Let's Build Something Amazing Together.