ScaNN

active

by Google Research · since 2020 · also known as Scalable Nearest Neighbors

Google Research's ANN library using anisotropic quantization; the tech behind Vertex AI and AlloyDB vectors.

vectorembedded libraryopen source (permissive)mature

Overview

ScaNN (Scalable Nearest Neighbors) is Google Research's library for maximum inner product and Euclidean vector search. It combines tree-based partitioning with anisotropic vector quantization, which weights quantization error by its effect on inner-product ranking, and the SOAR technique for better spill-over indexing. It consistently ranks near the top of ANN benchmarks and underlies Google's managed Vertex AI Vector Search and the ScaNN index in AlloyDB. Released for research use via pip on Linux x86 (AVX/FMA) and ARM, it is a library rather than a database.

Strengths & trade-offs

Strengths

  • +Anisotropic quantization gives excellent recall at high speed
  • +Top-tier results on public ANN benchmarks
  • +Same algorithm family as Google's production services
  • +Optional TensorFlow integration

Trade-offs

  • −Linux-only wheels; needs AVX/FMA or NEON
  • −Lives inside the sprawling google-research monorepo
  • −No persistence layer, server or metadata filtering
  • −Released 'for research purposes' with limited support

Great for

  • +High-throughput batch similarity search
  • +ANN research and benchmarking
  • +Embedding retrieval inside Python ML pipelines

Think twice for

  • −macOS/Windows developers
  • −Applications needing a full database

Capabilities

Native or official first-party support · 3 of 25 tracked

✓Vector search
✓In-memory
✓Compression
–Transactions
–Joins
–Secondary indexes
–Full-text search
–Geospatial
–JSON
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–Columnar storage
–Durable persistence
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Large · ≤ 1 PB
Horizontal scaling
Manual
Multi-region
No
Transactions
None
Consistency
Strong
Schema
Schemaless
Architecture
Embedded, In memory
Query languages
Python API, C++ API

Single-process library; Google's managed services distribute it at billion scale.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

apis & protocolsPython, C++, TensorFlow ops
client languagesPython, C++

Alternatives to ScaNN

Compare all→
FaissVector44.7

Meta's C++/Python library for fast dense-vector similarity search and clustering, CPU and GPU.

scann vs faiss →
hnswlibVector15.5

Header-only C++ HNSW library with Python bindings, from the authors of the HNSW algorithm.

scann vs hnswlib →
USearchVector23.1

Single-header C++ HNSW library with SIMD distance kernels and bindings for a dozen languages.

scann vs usearch →
Vertex AI Vector SearchVector21.2

Google Cloud's managed ANN service built on ScaNN, now part of Gemini Enterprise Agent Platform.

scann vs vertex-ai-vector-search →
AlloyDB for PostgreSQLRelational3.6

Google's Postgres-compatible service with disaggregated storage, a columnar engine and ScaNN vectors.

scann vs alloydb →
ValdVector5.6

Kubernetes-native distributed vector search engine built on Yahoo Japan's NGT.

scann vs vald →

ScaNN FAQ

What is ScaNN?

ScaNN is a vector database by Google Research, first released in 2020. ScaNN (Scalable Nearest Neighbors) is Google Research's library for maximum inner product and Euclidean vector search. It combines tree-based partitioning with anisotropic vector quantization, which weights quantization error by its effect on inner-product ranking, and the SOAR technique for better spill-over indexing. It consistently ranks near the top of ANN benchmarks and underlies Google's managed Vertex AI Vector Search and the ScaNN index in AlloyDB. Released for research use via pip on Linux x86 (AVX/FMA) and ARM, it is a library rather than a database.

Is ScaNN open source?

Yes. ScaNN is open source. License: Apache License 2.0.

Does ScaNN support ACID transactions?

No. ScaNN does not provide ACID transactions; its consistency model is strong.

Does ScaNN scale horizontally?

ScaNN has no built-in sharding; scaling out means partitioning data in your application. It is comfortable at large scale (≤ 1 PB).

How can I run ScaNN?

You can self-host it and embed it in your application.

What is ScaNN best for?

ScaNN is a strong fit for high-throughput batch similarity search; ANN research and benchmarking; and embedding retrieval inside Python ML pipelines. Think twice for macOS/Windows developers.

What are the best alternatives to ScaNN?

Common alternatives to ScaNN include Faiss, hnswlib, USearch, Vertex AI Vector Search and AlloyDB for PostgreSQL. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is ScaNN?

ScaNN ranks #365 of 844 databases on the WhichDB Score (6.3/100), and #22 among vector databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.