A Broke B**ch’s Guide to Tech Start-up: Choosing Vector Database — Part 2 Cloud/Serverless Prices

Soumit Salman Rahman
8 min readJun 4, 2024

--

In my last blog I talked about options for self-hosted vector databases. Yes the subscription is free but “es gon’ cost ya”

  1. Compute Cost: These DBs need a minimum CPU and RAM to run. Whether you host them as Container, Web app, Function app or VM, the longer the uptime the bigger that bill is going to look like.
  2. Storage Cost: Most of the cloud platform providers come with a min volume of File storage for free and it is in scale of Terabytes (AKA a f**k load of data). This is great text for documents and vector storage. But they will charge you a fee to back up the Files on a regular basic. Now that may be less than a dollar a day (e.g. Azure) but at the end of the month, there is still a bill.
  3. Ingress/Egress Cost: Which ever mode you host it as (Container, Web App, Function, VM) cloud providers have a monthly cap on the volume of data you can either receive, send or both. And beyond that cap there is a non-insignificant price. The initial cap is generally quite good for a starter project (e.g. Digital Ocean has no ingress cap and has a 50GB/month of egress cap). Specially with text data and vectors, that’s more than what you can smoke out in a month (just don’t try to run a p*rn site out of it).
  4. Maintenance Cost: Guess what, now you need people to do SRE work and regular patching to keep the infra running. That’s time going away from people who could spend the same time doing something else.
Courtesy of DALL-E

So What Now?

The other option is using the cloud hosted endpoints from DB vendors providing managed storage service. I have played with a bunch, some companies are quite generous and while some others will make sure you get off the free tier even if you look at them the wrong way.

#warning: Having tried to optimize for the capacity and capabilities of the free tiers I will highly recommend that you DO NOT do that in your first spin up of the product. Optimize for developer velocity and choose something that you find easy to code in (for me this is anything not SQL). Because even though you might be tempted to choose one DB for all your storage needs, very quickly you will be swallowing truth pill that you will need more than one type of DBs to accommodate different use cases. It’s not a pleasant realization. But if you already know that you are a gentleman and a scholar.

Now that all my blabbering is done, here is a list of the free/semi-free tiers of managed-instances of vector databases —

MongoDB Atlas

Mongo Atlas provides a whole range of options including serverless, dedicated and shared instance for your vector DB needs. You can also have these instances running in your preferred cloud provider like Azure, GCP, AWS (DigitalOcean has its own mechanism of deploying a dedicated MongoDB instance).

Free Tier (M0): It offers a shared compute instance that comes with ONLY 512 MB of storage. AFAIK, it allows only one vector index: meaning if you have 2 or more vector fields or collections with vector fields you are $hit-outta-luck. It is nothing to write to home about but decent enough just for initial learning purpose and not necessarily making your first launch.

Paid Tier (M10): There are multiple different paid tiers giving you flexibility over your storage and compute volume. But to make things simpler I will talk about the M10 tier. If you are deadset on using Mongo Atlas for the visible future, I am going suggest that you skip past all of the rate calculation of the serverless tier and get yourself a flat rate M10 instance for $57 a month. It comes with 10GB storage + 2 Gi RAM + 2 vCPU which is not all that bad.

Azure CosmosDB for MongoDB

Technically this is not really MongoDB. It is Azure CosmosDB with Mongo wire protocol. Which means whatever code you write for mongo would mostly work here. With that said there some minor caveats in set up and creation of indexes. You can read the following article for learning more about how to set up a RAG pipeline using Azure CosmosDB for MongoDB

Despite some of the caveats Azure Cosmos DB for MongoDB (vCore) is a solid started choice given their pricing and performance.

Free Tier: It comes with 32-GB of storage, a DEDICATED cluster and NO restriction on the number of indexes (or is it indices?) you can have (e.g. I have 6).

The free tier lasts for the lifetime of your account, boasting command and feature parity with a regular Azure Cosmos DB for MongoDB (vCore) account. It makes it easy for you to get started, develop, test your applications, or even run small production workloads for free. Users can provision a single free DB server per supported Azure region for a given subscription.

Neo4j AuraDB

AuraDB is the managed & serverless version of Neo4j deployment. Although this is primarily known as a graph DB, Neo4j team added the ability to include vector fields as part of nodes and query by vector data through Cipher. AuraDB always had a free tier and the vector capabilities are now part of it.

Free Tier: Forever free but one managed instance of the database. There is also a cap of 200k nodes and 400k relationships allowed in the database. There is no mention of the actual volume of data but it may be safe to assume that it is not more than their next paid tier (64 GB). To me this is decent for your first couple of customers but nothing beyond that.

Pair Tier: There are multiple levels of paid tier. The first paid tier comes at $65/month. It has 64GB cap on storage per DB instance but no cap on the number of DB instances you can have.

