Serverless Database for Vector Search & GenAI

Vector Search, Knowledge Graph Storage, Unstructured JSON Storage, Metadata Filtering, all in one, with usage-based pricing and automatic scaling.

Trusted by teams in different industries

AmzTrendsChaintoolDify

Your AI stack, Simplified.

TiDB Serverless is a full-featured SQL database for all your AI application needs. One database to rule them all:

Say goodbye to data synchronization, duplication, or maintaining multiple data stores.

1# Define schema
2class Doc(Base):
3    __tablename__ = "doc"
4    id = Column(Integer, primary_key=True)
5    content = Column(Text)
6    embedding = Column(VectorType(dim=3))
7
8# Create table and index
9Base.metadata.create_all(engine)
10VectorAdaptor(engine).create_vector_index(
11    Doc.embedding, tidb_vector.DistanceMetric.L2
12)
13
14# Insert
15with Session(engine) as session:
16    session.add(Doc(content="dog",  embedding=[1, 2, 1]))
17    session.add(Doc(content="fish", embedding=[1, 2, 4]))
18    session.commit()
19
20# Search nearest 1 embedding using L2 distance
21with Session(engine) as session:
22    results = session.execute(
23        select(Doc.content)
24        .order_by(Doc.embedding.l2_distance([1, 2, 3]))
25        .limit(1)
26    ).all()
27    print(results)

No provision, No capacity planning

Pay only for what you actually use

  • Bill for computing hours, stored data size and network traffic.
  • Free 25GiB storage/month and 250 million RU/month.
  • Zero cost when idle.
Vector dimension:
768
5127681536
Rows in table:
1M
01M2M3M4M
Write Rows:
1M
01M2M3M4M
Read Queries:
100K
0200K400K600K800K1M
Estimated storage cost:
$1.32 per month
Estimated request cost:
$5.15
Estimated cost does not include network transfer fee and the usage of non-vector data. Pricing Details

Our free Serverless offering is the fastest way for you

  • No credit card required.
  • 25GiB/month free storage.
  • Database ready in less than 1 minute.
  • Full vector search & AI features.
  • Suitable for both development and production.
OR

Local development

Run TiDB locally with full features
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
~/.tiup/bin/tiup playground nightly --tag my_vector_db

* Supported platforms: Linux (x64 / ARM64), MacOS (x64 / ARM64)

Works with your AI stack

Integrations

TiDB works seamlessly with your existing AI stack, serving as a Vector Database and more.

To begin, paste your Connection String into any of the listed integrations for a quick start.

Explore all integrations

Dify logo

With TiDB, our users can concentrate on building their GenAI apps rather than worrying about setup. Our engineers have automated all database management tasks using TiDB's API, significantly reducing our time and effort. The scale-to-zero capability of TiDB lets us provide dedicated databases to our customers without the burden of idle resource costs.

Luyu Zhang
Luyu Zhang
Founder & CEO of Dify.AI

Enterprise-grade security

Ready for your production workloads

Compliant

We are in compliance with the latest industry standards: SOC2 Type II and SOC3 certified, EU CoC, PCI DSS and HIPAA compliant.

Get compliance reports

Secure

TiDB Serverless supports Role-based Access Control, Encryption at rest, Private Link, and more.

High Available

TiDB Serverless offers 99.9% uptime SLA and Zonal HA by default. Supports cross-AZ HA and automatic backups.

FAQ