Home
Vector Database

Deploy Milvus Vector Database on AWS in 5 Minutes

Building AI applications? You need a vector database. Milvus is the leading open-source vector database, handling billions of vectors with sub-millisecond search. Here's how to deploy it on AWS in minutes.

8 min read FlowOps Consulting

What's Included

  • Milvus 2.4 Standalone with Docker
  • HNSW and IVF indexing for fast similarity search
  • PyMilvus Python SDK integration
  • Authentication and RBAC enabled
  • Prometheus metrics and monitoring
  • Separate 20GB EBS data volume
  • S3 backup integration ready

Step-by-Step Guide

1

Launch the AMI

Find "Milvus FlowOps" on AWS Marketplace, select your instance type (m5.large minimum), and launch.

# Recommended instance types: # m5.large (8GB) - Development, up to 500K vectors # r5.xlarge (32GB) - Production, up to 5M vectors # r5.2xlarge (64GB) - Large scale, up to 15M vectors
2

Connect and Get Credentials

SSH into your instance and retrieve the auto-generated root password.

ssh -i your-key.pem ubuntu@your-instance-ip # View credentials sudo cat /opt/flowops/credentials.txt # Check Milvus is running (wait ~90 seconds for startup) curl http://localhost:9091/healthz
3

Create a Collection

Connect with PyMilvus and create your first vector collection.

from pymilvus import connections, Collection, FieldSchema, CollectionSchema, DataType # Connect to Milvus connections.connect(host="localhost", port="19530", user="root", password="your-password") # Define schema for RAG documents fields = [ FieldSchema("id", DataType.INT64, is_primary=True, auto_id=True), FieldSchema("embedding", DataType.FLOAT_VECTOR, dim=1536), # OpenAI dimensions FieldSchema("text", DataType.VARCHAR, max_length=65535), FieldSchema("metadata", DataType.JSON) ] schema = CollectionSchema(fields, "RAG documents") collection = Collection("documents", schema) # Create HNSW index for fast search collection.create_index("embedding", { "index_type": "HNSW", "metric_type": "COSINE", "params": {"M": 16, "efConstruction": 256} })
4

Insert and Search Vectors

Store document embeddings and perform similarity search.

import openai def get_embedding(text): response = openai.embeddings.create( model="text-embedding-3-small", input=text ) return response.data[0].embedding # Insert documents docs = [ {"text": "Milvus is a vector database for AI", "metadata": {"source": "docs"}}, {"text": "RAG combines retrieval with generation", "metadata": {"source": "blog"}} ] embeddings = [get_embedding(d["text"]) for d in docs] texts = [d["text"] for d in docs] metadata = [d["metadata"] for d in docs] collection.insert([embeddings, texts, metadata]) collection.flush() # Search for similar documents collection.load() results = collection.search( data=[get_embedding("How do I build AI search?")], anns_field="embedding", param={"metric_type": "COSINE", "params": {"ef": 64}}, limit=5, output_fields=["text", "metadata"] ) for hits in results: for hit in hits: print(f"{1-hit.distance:.3f}: {hit.entity.get('text')}")

Comparison

FeatureMilvusPineconeWeaviate
Open SourceYes (Apache 2.0)NoYes
Self-HostedYesNoYes
Billion ScaleYesYesLimited
Hybrid SearchYesYesYes
Cost ControlYou controlPay per queryYou control

Use Cases

  • Semantic search engines
  • RAG (Retrieval-Augmented Generation)
  • Recommendation systems
  • Image/video similarity search
  • Anomaly detection
  • Drug discovery

Pricing

Our AMIs are available on AWS Marketplace with simple hourly pricing:

Need Help?

Our UK-based support team is here to help you get the most out of your deployment. Email us at support@flowopsconsulting.co.uk for any questions.

Ready to Get Started?

Deploy in 5 minutes on AWS Marketplace

View on AWS Marketplace

Comments