Design considerations: AuraDB is still optimized for graph relations and not necessarily vector storage/query. Vector storage and query is an added feature on top of metadata based query. Also if you are dealing with multimedia/videos/images, store those blobs in something like an Azure File or Blob storage and use Neo4j for the vector and the metadata.

KDB.AI Cloud

As mentioned in the my last article, KDB is originally an RDBMS optimized for time-series analysis. KDB.AI is essentially KDB with vector field support. The last 3 options I talked about are NoSQL document DBs with vector support. So if you are looking for an relational database KDB.AI kicks b*tt!

Free Tier: 30 GB of storage, 4 Gi RAM and NO cap on the number of indices or size of the vector.

#internal-thought-bubble: It was precisely at this moment when I realized that I am writing about vector DBs and NOT ONE of ones I mentioned are vector native 😒. These are all DBs optimized/designed for something else and now happens to have vector capabilities.

Pinecone

Pinecone is a vector native DB that also provides scalar metadata based filtering. Given its speed, performance and library integrations it has been taking over the RAG world by storm. Pinecone only offers varying scale of serverless hosted instances and do NOT have public docker image.

Free Tier: Comes with 2 GBs of storage which is about 300k data objects which 1536 dimension vectors (if you are using text-embedding-ada-*). It also has a cap of 2M Write Units and 1M Read Units per month. So you should write your code for doing batch transactions and perhaps think twice about linking it directly to your UI code. Also you can have max 1 Project (i.e. 1 DB but multiple collections) and have 5 indexes max across the DB.

Paid Tier: Pinecone has couple of flexible paid tiers. If you don’t want the restriction on number of projects or indices, it seems that the next closest tier will cost you around $12.25 for the same volume of storage and read/write volumes.

Qdrant Cloud

This is also a vector native DB. I poked around it for a brief period of time so I don’t have a decent enough understanding their “buttons”. In any case they also have a free-tier.

Free Tier: 1GB of storage and free forever cluster. Allows you to deploy your cluster in Azure, GCP or AWS. It does not seem to have other restrictions.

Paid Tier: There seems to be a Hybrid Cloud option that allows integration from existing on prem systems and comes with a $99/month min.

Bring your own cluster from any cloud provider, on-premise infrastructure, or edge locations and connect them to the managed cloud

Weaviate

Similar to Pinecone and Qdrant this is a vector native DB. But unlike them, Weaviate is the king of penny-pinching! I am surprised they released a free docker image. Because looking at their free-tier instance “the math ain’t mathing bro”.

Free Tier: There is an education-&-learning serverless instance available ONLY for 14 days. After that it goes into the paid tiers.

Pair Tier: The min paid tier is $25/month. You can have 1M objects with large vector dimensions (4096). And beyond that they will penny pinch for the size of your dimensions, number of rows/data objects, data compression, and RAM usage. In other words —

GET THE F**K OUTTA HERE

Honestly, if you want to use Weaviate, just host the docker image as an Azure Container App or DigitalOcean App platform.

Nomic Atlas

Ok so this is not really a database but more a platform for storing unstructured data like large text, images, videos that provides vector search AND clustering capability through APIs. Clustering is a neat feature because the other databases will not perform automatic clustering for you. It also has data ingestion integration with local files and other vector DBs like Mongo, Pinecone etc.

Free Tier: You can get 1M data objects for free. The catch is that the data is viewable by anyone with a link. Also this is primarily built for text data and comes with web UI based functionality for visualizing clustering of texts that are similar to each other. It does not distinguish between the volume of data but rather the number of different data points.

My Leaderboard

🏆Vector Native Self Hosted: My top is self-hosted ChromaDB docker image given the ease of use and the flexibility of self-hosting.

🏆Vector Native Cloud: If you don’t want to deal with hosting your own instance, Pinecone all the way!

🏆General purpose: If you want to start with one stack for all your DB needs Azure CosmosDB for MongoDB (or as I call it Diet MongoDB) is hands down the best option. I have been using it and I make up for the missing features by processing them in the code.

🏆Time series analysis: If you need time-series analysis and have the data integrity enforcement of relational database, KDB.AI Cloud is a clear winner. Honestly I wouldn’t mind using this as a general purpose DB either.

🏆Knowledge graph: If your primary use case requires dealing with knowledge graphs or essentially relationships between data objects (and you don’t want to deal with foreign key management) I will choose self-hosted version of Neo4j docker image over AuraDB free tier.

What about Postgres/pgvector?

I don’t “Postgres” or anything SQL for that matter.

Frankly enough, if you do need a relational database KDB.AI is just better and faster. If you need to enforce data integrity you can do that in your code and it will be faster. Unless you are intimately familiar with Postgres, there is no conceivable reason to use it.

And on that note, ✌️until the next one …

PS

--

--