Storage Architecture in LanceDB

LanceDB is among the only vector databases built on top of multiple modular components designed from the ground-up to be efficient on disk. This gives it the unique benefit of being flexible enough to support multiple storage backends, including local NVMe, EBS, EFS and many other third-party APIs that connect to the cloud.

It is important to understand the tradeoffs between cost and latency for your specific application and use case. This section will help you understand the tradeoffs between the different storage backends.

Storage Backend Selection Guide

We’ve prepared a simple diagram to showcase the thought process that goes into choosing a storage backend when using LanceDB OSS, Cloud or Enterprise.

When architecting your system, you’d typically ask yourself the following questions to decide on a storage option:

  1. Latency: How fast do I need results? What do the p50 and also p95 look like?
  2. Scalability: Can I scale up the amount of data and QPS easily?
  3. Cost: To serve my application, what’s the all-in cost of both storage and serving infra?
  4. Reliability/Availability: How does replication work? Is disaster recovery addressed?

Storage Backend Comparison

This section reviews the characteristics of each storage option in four dimensions: latency, scalability, cost and reliability.

We begin with the lowest cost option, and end with the lowest latency option.

1. Object Storage (S3 / GCS / Azure Blob)

💡 Lowest cost, highest latency

Another important point to note is that LanceDB is designed to separate storage from compute, and the underlying Lance format stores the data in numerous immutable fragments. Due to these factors, LanceDB is a great storage option that addresses the N + 1 query problem. i.e., when a high query throughput is required, query processes can run in a stateless manner and be scaled up and down as needed.

2. File Storage (EFS / GCS Filestore / Azure File)

💡 Moderately low cost, moderately low latency (<100ms)

A recommended best practice is to keep a copy of the data on S3 for disaster recovery scenarios. If any downtime is unacceptable, then you would need another EFS with a copy of the data. This is still much cheaper than EC2 instances holding multiple copies of the data.

3. Third-party Storage Solutions

Solutions like MinIO , WekaFS, etc. that deliver S3 compatible API with much better performance than S3.

💡 Moderately low cost, moderately low latency (<100ms)

4. Block Storage (EBS / GCP Persistent Disk / Azure Managed Disk)

💡 Very low latency (<30ms), higher cost

Just like EFS, an EBS or persistent disk setup requires more manual work to manage data sharding, backups and capacity.

5. Local Storage (SSD/NVMe)

💡 Lowest latency (<10ms), highest cost

As a rule of thumb, local disk should be your storage option if you require absolutely crazy low latency and you’re willing to do a bunch of data management work to make it happen.