Vector Database for AI

Scalable similarity search on unstructured data (such as image, video, and natural language) powered by https://milvus.io

Metadata Management in the Milvus Vector Database(1)

How to View Metadata

Milvus
Vector Database for AI
2 min readDec 25, 2019

--

We introduced some information about metadata in Managing Data in Massive-Scale Vector Database. This article mainly shows how to view the metadata of the Milvus vector database.

The Milvus vector database supports metadata storage in SQLite or MySQL. There’s a parameter backend_url (in the configuration file server_config.yaml) by which you can specify if to use SQLite or MySQL to manage your metadata.

SQLite

If SQLite is used, a meta.sqlite file will be generated in the data directory (defined in the primary_path of the configuration file server_config.yaml) after Milvus is started. To view the file, you only need to install a SQLite client.

Install SQLite3 from the command line:

sudo apt-get install sqlite3

Then enter the Milvus data directory, and open the meta file using SQLite3:

sqlite3 meta.sqlite

Now, you’ve already entered the SQLite client command line. Just use a few commands to see what is in the metadata.

To make the printed results typeset easier for humans to read:

. mode column
. header on

To query Tables and TableFiles using SQL statements (case-insensitive):

SELECT * FROM TablesSELECT * FROM TableFiles
Use SQLite3 to view metadata

MySQL

If you are using MySQL, you need to specify the address of the MySQL service in the backend_url of the configuration file server_config.yaml.

For example, the following settings indicate that the MySQL service is deployed locally, with port ‘3306’, user name ‘root’, password ‘123456’, and database name ‘milvus’:

db_config:
backend_url: mysql://root:123456@127.0.0.1:3306/milvus

First of all, install MySQL client:

sudo apt-get install default-mysql-client

After Milvus is started, two tables (Tables and TableFiles) will be created in the MySQL service specified by backend_url.

Use the following command to connect to MySQL service:

mysql -h127.0.0.1 -uroot -p123456 -Dmilvus

Now, you can use SQL statements to query metadata information:

Use MySQL to view metadata

What’s coming next

Next articles will introduce in details the schema of metadata tables. Stay tuned!

Any questions, welcome to join our Slack channel or file an issue in the repo.

GitHub repo: https://github.com/milvus-io/milvus

If you like this article or find it useful, don’t forget to clap!

--

--

Vector Database for AI
Vector Database for AI

Published in Vector Database for AI

Scalable similarity search on unstructured data (such as image, video, and natural language) powered by https://milvus.io

Milvus
Milvus

Written by Milvus

Open-source Vector Database Powering AI Applications. #SimilaritySearch #Embeddings #MachineLearning

No responses yet