Skip to content
Github

Architecture

VortexDB is a high-performance vector database built in Rust, designed with modularity and flexibility at its core.

VortexDB is organized as a Rust workspace with the following crates:

CratePurpose
serverMain entry point, configuration, server startup
apiCore database logic and error handling
grpcProtocol Buffers definitions and gRPC service
httpREST API handlers using Axum
indexVector indexing algorithms (Flat, KD-Tree, HNSW)
storagePersistence backends (InMemory, RocksDB)
snapshotPoint-in-time backup and restore
defsShared type definitions
tuiTerminal user interface

VortexDB exposes two APIs that share the same underlying database:

The gRPC layer is the primary high-performance interface:

  • Protocol: HTTP/2 with Protocol Buffers
  • Port: 50051 (default)
  • Authentication: API key via authorization header
  • Use cases: Production workloads, SDKs, high-throughput scenarios
service VectorDB {
rpc InsertVector(InsertVectorRequest) returns (PointID);
rpc DeletePoint(PointID) returns (google.protobuf.Empty);
rpc GetPoint(PointID) returns (Point);
rpc SearchPoints(SearchRequest) returns (SearchResponse);
}

The HTTP layer provides a RESTful interface:

  • Protocol: HTTP/1.1 with JSON
  • Port: 3000 (default)
  • Authentication: None (designed for internal/trusted networks)
  • Use cases: Quick testing, curl commands, prototyping
MethodEndpointDescription
GET/Root endpoint
GET/healthHealth check
POST/pointsInsert a point
GET/points/:idGet a point by ID
DELETE/points/:idDelete a point
POST/points/searchSearch for similar vectors
  • Building production applications
  • Using the Python SDK (it uses gRPC)
  • Need authentication
  • Processing high volumes of requests
  • Want strongly-typed client libraries

The storage layer persists vectors and their payloads using a trait-based design:

pub trait StorageEngine: Send + Sync {
fn insert(&self, vector: DenseVector, payload: Payload) -> Result<PointId>;
fn get(&self, point_id: PointId) -> Result<Option<Point>>;
fn delete(&self, point_id: PointId) -> Result<bool>;
fn checkpoint_at(&self, path: &Path) -> Result<StorageCheckpoint>;
fn restore_checkpoint(&mut self, checkpoint: &StorageCheckpoint) -> Result<()>;
}
BackendDescriptionUse Case
InMemoryStores data in RAMDevelopment, testing, ephemeral workloads
RocksDBLSM-tree persistent storageProduction deployments

Set the backend via the STORAGE_TYPE environment variable:

Terminal window
STORAGE_TYPE=rocksdb # or 'inmemory'

The index layer provides fast similarity search. See Indexers for details on choosing the right index.

pub trait VectorIndex: Send + Sync {
fn insert(&mut self, vector: IndexedVector) -> Result<()>;
fn delete(&mut self, point_id: PointId) -> Result<bool>;
fn search(&self, query: DenseVector, similarity: Similarity, k: usize) -> Result<Vec<PointId>>;
}

Here’s what happens when you insert a vector:

Client Request

Client sends insert request via gRPC or HTTP

Validation

Server validates vector dimensions match configuration

Storage Write

Vector and payload are persisted to the storage backend

Index Update

Vector is added to the index for fast searching

Response

Server returns the generated point ID to client

VortexDB is configured via environment variables:

VariableRequiredDefaultDescription
VORTEXDB_KEYS_FILEYes-Path to a JSON file of API keys shared by the HTTP and gRPC servers
DIMENSIONYes-Vector dimensionality
DATA_PATHNosystem temp dirDirectory for persistent storage
HTTP_HOSTNo127.0.0.1HTTP server bind address
HTTP_PORTNo3000HTTP server port
GRPC_HOSTNo127.0.0.1gRPC server bind address
GRPC_PORTNo50051gRPC server port
STORAGE_TYPENoinmemoryStorage backend: inmemory or rocksdb
INDEX_TYPENoflatIndex algorithm: flat, kdtree, or hnsw
SIMILARITYNocosineDefault metric: cosine, euclidean, manhattan, or hamming
LOGGINGNotrueEnable logging
DISABLE_HTTPNofalseRun gRPC only
HNSW_MNo16HNSW max connections per layer
HNSW_M0No2 * HNSW_MHNSW max connections for layer 0
HNSW_EF_CONSTRUCTIONNo200HNSW search breadth during construction
HNSW_EFNo100HNSW default search breadth at query time

VortexDB is designed for concurrent access:

  • The storage layer uses Arc for thread-safe reference counting
  • The index layer uses RwLock for concurrent reads with exclusive writes
  • Both gRPC and HTTP handlers are fully async using Tokio