Choosing a Vector Database on AWS
This lesson explains the AWS vector database options, which store embeddings with metadata and return the most similar vectors, and how to choose one from a scenario's specifications.
Learning outcomes
After completing this lesson, you will be able to:
- Describe vector search in Amazon OpenSearch Service.
- Use pgvector on RDS and Aurora PostgreSQL.
- Identify Amazon S3 Vectors and other stores.
- Choose a vector database for a requirement.
Amazon OpenSearch Service
OpenSearch Service supports k-NN vector search alongside full-text search, so a single query can combine keyword relevance (BM25) and vector similarity in hybrid search. It is available as managed domains, where you size instances, shards and replicas, and as OpenSearch Serverless vector search collections, which scale capacity automatically. It suits low-latency, high-query-rate applications, hybrid search and rich filtering, and is the default vector store for Bedrock Knowledge Bases quick creation.
Domain or Serverless?
PostgreSQL with pgvector
The pgvector extension adds a vector data type and similarity search operators to Amazon RDS for PostgreSQL and Amazon Aurora PostgreSQL. Vectors are stored in ordinary tables alongside relational data, so a single SQL query can join, filter and rank by similarity, with transactional consistency between vectors and the business data they describe.
pgvector suits teams already running PostgreSQL, which avoids adding and operating another database, and applications in which vectors and business data change together, such as product descriptions and their embeddings. Aurora PostgreSQL is also a supported vector store for Amazon Bedrock Knowledge Bases.
Amazon S3 Vectors and other stores
Amazon S3 Vectors adds vector buckets and vector indexes to S3. It stores up to two billion vectors per index with sub-second query latency, no infrastructure and the lowest storage cost, which suits large collections queried infrequently, such as archives and long-tail RAG content. Amazon Neptune Analytics combines graph and vector search for GraphRAG. Amazon DocumentDB and Amazon ElastiCache also offer vector search for teams already using them.
The following table summarises the choice.
| Requirement | Best fit |
|---|---|
| Hybrid keyword and vector search, high query rate, low latency | OpenSearch Service or Serverless |
| Vectors next to relational data with SQL joins | RDS or Aurora PostgreSQL with pgvector |
| Very large, infrequently queried collection at lowest cost | Amazon S3 Vectors |
| Relationships between entities (GraphRAG) | Neptune Analytics |
| No vector infrastructure decisions for a quick RAG prototype | Knowledge base quick create (OpenSearch Serverless or S3 Vectors) |
The following diagram matches three teams' needs, a high-traffic chatbot, an order system on Aurora and a large legal archive, to a vector store for each.

Choose the vector store
Three teams, three stores
Three teams in one company describe their needs.
| Team need | Choice | Reason |
|---|---|---|
| Customer chatbot, 2 million chunks, 200 queries per second, product codes in questions | OpenSearch Serverless with hybrid search | Low latency at high rate; keyword matching for codes |
| Order system on Aurora PostgreSQL wants similar-product suggestions joined with stock levels | Aurora PostgreSQL with pgvector | One SQL query joins vectors with inventory |
| Legal archive of 900 million clauses searched a few times a day | Amazon S3 Vectors | Lowest cost at very large scale with sub-second queries |
Forcing all three onto one store would either overpay for the archive or add latency and complexity for the chatbot.
Which vector store suits vectors that must be joined with relational data in transactions?
Show answer
pgvector on RDS or Aurora PostgreSQL.
Exam Tips
Remember for the exam
- Hybrid search and high query rates: OpenSearch Service.
- Vectors with relational joins and transactions: pgvector on RDS or Aurora PostgreSQL.
- Huge, rarely queried vector sets at lowest cost: S3 Vectors.
- Graph relationships plus vectors: Neptune Analytics (GraphRAG).
- Index dimensions must equal the embedding model's output dimensions.