You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2021/08/15 08:41:21 UTC

[skywalking-banyandb] branch main updated: Move proto files to proper packages (#34)

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git


The following commit(s) were added to refs/heads/main by this push:
     new 67302cc  Move proto files to proper packages (#34)
67302cc is described below

commit 67302cc6a3b7d98492eccbc67edfd7ceb8f50d31
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Sun Aug 15 16:41:15 2021 +0800

    Move proto files to proper packages (#34)
    
    * move proto files to proper packages
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
    
    * Update pair type
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
    
    * Update query response
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
    
    * Add unspecified enum
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
 api/Makefile                                       |    6 +-
 api/common/metadata.go                             |   10 +-
 api/data/trace.go                                  |    8 +-
 api/event/discovery.go                             |    2 +-
 api/proto/banyandb/common/v1/common.pb.go          |  180 ++++
 .../{v1/rpc.proto => common/v1/common.proto}       |   20 +-
 api/proto/banyandb/database/v1/database.pb.go      |  332 ++++++
 .../{v1/rpc.proto => database/v1/database.proto}   |   29 +-
 api/proto/banyandb/database/v1/event.pb.go         |  550 ++++++++++
 .../{v1/database.proto => database/v1/event.proto} |   62 +-
 api/proto/banyandb/{ => database}/v1/schema.pb.go  |  804 ++++++--------
 api/proto/banyandb/database/v1/schema.proto        |  188 ++++
 api/proto/banyandb/model/v1/common.pb.go           |  353 ++++++
 .../{v1/rpc.proto => model/v1/common.proto}        |   26 +-
 api/proto/banyandb/model/v1/query.pb.go            |  810 ++++++++++++++
 api/proto/banyandb/model/v1/query.proto            |   95 ++
 api/proto/banyandb/model/v1/write.pb.go            |  280 +++++
 .../{v1/rpc.proto => model/v1/write.proto}         |   23 +-
 api/proto/banyandb/trace/v1/query.pb.go            |  449 ++++++++
 api/proto/banyandb/{ => trace}/v1/query.proto      |   92 +-
 api/proto/banyandb/trace/v1/rpc.pb.go              |  113 ++
 api/proto/banyandb/{ => trace}/v1/rpc.proto        |   14 +-
 api/proto/banyandb/{ => trace}/v1/rpc_grpc.pb.go   |   10 +-
 api/proto/banyandb/trace/v1/write.pb.go            |  357 ++++++
 api/proto/banyandb/{ => trace}/v1/write.proto      |   42 +-
 api/proto/banyandb/v1/database.pb.go               |  644 -----------
 api/proto/banyandb/v1/query.pb.go                  | 1132 --------------------
 api/proto/banyandb/v1/rpc.pb.go                    |  109 --
 api/proto/banyandb/v1/schema.proto                 |  198 ----
 api/proto/banyandb/v1/write.pb.go                  |  764 -------------
 api/schema/index.go                                |    2 +-
 api/schema/series.go                               |    2 +-
 banyand/index/index.go                             |   24 +-
 banyand/index/index_test.go                        |   15 +-
 banyand/index/search.go                            |   28 +-
 banyand/index/search_test.go                       |   26 +-
 .../grpc/{data => testdata}/server_cert.pem        |    0
 .../liaison/grpc/{data => testdata}/server_key.pem |    0
 banyand/liaison/grpc/{grpc.go => trace.go}         |  227 ++--
 .../liaison/grpc/{grpc_test.go => trace_test.go}   |   24 +-
 banyand/query/processor.go                         |    2 +-
 banyand/query/processor_test.go                    |   23 +-
 banyand/series/schema/sw/sw.go                     |    8 +-
 banyand/series/series.go                           |    2 +-
 banyand/series/trace/common_test.go                |    2 +-
 banyand/series/trace/query.go                      |    9 +-
 banyand/series/trace/query_test.go                 |   10 +-
 banyand/series/trace/schema.go                     |    9 +-
 banyand/series/trace/schema_test.go                |   25 +-
 banyand/series/trace/service.go                    |   21 +-
 banyand/series/trace/trace.go                      |   42 +-
 banyand/series/trace/write.go                      |   18 +-
 pkg/pb/database.go                                 |   39 +-
 pkg/pb/fields.go                                   |   63 +-
 pkg/pb/query.go                                    |  166 ++-
 pkg/pb/write.go                                    |   62 +-
 pkg/query/logical/analyzer.go                      |  144 +--
 pkg/query/logical/analyzer_test.go                 |   12 +-
 pkg/query/logical/expr.go                          |   43 +-
 pkg/query/logical/expr_literal.go                  |   18 +-
 pkg/query/logical/interface.go                     |    4 +-
 pkg/query/logical/plan_execution_test.go           |   14 +-
 pkg/query/logical/plan_indexscan.go                |    6 +-
 pkg/query/logical/plan_orderby.go                  |   24 +-
 pkg/query/logical/schema.go                        |   12 +-
 65 files changed, 4722 insertions(+), 4106 deletions(-)

diff --git a/api/Makefile b/api/Makefile
index daf91d1..303d7f1 100644
--- a/api/Makefile
+++ b/api/Makefile
@@ -18,11 +18,13 @@
 
 NAME := api
 
+proto_dir := $(root_dir)/api/proto
+
 include ../scripts/build/base.mk
 include ../scripts/build/help.mk
 
 generate: $(PROTOC)
-	@PATH=$(PATH):$(tool_bin) buf generate
+	@PATH=$(PATH):$(tool_bin):$(proto_dir) buf generate
 
 lint: $(PROTOC)
-	@PATH=$(PATH):$(tool_bin) buf lint
+	@PATH=$(PATH):$(tool_bin):$(proto_dir) buf lint
diff --git a/api/common/metadata.go b/api/common/metadata.go
index 8706aaf..8f55c1a 100644
--- a/api/common/metadata.go
+++ b/api/common/metadata.go
@@ -18,14 +18,14 @@
 package common
 
 import (
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	commonv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
 )
 
-var MetadataKindVersion = KindVersion{Version: "v1", Kind: "metadata"}
+var MetadataKindVersion = KindVersion{Version: "commonv1", Kind: "metadata"}
 
 type Metadata struct {
 	KindVersion
-	Spec *v1.Metadata
+	Spec *commonv1.Metadata
 }
 
 func (md Metadata) Equal(other Metadata) bool {
@@ -34,7 +34,7 @@ func (md Metadata) Equal(other Metadata) bool {
 		md.Spec.Name == other.Spec.Name
 }
 
-func NewMetadata(spec *v1.Metadata) *Metadata {
+func NewMetadata(spec *commonv1.Metadata) *Metadata {
 	return &Metadata{
 		KindVersion: MetadataKindVersion,
 		Spec:        spec,
@@ -44,7 +44,7 @@ func NewMetadata(spec *v1.Metadata) *Metadata {
 func NewMetadataByNameAndGroup(name, group string) *Metadata {
 	return &Metadata{
 		KindVersion: MetadataKindVersion,
-		Spec: &v1.Metadata{
+		Spec: &commonv1.Metadata{
 			Name:  name,
 			Group: group,
 		},
diff --git a/api/data/trace.go b/api/data/trace.go
index 0f8b84d..19ac991 100644
--- a/api/data/trace.go
+++ b/api/data/trace.go
@@ -19,7 +19,7 @@ package data
 
 import (
 	"github.com/apache/skywalking-banyandb/api/common"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	tracev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1"
 	"github.com/apache/skywalking-banyandb/pkg/bus"
 )
 
@@ -43,16 +43,16 @@ type Trace struct {
 }
 
 type Entity struct {
-	*v1.Entity
+	*tracev1.Entity
 }
 
 type EntityValue struct {
-	*v1.EntityValue
+	*tracev1.EntityValue
 }
 type TraceWriteDate struct {
 	ShardID      uint
 	SeriesID     uint64
-	WriteRequest *v1.WriteRequest
+	WriteRequest *tracev1.WriteRequest
 }
 type Write struct {
 	common.KindVersion
diff --git a/api/event/discovery.go b/api/event/discovery.go
index 7b55de8..db9695e 100644
--- a/api/event/discovery.go
+++ b/api/event/discovery.go
@@ -19,7 +19,7 @@ package event
 
 import (
 	"github.com/apache/skywalking-banyandb/api/common"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 	"github.com/apache/skywalking-banyandb/pkg/bus"
 )
 
diff --git a/api/proto/banyandb/common/v1/common.pb.go b/api/proto/banyandb/common/v1/common.pb.go
new file mode 100644
index 0000000..ed6aa71
--- /dev/null
+++ b/api/proto/banyandb/common/v1/common.pb.go
@@ -0,0 +1,180 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/common/v1/common.proto
+
+package v1
+
+import (
+	reflect "reflect"
+	sync "sync"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Metadata is for multi-tenant, multi-model use
+type Metadata struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// group contains a set of options, like retention policy, max
+	Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
+	// name of the entity
+	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *Metadata) Reset() {
+	*x = Metadata{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_common_v1_common_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Metadata) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Metadata) ProtoMessage() {}
+
+func (x *Metadata) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_common_v1_common_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Metadata.ProtoReflect.Descriptor instead.
+func (*Metadata) Descriptor() ([]byte, []int) {
+	return file_banyandb_common_v1_common_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Metadata) GetGroup() string {
+	if x != nil {
+		return x.Group
+	}
+	return ""
+}
+
+func (x *Metadata) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+var File_banyandb_common_v1_common_proto protoreflect.FileDescriptor
+
+var file_banyandb_common_v1_common_proto_rawDesc = []byte{
+	0x0a, 0x1f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
+	0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x12, 0x12, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+	0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0x34, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+	0x61, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x6e, 0x0a, 0x28, 0x6f,
+	0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c,
+	0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f,
+	0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
+	0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61,
+	0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61,
+	0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x33,
+}
+
+var (
+	file_banyandb_common_v1_common_proto_rawDescOnce sync.Once
+	file_banyandb_common_v1_common_proto_rawDescData = file_banyandb_common_v1_common_proto_rawDesc
+)
+
+func file_banyandb_common_v1_common_proto_rawDescGZIP() []byte {
+	file_banyandb_common_v1_common_proto_rawDescOnce.Do(func() {
+		file_banyandb_common_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_common_v1_common_proto_rawDescData)
+	})
+	return file_banyandb_common_v1_common_proto_rawDescData
+}
+
+var file_banyandb_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_banyandb_common_v1_common_proto_goTypes = []interface{}{
+	(*Metadata)(nil), // 0: banyandb.common.v1.Metadata
+}
+var file_banyandb_common_v1_common_proto_depIdxs = []int32{
+	0, // [0:0] is the sub-list for method output_type
+	0, // [0:0] is the sub-list for method input_type
+	0, // [0:0] is the sub-list for extension type_name
+	0, // [0:0] is the sub-list for extension extendee
+	0, // [0:0] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_common_v1_common_proto_init() }
+func file_banyandb_common_v1_common_proto_init() {
+	if File_banyandb_common_v1_common_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_banyandb_common_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Metadata); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_common_v1_common_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   1,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_banyandb_common_v1_common_proto_goTypes,
+		DependencyIndexes: file_banyandb_common_v1_common_proto_depIdxs,
+		MessageInfos:      file_banyandb_common_v1_common_proto_msgTypes,
+	}.Build()
+	File_banyandb_common_v1_common_proto = out.File
+	file_banyandb_common_v1_common_proto_rawDesc = nil
+	file_banyandb_common_v1_common_proto_goTypes = nil
+	file_banyandb_common_v1_common_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/v1/rpc.proto b/api/proto/banyandb/common/v1/common.proto
similarity index 71%
copy from api/proto/banyandb/v1/rpc.proto
copy to api/proto/banyandb/common/v1/common.proto
index 85fafd8..d7060f3 100644
--- a/api/proto/banyandb/v1/rpc.proto
+++ b/api/proto/banyandb/common/v1/common.proto
@@ -17,15 +17,15 @@
 
 syntax = "proto3";
 
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
+option java_package = "org.apache.skywalking.banyandb.common.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1";
 
-package banyandb.v1;
+package banyandb.common.v1;
 
-import "banyandb/v1/query.proto";
-import "banyandb/v1/write.proto";
-
-service TraceService {
-  rpc Query(banyandb.v1.QueryRequest) returns (banyandb.v1.QueryResponse);
-  rpc Write(stream banyandb.v1.WriteRequest) returns (stream banyandb.v1.WriteResponse);
-}
\ No newline at end of file
+// Metadata is for multi-tenant, multi-model use
+message Metadata {
+    // group contains a set of options, like retention policy, max
+    string group = 1;
+    // name of the entity
+    string name = 2;
+}
diff --git a/api/proto/banyandb/database/v1/database.pb.go b/api/proto/banyandb/database/v1/database.pb.go
new file mode 100644
index 0000000..3720d45
--- /dev/null
+++ b/api/proto/banyandb/database/v1/database.pb.go
@@ -0,0 +1,332 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/database/v1/database.proto
+
+package v1
+
+import (
+	reflect "reflect"
+	sync "sync"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Node struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
+	Addr      string                 `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
+	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
+	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
+}
+
+func (x *Node) Reset() {
+	*x = Node{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_database_v1_database_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Node) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Node) ProtoMessage() {}
+
+func (x *Node) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_database_v1_database_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Node.ProtoReflect.Descriptor instead.
+func (*Node) Descriptor() ([]byte, []int) {
+	return file_banyandb_database_v1_database_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Node) GetId() string {
+	if x != nil {
+		return x.Id
+	}
+	return ""
+}
+
+func (x *Node) GetAddr() string {
+	if x != nil {
+		return x.Addr
+	}
+	return ""
+}
+
+func (x *Node) GetUpdatedAt() *timestamppb.Timestamp {
+	if x != nil {
+		return x.UpdatedAt
+	}
+	return nil
+}
+
+func (x *Node) GetCreatedAt() *timestamppb.Timestamp {
+	if x != nil {
+		return x.CreatedAt
+	}
+	return nil
+}
+
+type Shard struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Id        uint64                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+	Series    *v1.Metadata           `protobuf:"bytes,2,opt,name=series,proto3" json:"series,omitempty"`
+	Node      *Node                  `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"`
+	Total     uint32                 `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"`
+	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
+	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
+}
+
+func (x *Shard) Reset() {
+	*x = Shard{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_database_v1_database_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Shard) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Shard) ProtoMessage() {}
+
+func (x *Shard) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_database_v1_database_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Shard.ProtoReflect.Descriptor instead.
+func (*Shard) Descriptor() ([]byte, []int) {
+	return file_banyandb_database_v1_database_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *Shard) GetId() uint64 {
+	if x != nil {
+		return x.Id
+	}
+	return 0
+}
+
+func (x *Shard) GetSeries() *v1.Metadata {
+	if x != nil {
+		return x.Series
+	}
+	return nil
+}
+
+func (x *Shard) GetNode() *Node {
+	if x != nil {
+		return x.Node
+	}
+	return nil
+}
+
+func (x *Shard) GetTotal() uint32 {
+	if x != nil {
+		return x.Total
+	}
+	return 0
+}
+
+func (x *Shard) GetUpdatedAt() *timestamppb.Timestamp {
+	if x != nil {
+		return x.UpdatedAt
+	}
+	return nil
+}
+
+func (x *Shard) GetCreatedAt() *timestamppb.Timestamp {
+	if x != nil {
+		return x.CreatedAt
+	}
+	return nil
+}
+
+var File_banyandb_database_v1_database_proto protoreflect.FileDescriptor
+
+var file_banyandb_database_v1_database_proto_rawDesc = []byte{
+	0x0a, 0x23, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
+	0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
+	0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f,
+	0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d,
+	0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x62, 0x61,
+	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31,
+	0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x01,
+	0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70,
+	0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
+	0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+	0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61,
+	0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
+	0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+	0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
+	0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,
+	0x22, 0x89, 0x02, 0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x65,
+	0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e,
+	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
+	0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+	0x12, 0x2e, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
+	0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+	0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65,
+	0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52,
+	0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+	0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
+	0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
+	0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41,
+	0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18,
+	0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
+	0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x72, 0x0a, 0x2a,
+	0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61,
+	0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64,
+	0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68,
+	0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b,
+	0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79,
+	0x61, 0x6e, 0x64, 0x62, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31,
+	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_banyandb_database_v1_database_proto_rawDescOnce sync.Once
+	file_banyandb_database_v1_database_proto_rawDescData = file_banyandb_database_v1_database_proto_rawDesc
+)
+
+func file_banyandb_database_v1_database_proto_rawDescGZIP() []byte {
+	file_banyandb_database_v1_database_proto_rawDescOnce.Do(func() {
+		file_banyandb_database_v1_database_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_database_v1_database_proto_rawDescData)
+	})
+	return file_banyandb_database_v1_database_proto_rawDescData
+}
+
+var file_banyandb_database_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_banyandb_database_v1_database_proto_goTypes = []interface{}{
+	(*Node)(nil),                  // 0: banyandb.database.v1.Node
+	(*Shard)(nil),                 // 1: banyandb.database.v1.Shard
+	(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
+	(*v1.Metadata)(nil),           // 3: banyandb.common.v1.Metadata
+}
+var file_banyandb_database_v1_database_proto_depIdxs = []int32{
+	2, // 0: banyandb.database.v1.Node.updated_at:type_name -> google.protobuf.Timestamp
+	2, // 1: banyandb.database.v1.Node.created_at:type_name -> google.protobuf.Timestamp
+	3, // 2: banyandb.database.v1.Shard.series:type_name -> banyandb.common.v1.Metadata
+	0, // 3: banyandb.database.v1.Shard.node:type_name -> banyandb.database.v1.Node
+	2, // 4: banyandb.database.v1.Shard.updated_at:type_name -> google.protobuf.Timestamp
+	2, // 5: banyandb.database.v1.Shard.created_at:type_name -> google.protobuf.Timestamp
+	6, // [6:6] is the sub-list for method output_type
+	6, // [6:6] is the sub-list for method input_type
+	6, // [6:6] is the sub-list for extension type_name
+	6, // [6:6] is the sub-list for extension extendee
+	0, // [0:6] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_database_v1_database_proto_init() }
+func file_banyandb_database_v1_database_proto_init() {
+	if File_banyandb_database_v1_database_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_banyandb_database_v1_database_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Node); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_database_v1_database_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Shard); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_database_v1_database_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   2,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_banyandb_database_v1_database_proto_goTypes,
+		DependencyIndexes: file_banyandb_database_v1_database_proto_depIdxs,
+		MessageInfos:      file_banyandb_database_v1_database_proto_msgTypes,
+	}.Build()
+	File_banyandb_database_v1_database_proto = out.File
+	file_banyandb_database_v1_database_proto_rawDesc = nil
+	file_banyandb_database_v1_database_proto_goTypes = nil
+	file_banyandb_database_v1_database_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/v1/rpc.proto b/api/proto/banyandb/database/v1/database.proto
similarity index 61%
copy from api/proto/banyandb/v1/rpc.proto
copy to api/proto/banyandb/database/v1/database.proto
index 85fafd8..2d26c9d 100644
--- a/api/proto/banyandb/v1/rpc.proto
+++ b/api/proto/banyandb/database/v1/database.proto
@@ -17,15 +17,26 @@
 
 syntax = "proto3";
 
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
+option java_package = "org.apache.skywalking.banyandb.database.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1";
 
-package banyandb.v1;
+package banyandb.database.v1;
 
-import "banyandb/v1/query.proto";
-import "banyandb/v1/write.proto";
+import "google/protobuf/timestamp.proto";
+import "banyandb/common/v1/common.proto";
 
-service TraceService {
-  rpc Query(banyandb.v1.QueryRequest) returns (banyandb.v1.QueryResponse);
-  rpc Write(stream banyandb.v1.WriteRequest) returns (stream banyandb.v1.WriteResponse);
-}
\ No newline at end of file
+message Node {
+    string id = 1;
+    string addr = 2;
+    google.protobuf.Timestamp updated_at = 3;
+    google.protobuf.Timestamp created_at = 4;
+}
+
+message Shard {
+    uint64 id = 1;
+    common.v1.Metadata series = 2;
+    Node node = 3;
+    uint32 total = 4;
+    google.protobuf.Timestamp updated_at = 5;
+    google.protobuf.Timestamp created_at = 6;
+}
diff --git a/api/proto/banyandb/database/v1/event.pb.go b/api/proto/banyandb/database/v1/event.pb.go
new file mode 100644
index 0000000..9341bb9
--- /dev/null
+++ b/api/proto/banyandb/database/v1/event.pb.go
@@ -0,0 +1,550 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/database/v1/event.proto
+
+package v1
+
+import (
+	reflect "reflect"
+	sync "sync"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Action int32
+
+const (
+	Action_ACTION_UNSPECIFIED Action = 0
+	Action_ACTION_PUT         Action = 1
+	Action_ACTION_DELETE      Action = 2
+)
+
+// Enum value maps for Action.
+var (
+	Action_name = map[int32]string{
+		0: "ACTION_UNSPECIFIED",
+		1: "ACTION_PUT",
+		2: "ACTION_DELETE",
+	}
+	Action_value = map[string]int32{
+		"ACTION_UNSPECIFIED": 0,
+		"ACTION_PUT":         1,
+		"ACTION_DELETE":      2,
+	}
+)
+
+func (x Action) Enum() *Action {
+	p := new(Action)
+	*p = x
+	return p
+}
+
+func (x Action) String() string {
+	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Action) Descriptor() protoreflect.EnumDescriptor {
+	return file_banyandb_database_v1_event_proto_enumTypes[0].Descriptor()
+}
+
+func (Action) Type() protoreflect.EnumType {
+	return &file_banyandb_database_v1_event_proto_enumTypes[0]
+}
+
+func (x Action) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Action.Descriptor instead.
+func (Action) EnumDescriptor() ([]byte, []int) {
+	return file_banyandb_database_v1_event_proto_rawDescGZIP(), []int{0}
+}
+
+type ShardEvent struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Shard  *Shard                 `protobuf:"bytes,1,opt,name=shard,proto3" json:"shard,omitempty"`
+	Action Action                 `protobuf:"varint,2,opt,name=action,proto3,enum=banyandb.database.v1.Action" json:"action,omitempty"`
+	Time   *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3" json:"time,omitempty"`
+}
+
+func (x *ShardEvent) Reset() {
+	*x = ShardEvent{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_database_v1_event_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ShardEvent) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ShardEvent) ProtoMessage() {}
+
+func (x *ShardEvent) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_database_v1_event_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use ShardEvent.ProtoReflect.Descriptor instead.
+func (*ShardEvent) Descriptor() ([]byte, []int) {
+	return file_banyandb_database_v1_event_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *ShardEvent) GetShard() *Shard {
+	if x != nil {
+		return x.Shard
+	}
+	return nil
+}
+
+func (x *ShardEvent) GetAction() Action {
+	if x != nil {
+		return x.Action
+	}
+	return Action_ACTION_UNSPECIFIED
+}
+
+func (x *ShardEvent) GetTime() *timestamppb.Timestamp {
+	if x != nil {
+		return x.Time
+	}
+	return nil
+}
+
+type SeriesEvent struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Series                      *v1.Metadata           `protobuf:"bytes,1,opt,name=series,proto3" json:"series,omitempty"`
+	FieldNamesCompositeSeriesId []string               `protobuf:"bytes,2,rep,name=field_names_composite_series_id,json=fieldNamesCompositeSeriesId,proto3" json:"field_names_composite_series_id,omitempty"`
+	Action                      Action                 `protobuf:"varint,3,opt,name=action,proto3,enum=banyandb.database.v1.Action" json:"action,omitempty"`
+	Time                        *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"`
+}
+
+func (x *SeriesEvent) Reset() {
+	*x = SeriesEvent{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_database_v1_event_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *SeriesEvent) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SeriesEvent) ProtoMessage() {}
+
+func (x *SeriesEvent) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_database_v1_event_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use SeriesEvent.ProtoReflect.Descriptor instead.
+func (*SeriesEvent) Descriptor() ([]byte, []int) {
+	return file_banyandb_database_v1_event_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *SeriesEvent) GetSeries() *v1.Metadata {
+	if x != nil {
+		return x.Series
+	}
+	return nil
+}
+
+func (x *SeriesEvent) GetFieldNamesCompositeSeriesId() []string {
+	if x != nil {
+		return x.FieldNamesCompositeSeriesId
+	}
+	return nil
+}
+
+func (x *SeriesEvent) GetAction() Action {
+	if x != nil {
+		return x.Action
+	}
+	return Action_ACTION_UNSPECIFIED
+}
+
+func (x *SeriesEvent) GetTime() *timestamppb.Timestamp {
+	if x != nil {
+		return x.Time
+	}
+	return nil
+}
+
+type IndexRuleEvent struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Series *v1.Metadata                       `protobuf:"bytes,1,opt,name=series,proto3" json:"series,omitempty"`
+	Rules  []*IndexRuleEvent_ShardedIndexRule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"`
+	Action Action                             `protobuf:"varint,4,opt,name=action,proto3,enum=banyandb.database.v1.Action" json:"action,omitempty"`
+	Time   *timestamppb.Timestamp             `protobuf:"bytes,5,opt,name=time,proto3" json:"time,omitempty"`
+}
+
+func (x *IndexRuleEvent) Reset() {
+	*x = IndexRuleEvent{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_database_v1_event_proto_msgTypes[2]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *IndexRuleEvent) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*IndexRuleEvent) ProtoMessage() {}
+
+func (x *IndexRuleEvent) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_database_v1_event_proto_msgTypes[2]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use IndexRuleEvent.ProtoReflect.Descriptor instead.
+func (*IndexRuleEvent) Descriptor() ([]byte, []int) {
+	return file_banyandb_database_v1_event_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *IndexRuleEvent) GetSeries() *v1.Metadata {
+	if x != nil {
+		return x.Series
+	}
+	return nil
+}
+
+func (x *IndexRuleEvent) GetRules() []*IndexRuleEvent_ShardedIndexRule {
+	if x != nil {
+		return x.Rules
+	}
+	return nil
+}
+
+func (x *IndexRuleEvent) GetAction() Action {
+	if x != nil {
+		return x.Action
+	}
+	return Action_ACTION_UNSPECIFIED
+}
+
+func (x *IndexRuleEvent) GetTime() *timestamppb.Timestamp {
+	if x != nil {
+		return x.Time
+	}
+	return nil
+}
+
+type IndexRuleEvent_ShardedIndexRule struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	ShardId uint64       `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
+	Rules   []*IndexRule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"`
+}
+
+func (x *IndexRuleEvent_ShardedIndexRule) Reset() {
+	*x = IndexRuleEvent_ShardedIndexRule{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_database_v1_event_proto_msgTypes[3]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *IndexRuleEvent_ShardedIndexRule) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*IndexRuleEvent_ShardedIndexRule) ProtoMessage() {}
+
+func (x *IndexRuleEvent_ShardedIndexRule) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_database_v1_event_proto_msgTypes[3]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use IndexRuleEvent_ShardedIndexRule.ProtoReflect.Descriptor instead.
+func (*IndexRuleEvent_ShardedIndexRule) Descriptor() ([]byte, []int) {
+	return file_banyandb_database_v1_event_proto_rawDescGZIP(), []int{2, 0}
+}
+
+func (x *IndexRuleEvent_ShardedIndexRule) GetShardId() uint64 {
+	if x != nil {
+		return x.ShardId
+	}
+	return 0
+}
+
+func (x *IndexRuleEvent_ShardedIndexRule) GetRules() []*IndexRule {
+	if x != nil {
+		return x.Rules
+	}
+	return nil
+}
+
+var File_banyandb_database_v1_event_proto protoreflect.FileDescriptor
+
+var file_banyandb_database_v1_event_proto_rawDesc = []byte{
+	0x0a, 0x20, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
+	0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x12, 0x14, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74,
+	0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+	0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
+	0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f,
+	0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x62, 0x61, 0x6e, 0x79,
+	0x61, 0x6e, 0x64, 0x62, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31,
+	0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
+	0x21, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+	0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x0a, 0x53, 0x68, 0x61, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e,
+	0x74, 0x12, 0x31, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
+	0x32, 0x1b, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61,
+	0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x05, 0x73,
+	0x68, 0x61, 0x72, 0x64, 0x12, 0x34, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
+	0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69,
+	0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69,
+	0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
+	0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xef, 0x01, 0x0a, 0x0b, 0x53,
+	0x65, 0x72, 0x69, 0x65, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x65,
+	0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e,
+	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
+	0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+	0x12, 0x44, 0x0a, 0x1f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x5f,
+	0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+	0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, 0x66, 0x69, 0x65, 0x6c, 0x64,
+	0x4e, 0x61, 0x6d, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x53, 0x65,
+	0x72, 0x69, 0x65, 0x73, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63,
+	0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x04,
+	0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
+	0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
+	0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xdf, 0x02, 0x0a,
+	0x0e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12,
+	0x34, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
+	0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
+	0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x73,
+	0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02,
+	0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
+	0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65,
+	0x78, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64,
+	0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c,
+	0x65, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61,
+	0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+	0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x64, 0x0a, 0x10, 0x53, 0x68, 0x61, 0x72,
+	0x64, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08,
+	0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07,
+	0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73,
+	0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e,
+	0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2a, 0x43,
+	0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49,
+	0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+	0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x55, 0x54, 0x10, 0x01,
+	0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54,
+	0x45, 0x10, 0x02, 0x42, 0x72, 0x0a, 0x2a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68,
+	0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e,
+	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+	0x31, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70,
+	0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d,
+	0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x64, 0x61, 0x74, 0x61,
+	0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_banyandb_database_v1_event_proto_rawDescOnce sync.Once
+	file_banyandb_database_v1_event_proto_rawDescData = file_banyandb_database_v1_event_proto_rawDesc
+)
+
+func file_banyandb_database_v1_event_proto_rawDescGZIP() []byte {
+	file_banyandb_database_v1_event_proto_rawDescOnce.Do(func() {
+		file_banyandb_database_v1_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_database_v1_event_proto_rawDescData)
+	})
+	return file_banyandb_database_v1_event_proto_rawDescData
+}
+
+var file_banyandb_database_v1_event_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_banyandb_database_v1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
+var file_banyandb_database_v1_event_proto_goTypes = []interface{}{
+	(Action)(0),                             // 0: banyandb.database.v1.Action
+	(*ShardEvent)(nil),                      // 1: banyandb.database.v1.ShardEvent
+	(*SeriesEvent)(nil),                     // 2: banyandb.database.v1.SeriesEvent
+	(*IndexRuleEvent)(nil),                  // 3: banyandb.database.v1.IndexRuleEvent
+	(*IndexRuleEvent_ShardedIndexRule)(nil), // 4: banyandb.database.v1.IndexRuleEvent.ShardedIndexRule
+	(*Shard)(nil),                           // 5: banyandb.database.v1.Shard
+	(*timestamppb.Timestamp)(nil),           // 6: google.protobuf.Timestamp
+	(*v1.Metadata)(nil),                     // 7: banyandb.common.v1.Metadata
+	(*IndexRule)(nil),                       // 8: banyandb.database.v1.IndexRule
+}
+var file_banyandb_database_v1_event_proto_depIdxs = []int32{
+	5,  // 0: banyandb.database.v1.ShardEvent.shard:type_name -> banyandb.database.v1.Shard
+	0,  // 1: banyandb.database.v1.ShardEvent.action:type_name -> banyandb.database.v1.Action
+	6,  // 2: banyandb.database.v1.ShardEvent.time:type_name -> google.protobuf.Timestamp
+	7,  // 3: banyandb.database.v1.SeriesEvent.series:type_name -> banyandb.common.v1.Metadata
+	0,  // 4: banyandb.database.v1.SeriesEvent.action:type_name -> banyandb.database.v1.Action
+	6,  // 5: banyandb.database.v1.SeriesEvent.time:type_name -> google.protobuf.Timestamp
+	7,  // 6: banyandb.database.v1.IndexRuleEvent.series:type_name -> banyandb.common.v1.Metadata
+	4,  // 7: banyandb.database.v1.IndexRuleEvent.rules:type_name -> banyandb.database.v1.IndexRuleEvent.ShardedIndexRule
+	0,  // 8: banyandb.database.v1.IndexRuleEvent.action:type_name -> banyandb.database.v1.Action
+	6,  // 9: banyandb.database.v1.IndexRuleEvent.time:type_name -> google.protobuf.Timestamp
+	8,  // 10: banyandb.database.v1.IndexRuleEvent.ShardedIndexRule.rules:type_name -> banyandb.database.v1.IndexRule
+	11, // [11:11] is the sub-list for method output_type
+	11, // [11:11] is the sub-list for method input_type
+	11, // [11:11] is the sub-list for extension type_name
+	11, // [11:11] is the sub-list for extension extendee
+	0,  // [0:11] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_database_v1_event_proto_init() }
+func file_banyandb_database_v1_event_proto_init() {
+	if File_banyandb_database_v1_event_proto != nil {
+		return
+	}
+	file_banyandb_database_v1_database_proto_init()
+	file_banyandb_database_v1_schema_proto_init()
+	if !protoimpl.UnsafeEnabled {
+		file_banyandb_database_v1_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ShardEvent); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_database_v1_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*SeriesEvent); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_database_v1_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*IndexRuleEvent); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_database_v1_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*IndexRuleEvent_ShardedIndexRule); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_database_v1_event_proto_rawDesc,
+			NumEnums:      1,
+			NumMessages:   4,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_banyandb_database_v1_event_proto_goTypes,
+		DependencyIndexes: file_banyandb_database_v1_event_proto_depIdxs,
+		EnumInfos:         file_banyandb_database_v1_event_proto_enumTypes,
+		MessageInfos:      file_banyandb_database_v1_event_proto_msgTypes,
+	}.Build()
+	File_banyandb_database_v1_event_proto = out.File
+	file_banyandb_database_v1_event_proto_rawDesc = nil
+	file_banyandb_database_v1_event_proto_goTypes = nil
+	file_banyandb_database_v1_event_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/v1/database.proto b/api/proto/banyandb/database/v1/event.proto
similarity index 53%
rename from api/proto/banyandb/v1/database.proto
rename to api/proto/banyandb/database/v1/event.proto
index 8c3b477..1a9bd21 100644
--- a/api/proto/banyandb/v1/database.proto
+++ b/api/proto/banyandb/database/v1/event.proto
@@ -17,52 +17,42 @@
 
 syntax = "proto3";
 
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
+option java_package = "org.apache.skywalking.banyandb.database.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1";
 
-package banyandb.v1;
+package banyandb.database.v1;
 
 import "google/protobuf/timestamp.proto";
-
-message Node {
-  string id = 1;
-  string addr = 2;
-  google.protobuf.Timestamp updated_at = 3;
-  google.protobuf.Timestamp created_at = 4;
-}
-
-message Shard {
-  uint64 id = 1;
-  Metadata series = 2;
-  Node node = 3;
-  uint32 total = 4;
-  google.protobuf.Timestamp updated_at = 5;
-  google.protobuf.Timestamp created_at = 6;
-}
+import "banyandb/common/v1/common.proto";
+import "banyandb/database/v1/database.proto";
+import "banyandb/database/v1/schema.proto";
 
 enum Action {
-  ACTION_UNSPECIFIED = 0;
-  ACTION_PUT = 1;
-  ACTION_DELETE = 2;
+    ACTION_UNSPECIFIED = 0;
+    ACTION_PUT = 1;
+    ACTION_DELETE = 2;
 }
 
 message ShardEvent {
-  Shard shard = 1;
-  Action action = 2;
-  google.protobuf.Timestamp time = 3;
+    Shard shard = 1;
+    Action action = 2;
+    google.protobuf.Timestamp time = 3;
 }
 
 message SeriesEvent {
-  Metadata series = 1;
-  repeated string field_names_composite_series_id = 2;
-  Action action = 3;
-  google.protobuf.Timestamp time = 4;
+    common.v1.Metadata series = 1;
+    repeated string field_names_composite_series_id = 2;
+    Action action = 3;
+    google.protobuf.Timestamp time = 4;
 }
 
-// Metadata is for multi-tenant, multi-model use
-message Metadata {
-  // group contains a set of options, like retention policy, max
-  string group = 1;
-  // name of the entity
-  string name = 2;
-}
\ No newline at end of file
+message IndexRuleEvent {
+    common.v1.Metadata series = 1;
+    message ShardedIndexRule {
+        uint64 shard_id = 1;
+        repeated IndexRule rules  = 2;
+    }
+    repeated ShardedIndexRule rules = 2;
+    Action action = 4;
+    google.protobuf.Timestamp time = 5;
+}
diff --git a/api/proto/banyandb/v1/schema.pb.go b/api/proto/banyandb/database/v1/schema.pb.go
similarity index 52%
rename from api/proto/banyandb/v1/schema.pb.go
rename to api/proto/banyandb/database/v1/schema.pb.go
index 3e6c668..61700a0 100644
--- a/api/proto/banyandb/v1/schema.pb.go
+++ b/api/proto/banyandb/database/v1/schema.pb.go
@@ -19,7 +19,7 @@
 // versions:
 // 	protoc-gen-go v1.27.1
 // 	protoc        v3.17.3
-// source: banyandb/v1/schema.proto
+// source: banyandb/database/v1/schema.proto
 
 package v1
 
@@ -30,6 +30,8 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
 )
 
 const (
@@ -39,6 +41,61 @@ const (
 	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
 )
 
+type FieldType int32
+
+const (
+	FieldType_FIELD_TYPE_UNSPECIFIED  FieldType = 0
+	FieldType_FIELD_TYPE_STRING       FieldType = 1
+	FieldType_FIELD_TYPE_INT          FieldType = 2
+	FieldType_FIELD_TYPE_STRING_ARRAY FieldType = 3
+	FieldType_FIELD_TYPE_INT_ARRAY    FieldType = 4
+)
+
+// Enum value maps for FieldType.
+var (
+	FieldType_name = map[int32]string{
+		0: "FIELD_TYPE_UNSPECIFIED",
+		1: "FIELD_TYPE_STRING",
+		2: "FIELD_TYPE_INT",
+		3: "FIELD_TYPE_STRING_ARRAY",
+		4: "FIELD_TYPE_INT_ARRAY",
+	}
+	FieldType_value = map[string]int32{
+		"FIELD_TYPE_UNSPECIFIED":  0,
+		"FIELD_TYPE_STRING":       1,
+		"FIELD_TYPE_INT":          2,
+		"FIELD_TYPE_STRING_ARRAY": 3,
+		"FIELD_TYPE_INT_ARRAY":    4,
+	}
+)
+
+func (x FieldType) Enum() *FieldType {
+	p := new(FieldType)
+	*p = x
+	return p
+}
+
+func (x FieldType) String() string {
+	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (FieldType) Descriptor() protoreflect.EnumDescriptor {
+	return file_banyandb_database_v1_schema_proto_enumTypes[0].Descriptor()
+}
+
+func (FieldType) Type() protoreflect.EnumType {
+	return &file_banyandb_database_v1_schema_proto_enumTypes[0]
+}
+
+func (x FieldType) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use FieldType.Descriptor instead.
+func (FieldType) EnumDescriptor() ([]byte, []int) {
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{0}
+}
+
 type Duration_DurationUnit int32
 
 const (
@@ -78,11 +135,11 @@ func (x Duration_DurationUnit) String() string {
 }
 
 func (Duration_DurationUnit) Descriptor() protoreflect.EnumDescriptor {
-	return file_banyandb_v1_schema_proto_enumTypes[0].Descriptor()
+	return file_banyandb_database_v1_schema_proto_enumTypes[1].Descriptor()
 }
 
 func (Duration_DurationUnit) Type() protoreflect.EnumType {
-	return &file_banyandb_v1_schema_proto_enumTypes[0]
+	return &file_banyandb_database_v1_schema_proto_enumTypes[1]
 }
 
 func (x Duration_DurationUnit) Number() protoreflect.EnumNumber {
@@ -91,62 +148,7 @@ func (x Duration_DurationUnit) Number() protoreflect.EnumNumber {
 
 // Deprecated: Use Duration_DurationUnit.Descriptor instead.
 func (Duration_DurationUnit) EnumDescriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{1, 0}
-}
-
-type FieldSpec_FieldType int32
-
-const (
-	FieldSpec_FIELD_TYPE_UNSPECIFIED  FieldSpec_FieldType = 0
-	FieldSpec_FIELD_TYPE_STRING       FieldSpec_FieldType = 1
-	FieldSpec_FIELD_TYPE_INT          FieldSpec_FieldType = 2
-	FieldSpec_FIELD_TYPE_STRING_ARRAY FieldSpec_FieldType = 3
-	FieldSpec_FIELD_TYPE_INT_ARRAY    FieldSpec_FieldType = 4
-)
-
-// Enum value maps for FieldSpec_FieldType.
-var (
-	FieldSpec_FieldType_name = map[int32]string{
-		0: "FIELD_TYPE_UNSPECIFIED",
-		1: "FIELD_TYPE_STRING",
-		2: "FIELD_TYPE_INT",
-		3: "FIELD_TYPE_STRING_ARRAY",
-		4: "FIELD_TYPE_INT_ARRAY",
-	}
-	FieldSpec_FieldType_value = map[string]int32{
-		"FIELD_TYPE_UNSPECIFIED":  0,
-		"FIELD_TYPE_STRING":       1,
-		"FIELD_TYPE_INT":          2,
-		"FIELD_TYPE_STRING_ARRAY": 3,
-		"FIELD_TYPE_INT_ARRAY":    4,
-	}
-)
-
-func (x FieldSpec_FieldType) Enum() *FieldSpec_FieldType {
-	p := new(FieldSpec_FieldType)
-	*p = x
-	return p
-}
-
-func (x FieldSpec_FieldType) String() string {
-	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (FieldSpec_FieldType) Descriptor() protoreflect.EnumDescriptor {
-	return file_banyandb_v1_schema_proto_enumTypes[1].Descriptor()
-}
-
-func (FieldSpec_FieldType) Type() protoreflect.EnumType {
-	return &file_banyandb_v1_schema_proto_enumTypes[1]
-}
-
-func (x FieldSpec_FieldType) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use FieldSpec_FieldType.Descriptor instead.
-func (FieldSpec_FieldType) EnumDescriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{2, 0}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{1, 0}
 }
 
 // IndexType determine the index structure under the hood
@@ -196,11 +198,11 @@ func (x IndexObject_IndexType) String() string {
 }
 
 func (IndexObject_IndexType) Descriptor() protoreflect.EnumDescriptor {
-	return file_banyandb_v1_schema_proto_enumTypes[2].Descriptor()
+	return file_banyandb_database_v1_schema_proto_enumTypes[2].Descriptor()
 }
 
 func (IndexObject_IndexType) Type() protoreflect.EnumType {
-	return &file_banyandb_v1_schema_proto_enumTypes[2]
+	return &file_banyandb_database_v1_schema_proto_enumTypes[2]
 }
 
 func (x IndexObject_IndexType) Number() protoreflect.EnumNumber {
@@ -209,7 +211,7 @@ func (x IndexObject_IndexType) Number() protoreflect.EnumNumber {
 
 // Deprecated: Use IndexObject_IndexType.Descriptor instead.
 func (IndexObject_IndexType) EnumDescriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{6, 0}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{6, 0}
 }
 
 // Catalog refers to a placement contains objects belonged to a particular data type
@@ -249,11 +251,11 @@ func (x Series_Catalog) String() string {
 }
 
 func (Series_Catalog) Descriptor() protoreflect.EnumDescriptor {
-	return file_banyandb_v1_schema_proto_enumTypes[3].Descriptor()
+	return file_banyandb_database_v1_schema_proto_enumTypes[3].Descriptor()
 }
 
 func (Series_Catalog) Type() protoreflect.EnumType {
-	return &file_banyandb_v1_schema_proto_enumTypes[3]
+	return &file_banyandb_database_v1_schema_proto_enumTypes[3]
 }
 
 func (x Series_Catalog) Number() protoreflect.EnumNumber {
@@ -262,7 +264,7 @@ func (x Series_Catalog) Number() protoreflect.EnumNumber {
 
 // Deprecated: Use Series_Catalog.Descriptor instead.
 func (Series_Catalog) EnumDescriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{8, 0}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{8, 0}
 }
 
 type ShardInfo struct {
@@ -277,7 +279,7 @@ type ShardInfo struct {
 func (x *ShardInfo) Reset() {
 	*x = ShardInfo{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[0]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[0]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -290,7 +292,7 @@ func (x *ShardInfo) String() string {
 func (*ShardInfo) ProtoMessage() {}
 
 func (x *ShardInfo) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[0]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[0]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -303,7 +305,7 @@ func (x *ShardInfo) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use ShardInfo.ProtoReflect.Descriptor instead.
 func (*ShardInfo) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{0}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{0}
 }
 
 func (x *ShardInfo) GetNumber() uint32 {
@@ -327,13 +329,13 @@ type Duration struct {
 	unknownFields protoimpl.UnknownFields
 
 	Val  uint32                `protobuf:"varint,1,opt,name=val,proto3" json:"val,omitempty"`
-	Unit Duration_DurationUnit `protobuf:"varint,2,opt,name=unit,proto3,enum=banyandb.v1.Duration_DurationUnit" json:"unit,omitempty"`
+	Unit Duration_DurationUnit `protobuf:"varint,2,opt,name=unit,proto3,enum=banyandb.database.v1.Duration_DurationUnit" json:"unit,omitempty"`
 }
 
 func (x *Duration) Reset() {
 	*x = Duration{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[1]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[1]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -346,7 +348,7 @@ func (x *Duration) String() string {
 func (*Duration) ProtoMessage() {}
 
 func (x *Duration) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[1]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[1]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -359,7 +361,7 @@ func (x *Duration) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use Duration.ProtoReflect.Descriptor instead.
 func (*Duration) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{1}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{1}
 }
 
 func (x *Duration) GetVal() uint32 {
@@ -381,14 +383,14 @@ type FieldSpec struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Name string              `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
-	Type FieldSpec_FieldType `protobuf:"varint,2,opt,name=type,proto3,enum=banyandb.v1.FieldSpec_FieldType" json:"type,omitempty"`
+	Name string    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+	Type FieldType `protobuf:"varint,2,opt,name=type,proto3,enum=banyandb.database.v1.FieldType" json:"type,omitempty"`
 }
 
 func (x *FieldSpec) Reset() {
 	*x = FieldSpec{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[2]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[2]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -401,7 +403,7 @@ func (x *FieldSpec) String() string {
 func (*FieldSpec) ProtoMessage() {}
 
 func (x *FieldSpec) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[2]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[2]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -414,7 +416,7 @@ func (x *FieldSpec) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use FieldSpec.ProtoReflect.Descriptor instead.
 func (*FieldSpec) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{2}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{2}
 }
 
 func (x *FieldSpec) GetName() string {
@@ -424,11 +426,11 @@ func (x *FieldSpec) GetName() string {
 	return ""
 }
 
-func (x *FieldSpec) GetType() FieldSpec_FieldType {
+func (x *FieldSpec) GetType() FieldType {
 	if x != nil {
 		return x.Type
 	}
-	return FieldSpec_FIELD_TYPE_UNSPECIFIED
+	return FieldType_FIELD_TYPE_UNSPECIFIED
 }
 
 type TraceStateMap struct {
@@ -444,7 +446,7 @@ type TraceStateMap struct {
 func (x *TraceStateMap) Reset() {
 	*x = TraceStateMap{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[3]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[3]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -457,7 +459,7 @@ func (x *TraceStateMap) String() string {
 func (*TraceStateMap) ProtoMessage() {}
 
 func (x *TraceStateMap) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[3]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[3]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -470,7 +472,7 @@ func (x *TraceStateMap) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use TraceStateMap.ProtoReflect.Descriptor instead.
 func (*TraceStateMap) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{3}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{3}
 }
 
 func (x *TraceStateMap) GetField() string {
@@ -512,7 +514,7 @@ type TraceFieldMap struct {
 func (x *TraceFieldMap) Reset() {
 	*x = TraceFieldMap{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[4]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[4]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -525,7 +527,7 @@ func (x *TraceFieldMap) String() string {
 func (*TraceFieldMap) ProtoMessage() {}
 
 func (x *TraceFieldMap) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[4]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[4]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -538,7 +540,7 @@ func (x *TraceFieldMap) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use TraceFieldMap.ProtoReflect.Descriptor instead.
 func (*TraceFieldMap) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{4}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{4}
 }
 
 func (x *TraceFieldMap) GetTraceId() string {
@@ -569,7 +571,7 @@ type TraceSeries struct {
 	unknownFields protoimpl.UnknownFields
 
 	// metadata is the identity of a trace series
-	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
+	Metadata *v1.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
 	// fields defines accepted fields
 	Fields []*FieldSpec `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
 	// reserved_fields_map indicates how to index reserved fields to ingested fields
@@ -585,7 +587,7 @@ type TraceSeries struct {
 func (x *TraceSeries) Reset() {
 	*x = TraceSeries{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[5]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[5]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -598,7 +600,7 @@ func (x *TraceSeries) String() string {
 func (*TraceSeries) ProtoMessage() {}
 
 func (x *TraceSeries) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[5]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[5]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -611,10 +613,10 @@ func (x *TraceSeries) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use TraceSeries.ProtoReflect.Descriptor instead.
 func (*TraceSeries) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{5}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{5}
 }
 
-func (x *TraceSeries) GetMetadata() *Metadata {
+func (x *TraceSeries) GetMetadata() *v1.Metadata {
 	if x != nil {
 		return x.Metadata
 	}
@@ -669,13 +671,13 @@ type IndexObject struct {
 	// Caveat: All fields in a multi-field index MUST have an identical IndexType
 	Fields []string `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
 	// type is the IndexType of this IndexObject.
-	Type IndexObject_IndexType `protobuf:"varint,3,opt,name=type,proto3,enum=banyandb.v1.IndexObject_IndexType" json:"type,omitempty"`
+	Type IndexObject_IndexType `protobuf:"varint,3,opt,name=type,proto3,enum=banyandb.database.v1.IndexObject_IndexType" json:"type,omitempty"`
 }
 
 func (x *IndexObject) Reset() {
 	*x = IndexObject{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[6]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[6]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -688,7 +690,7 @@ func (x *IndexObject) String() string {
 func (*IndexObject) ProtoMessage() {}
 
 func (x *IndexObject) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[6]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[6]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -701,7 +703,7 @@ func (x *IndexObject) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use IndexObject.ProtoReflect.Descriptor instead.
 func (*IndexObject) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{6}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{6}
 }
 
 func (x *IndexObject) GetName() string {
@@ -757,7 +759,7 @@ type IndexRule struct {
 	unknownFields protoimpl.UnknownFields
 
 	// metadata define the rule's identity
-	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
+	Metadata *v1.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
 	// objects refer to which fields should be indexed
 	Objects []*IndexObject `protobuf:"bytes,2,rep,name=objects,proto3" json:"objects,omitempty"`
 	// updated_at_nanoseconds indicates when the IndexRule is updated
@@ -767,7 +769,7 @@ type IndexRule struct {
 func (x *IndexRule) Reset() {
 	*x = IndexRule{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[7]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[7]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -780,7 +782,7 @@ func (x *IndexRule) String() string {
 func (*IndexRule) ProtoMessage() {}
 
 func (x *IndexRule) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[7]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[7]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -793,10 +795,10 @@ func (x *IndexRule) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use IndexRule.ProtoReflect.Descriptor instead.
 func (*IndexRule) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{7}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{7}
 }
 
-func (x *IndexRule) GetMetadata() *Metadata {
+func (x *IndexRule) GetMetadata() *v1.Metadata {
 	if x != nil {
 		return x.Metadata
 	}
@@ -830,15 +832,15 @@ type Series struct {
 	unknownFields protoimpl.UnknownFields
 
 	// catalog is where the subject/series belongs to
-	Catalog Series_Catalog `protobuf:"varint,1,opt,name=catalog,proto3,enum=banyandb.v1.Series_Catalog" json:"catalog,omitempty"`
+	Catalog Series_Catalog `protobuf:"varint,1,opt,name=catalog,proto3,enum=banyandb.database.v1.Series_Catalog" json:"catalog,omitempty"`
 	// series refers to a series in a particular catalog
-	Series *Metadata `protobuf:"bytes,2,opt,name=series,proto3" json:"series,omitempty"`
+	Series *v1.Metadata `protobuf:"bytes,2,opt,name=series,proto3" json:"series,omitempty"`
 }
 
 func (x *Series) Reset() {
 	*x = Series{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[8]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[8]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -851,7 +853,7 @@ func (x *Series) String() string {
 func (*Series) ProtoMessage() {}
 
 func (x *Series) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[8]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[8]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -864,7 +866,7 @@ func (x *Series) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use Series.ProtoReflect.Descriptor instead.
 func (*Series) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{8}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{8}
 }
 
 func (x *Series) GetCatalog() Series_Catalog {
@@ -874,7 +876,7 @@ func (x *Series) GetCatalog() Series_Catalog {
 	return Series_CATALOG_UNSPECIFIED
 }
 
-func (x *Series) GetSeries() *Metadata {
+func (x *Series) GetSeries() *v1.Metadata {
 	if x != nil {
 		return x.Series
 	}
@@ -890,9 +892,9 @@ type IndexRuleBinding struct {
 	unknownFields protoimpl.UnknownFields
 
 	// metadata is the identity of this binding
-	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
+	Metadata *v1.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
 	// rule_ref refers to the IndexRule
-	RuleRef *Metadata `protobuf:"bytes,2,opt,name=rule_ref,json=ruleRef,proto3" json:"rule_ref,omitempty"`
+	RuleRef *v1.Metadata `protobuf:"bytes,2,opt,name=rule_ref,json=ruleRef,proto3" json:"rule_ref,omitempty"`
 	// subjects indicate the subjects of binding action
 	Subjects []*Series `protobuf:"bytes,3,rep,name=subjects,proto3" json:"subjects,omitempty"`
 	// begin_at_nanoseconds is the timestamp, after which the binding will be active
@@ -907,7 +909,7 @@ type IndexRuleBinding struct {
 func (x *IndexRuleBinding) Reset() {
 	*x = IndexRuleBinding{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[9]
+		mi := &file_banyandb_database_v1_schema_proto_msgTypes[9]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -920,7 +922,7 @@ func (x *IndexRuleBinding) String() string {
 func (*IndexRuleBinding) ProtoMessage() {}
 
 func (x *IndexRuleBinding) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[9]
+	mi := &file_banyandb_database_v1_schema_proto_msgTypes[9]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -933,17 +935,17 @@ func (x *IndexRuleBinding) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use IndexRuleBinding.ProtoReflect.Descriptor instead.
 func (*IndexRuleBinding) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{9}
+	return file_banyandb_database_v1_schema_proto_rawDescGZIP(), []int{9}
 }
 
-func (x *IndexRuleBinding) GetMetadata() *Metadata {
+func (x *IndexRuleBinding) GetMetadata() *v1.Metadata {
 	if x != nil {
 		return x.Metadata
 	}
 	return nil
 }
 
-func (x *IndexRuleBinding) GetRuleRef() *Metadata {
+func (x *IndexRuleBinding) GetRuleRef() *v1.Metadata {
 	if x != nil {
 		return x.RuleRef
 	}
@@ -978,150 +980,26 @@ func (x *IndexRuleBinding) GetUpdatedAt() *timestamppb.Timestamp {
 	return nil
 }
 
-type IndexRuleEvent struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Series *Metadata                          `protobuf:"bytes,1,opt,name=series,proto3" json:"series,omitempty"`
-	Rules  []*IndexRuleEvent_ShardedIndexRule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"`
-	Action Action                             `protobuf:"varint,4,opt,name=action,proto3,enum=banyandb.v1.Action" json:"action,omitempty"`
-	Time   *timestamppb.Timestamp             `protobuf:"bytes,5,opt,name=time,proto3" json:"time,omitempty"`
-}
-
-func (x *IndexRuleEvent) Reset() {
-	*x = IndexRuleEvent{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[10]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *IndexRuleEvent) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*IndexRuleEvent) ProtoMessage() {}
-
-func (x *IndexRuleEvent) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[10]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use IndexRuleEvent.ProtoReflect.Descriptor instead.
-func (*IndexRuleEvent) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{10}
-}
-
-func (x *IndexRuleEvent) GetSeries() *Metadata {
-	if x != nil {
-		return x.Series
-	}
-	return nil
-}
-
-func (x *IndexRuleEvent) GetRules() []*IndexRuleEvent_ShardedIndexRule {
-	if x != nil {
-		return x.Rules
-	}
-	return nil
-}
-
-func (x *IndexRuleEvent) GetAction() Action {
-	if x != nil {
-		return x.Action
-	}
-	return Action_ACTION_UNSPECIFIED
-}
-
-func (x *IndexRuleEvent) GetTime() *timestamppb.Timestamp {
-	if x != nil {
-		return x.Time
-	}
-	return nil
-}
-
-type IndexRuleEvent_ShardedIndexRule struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	ShardId uint64       `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
-	Rules   []*IndexRule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"`
-}
-
-func (x *IndexRuleEvent_ShardedIndexRule) Reset() {
-	*x = IndexRuleEvent_ShardedIndexRule{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_schema_proto_msgTypes[11]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *IndexRuleEvent_ShardedIndexRule) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*IndexRuleEvent_ShardedIndexRule) ProtoMessage() {}
-
-func (x *IndexRuleEvent_ShardedIndexRule) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_schema_proto_msgTypes[11]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use IndexRuleEvent_ShardedIndexRule.ProtoReflect.Descriptor instead.
-func (*IndexRuleEvent_ShardedIndexRule) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_schema_proto_rawDescGZIP(), []int{10, 0}
-}
-
-func (x *IndexRuleEvent_ShardedIndexRule) GetShardId() uint64 {
-	if x != nil {
-		return x.ShardId
-	}
-	return 0
-}
-
-func (x *IndexRuleEvent_ShardedIndexRule) GetRules() []*IndexRule {
-	if x != nil {
-		return x.Rules
-	}
-	return nil
-}
-
-var File_banyandb_v1_schema_proto protoreflect.FileDescriptor
-
-var file_banyandb_v1_schema_proto_rawDesc = []byte{
-	0x0a, 0x18, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63,
-	0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x61, 0x6e, 0x79,
-	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
-	0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
-	0x64, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x09, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66,
-	0x6f, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x0d, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75,
-	0x74, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
-	0x09, 0x52, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73,
-	0x22, 0xe4, 0x01, 0x0a, 0x08, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a,
-	0x03, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12,
-	0x36, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e,
-	0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x75, 0x72, 0x61,
+var File_banyandb_database_v1_schema_proto protoreflect.FileDescriptor
+
+var file_banyandb_database_v1_schema_proto_rawDesc = []byte{
+	0x0a, 0x21, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
+	0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x12, 0x14, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61,
+	0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+	0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73,
+	0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x62, 0x61, 0x6e, 0x79,
+	0x61, 0x6e, 0x64, 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63,
+	0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x09, 0x53,
+	0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62,
+	0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
+	0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c,
+	0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e,
+	0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0xed, 0x01, 0x0a, 0x08, 0x44, 0x75, 0x72, 0x61,
+	0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x0d, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x3f, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
+	0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x75, 0x72, 0x61,
 	0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x69,
 	0x74, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x22, 0x8d, 0x01, 0x0a, 0x0c, 0x44, 0x75, 0x72, 0x61,
 	0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x55, 0x52, 0x41,
@@ -1132,62 +1010,57 @@ var file_banyandb_v1_schema_proto_rawDesc = []byte{
 	0x5f, 0x44, 0x41, 0x59, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49,
 	0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x5f, 0x57, 0x45, 0x45, 0x4b, 0x10, 0x03, 0x12, 0x17,
 	0x0a, 0x13, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x5f,
-	0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x10, 0x04, 0x22, 0xe1, 0x01, 0x0a, 0x09, 0x46, 0x69, 0x65, 0x6c,
-	0x64, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70,
-	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
-	0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x70, 0x65, 0x63, 0x2e,
-	0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22,
-	0x89, 0x01, 0x0a, 0x09, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a,
-	0x16, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50,
-	0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x49, 0x45,
-	0x4c, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01,
-	0x12, 0x12, 0x0a, 0x0e, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49,
-	0x4e, 0x54, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x59,
-	0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10,
-	0x03, 0x12, 0x18, 0x0a, 0x14, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
-	0x49, 0x4e, 0x54, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x04, 0x22, 0x63, 0x0a, 0x0d, 0x54,
-	0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05,
-	0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65,
-	0x6c, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73,
-	0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x53, 0x75, 0x63, 0x63,
-	0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72,
-	0x22, 0x79, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61,
-	0x70, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09,
-	0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
-	0x08, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61,
-	0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
-	0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74,
-	0x65, 0x4d, 0x61, 0x70, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xd8, 0x02, 0x0a, 0x0b,
-	0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x08, 0x6d,
-	0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e,
-	0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61,
-	0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e,
-	0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16,
-	0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65,
-	0x6c, 0x64, 0x53, 0x70, 0x65, 0x63, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x4a,
-	0x0a, 0x13, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64,
-	0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x61,
-	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x46,
-	0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x52, 0x11, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,
-	0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x68,
-	0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61, 0x6e, 0x79,
-	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66,
-	0x6f, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x31, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61,
-	0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e,
-	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
-	0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x75,
-	0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32,
-	0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
-	0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64,
-	0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xb8, 0x02, 0x0a, 0x0b, 0x49, 0x6e, 0x64, 0x65, 0x78,
-	0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69,
-	0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c,
-	0x64, 0x73, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e,
-	0x32, 0x22, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x49,
+	0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x10, 0x04, 0x22, 0x54, 0x0a, 0x09, 0x46, 0x69, 0x65, 0x6c, 0x64,
+	0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69,
+	0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x63, 0x0a,
+	0x0d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x14,
+	0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66,
+	0x69, 0x65, 0x6c, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x63, 0x63,
+	0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x53, 0x75,
+	0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x5f, 0x65, 0x72, 0x72,
+	0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x45, 0x72, 0x72,
+	0x6f, 0x72, 0x22, 0x82, 0x01, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x46, 0x69, 0x65, 0x6c,
+	0x64, 0x4d, 0x61, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12,
+	0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03,
+	0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x05,
+	0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x61,
+	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e,
+	0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x70,
+	0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x83, 0x03, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x63,
+	0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64,
+	0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79,
+	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d,
+	0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+	0x61, 0x12, 0x37, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
+	0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74,
+	0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x70,
+	0x65, 0x63, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x53, 0x0a, 0x13, 0x72, 0x65,
+	0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, 0x6d, 0x61,
+	0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
+	0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54,
+	0x72, 0x61, 0x63, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x52, 0x11, 0x72, 0x65,
+	0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x4d, 0x61, 0x70, 0x12,
+	0x35, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f,
+	0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+	0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52,
+	0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,
+	0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+	0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,
+	0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74,
+	0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+	0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xc1, 0x02,
+	0x0a, 0x0b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a,
+	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
+	0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
+	0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x79, 0x70,
+	0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
+	0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49,
 	0x6e, 0x64, 0x65, 0x78, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78,
 	0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xc4, 0x01, 0x0a, 0x09, 0x49,
 	0x6e, 0x64, 0x65, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x44, 0x45,
@@ -1202,157 +1075,142 @@ var file_banyandb_v1_schema_proto_rawDesc = []byte{
 	0x4d, 0x55, 0x4c, 0x54, 0x49, 0x5f, 0x4e, 0x55, 0x4d, 0x45, 0x52, 0x49, 0x43, 0x41, 0x4c, 0x10,
 	0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
 	0x53, 0x45, 0x52, 0x49, 0x45, 0x53, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10,
-	0x06, 0x22, 0xad, 0x01, 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x12,
-	0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e,
-	0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61,
-	0x74, 0x61, 0x12, 0x32, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20,
-	0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76,
+	0x06, 0x22, 0xbd, 0x01, 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x12,
+	0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
+	0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52,
+	0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x62, 0x6a,
+	0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x61, 0x6e,
+	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
 	0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x6f,
 	0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
 	0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
 	0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
 	0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41,
-	0x74, 0x22, 0xca, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x07,
-	0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e,
-	0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x69,
-	0x65, 0x73, 0x2e, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61,
-	0x6c, 0x6f, 0x67, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76,
+	0x74, 0x22, 0xda, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x07,
+	0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e,
+	0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+	0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x43, 0x61, 0x74, 0x61,
+	0x6c, 0x6f, 0x67, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x34, 0x0a, 0x06,
+	0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62,
+	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76,
 	0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69,
 	0x65, 0x73, 0x22, 0x5a, 0x0a, 0x07, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x17, 0x0a,
 	0x13, 0x43, 0x41, 0x54, 0x41, 0x4c, 0x4f, 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
 	0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x41, 0x54, 0x41, 0x4c, 0x4f,
 	0x47, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x54,
 	0x41, 0x4c, 0x4f, 0x47, 0x5f, 0x4c, 0x4f, 0x47, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x41,
-	0x54, 0x41, 0x4c, 0x4f, 0x47, 0x5f, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x03, 0x22, 0xd3,
+	0x54, 0x41, 0x4c, 0x4f, 0x47, 0x5f, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x03, 0x22, 0xea,
 	0x02, 0x0a, 0x10, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64,
-	0x69, 0x6e, 0x67, 0x12, 0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62,
-	0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65,
-	0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x72,
-	0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
-	0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52,
-	0x07, 0x72, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x6a,
-	0x65, 0x63, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x61, 0x6e,
-	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52,
-	0x08, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x62, 0x65, 0x67,
-	0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
-	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
-	0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x41, 0x74,
-	0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20,
-	0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
-	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52,
-	0x08, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64,
-	0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
-	0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
-	0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74,
-	0x65, 0x64, 0x41, 0x74, 0x22, 0xbd, 0x02, 0x0a, 0x0e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75,
-	0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65,
-	0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
-	0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06,
-	0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18,
-	0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62,
-	0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x76, 0x65,
-	0x6e, 0x74, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52,
-	0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x06, 0x61, 0x63,
-	0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x61, 0x6e,
-	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
-	0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18,
-	0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
-	0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x5b, 0x0a, 0x10, 0x53, 0x68, 0x61, 0x72, 0x64,
-	0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73,
-	0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x73,
-	0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18,
-	0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62,
-	0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72,
-	0x75, 0x6c, 0x65, 0x73, 0x42, 0x60, 0x0a, 0x1e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63,
-	0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61,
-	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
-	0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c,
-	0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70,
-	0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62,
-	0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x69, 0x6e, 0x67, 0x12, 0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62,
+	0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64,
+	0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x37, 0x0a,
+	0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+	0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
+	0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x72,
+	0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x12, 0x38, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63,
+	0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+	0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73,
+	0x12, 0x35, 0x0a, 0x08, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07,
+	0x62, 0x65, 0x67, 0x69, 0x6e, 0x41, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72,
+	0x65, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
+	0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
+	0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x41, 0x74,
+	0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06,
+	0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
+	0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x2a, 0x89, 0x01, 0x0a, 0x09,
+	0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x46, 0x49, 0x45,
+	0x4c, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
+	0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54,
+	0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e,
+	0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x10, 0x02,
+	0x12, 0x1b, 0x0a, 0x17, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53,
+	0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x03, 0x12, 0x18, 0x0a,
+	0x14, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x5f,
+	0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x04, 0x42, 0x72, 0x0a, 0x2a, 0x6f, 0x72, 0x67, 0x2e, 0x61,
+	0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67,
+	0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+	0x73, 0x65, 0x2e, 0x76, 0x31, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
+	0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b,
+	0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69,
+	0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f,
+	0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x33,
 }
 
 var (
-	file_banyandb_v1_schema_proto_rawDescOnce sync.Once
-	file_banyandb_v1_schema_proto_rawDescData = file_banyandb_v1_schema_proto_rawDesc
+	file_banyandb_database_v1_schema_proto_rawDescOnce sync.Once
+	file_banyandb_database_v1_schema_proto_rawDescData = file_banyandb_database_v1_schema_proto_rawDesc
 )
 
-func file_banyandb_v1_schema_proto_rawDescGZIP() []byte {
-	file_banyandb_v1_schema_proto_rawDescOnce.Do(func() {
-		file_banyandb_v1_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_v1_schema_proto_rawDescData)
+func file_banyandb_database_v1_schema_proto_rawDescGZIP() []byte {
+	file_banyandb_database_v1_schema_proto_rawDescOnce.Do(func() {
+		file_banyandb_database_v1_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_database_v1_schema_proto_rawDescData)
 	})
-	return file_banyandb_v1_schema_proto_rawDescData
-}
-
-var file_banyandb_v1_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
-var file_banyandb_v1_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
-var file_banyandb_v1_schema_proto_goTypes = []interface{}{
-	(Duration_DurationUnit)(0),              // 0: banyandb.v1.Duration.DurationUnit
-	(FieldSpec_FieldType)(0),                // 1: banyandb.v1.FieldSpec.FieldType
-	(IndexObject_IndexType)(0),              // 2: banyandb.v1.IndexObject.IndexType
-	(Series_Catalog)(0),                     // 3: banyandb.v1.Series.Catalog
-	(*ShardInfo)(nil),                       // 4: banyandb.v1.ShardInfo
-	(*Duration)(nil),                        // 5: banyandb.v1.Duration
-	(*FieldSpec)(nil),                       // 6: banyandb.v1.FieldSpec
-	(*TraceStateMap)(nil),                   // 7: banyandb.v1.TraceStateMap
-	(*TraceFieldMap)(nil),                   // 8: banyandb.v1.TraceFieldMap
-	(*TraceSeries)(nil),                     // 9: banyandb.v1.TraceSeries
-	(*IndexObject)(nil),                     // 10: banyandb.v1.IndexObject
-	(*IndexRule)(nil),                       // 11: banyandb.v1.IndexRule
-	(*Series)(nil),                          // 12: banyandb.v1.Series
-	(*IndexRuleBinding)(nil),                // 13: banyandb.v1.IndexRuleBinding
-	(*IndexRuleEvent)(nil),                  // 14: banyandb.v1.IndexRuleEvent
-	(*IndexRuleEvent_ShardedIndexRule)(nil), // 15: banyandb.v1.IndexRuleEvent.ShardedIndexRule
-	(*Metadata)(nil),                        // 16: banyandb.v1.Metadata
-	(*timestamppb.Timestamp)(nil),           // 17: google.protobuf.Timestamp
-	(Action)(0),                             // 18: banyandb.v1.Action
-}
-var file_banyandb_v1_schema_proto_depIdxs = []int32{
-	0,  // 0: banyandb.v1.Duration.unit:type_name -> banyandb.v1.Duration.DurationUnit
-	1,  // 1: banyandb.v1.FieldSpec.type:type_name -> banyandb.v1.FieldSpec.FieldType
-	7,  // 2: banyandb.v1.TraceFieldMap.state:type_name -> banyandb.v1.TraceStateMap
-	16, // 3: banyandb.v1.TraceSeries.metadata:type_name -> banyandb.v1.Metadata
-	6,  // 4: banyandb.v1.TraceSeries.fields:type_name -> banyandb.v1.FieldSpec
-	8,  // 5: banyandb.v1.TraceSeries.reserved_fields_map:type_name -> banyandb.v1.TraceFieldMap
-	4,  // 6: banyandb.v1.TraceSeries.shard:type_name -> banyandb.v1.ShardInfo
-	5,  // 7: banyandb.v1.TraceSeries.duration:type_name -> banyandb.v1.Duration
-	17, // 8: banyandb.v1.TraceSeries.updated_at:type_name -> google.protobuf.Timestamp
-	2,  // 9: banyandb.v1.IndexObject.type:type_name -> banyandb.v1.IndexObject.IndexType
-	16, // 10: banyandb.v1.IndexRule.metadata:type_name -> banyandb.v1.Metadata
-	10, // 11: banyandb.v1.IndexRule.objects:type_name -> banyandb.v1.IndexObject
-	17, // 12: banyandb.v1.IndexRule.updated_at:type_name -> google.protobuf.Timestamp
-	3,  // 13: banyandb.v1.Series.catalog:type_name -> banyandb.v1.Series.Catalog
-	16, // 14: banyandb.v1.Series.series:type_name -> banyandb.v1.Metadata
-	16, // 15: banyandb.v1.IndexRuleBinding.metadata:type_name -> banyandb.v1.Metadata
-	16, // 16: banyandb.v1.IndexRuleBinding.rule_ref:type_name -> banyandb.v1.Metadata
-	12, // 17: banyandb.v1.IndexRuleBinding.subjects:type_name -> banyandb.v1.Series
-	17, // 18: banyandb.v1.IndexRuleBinding.begin_at:type_name -> google.protobuf.Timestamp
-	17, // 19: banyandb.v1.IndexRuleBinding.expire_at:type_name -> google.protobuf.Timestamp
-	17, // 20: banyandb.v1.IndexRuleBinding.updated_at:type_name -> google.protobuf.Timestamp
-	16, // 21: banyandb.v1.IndexRuleEvent.series:type_name -> banyandb.v1.Metadata
-	15, // 22: banyandb.v1.IndexRuleEvent.rules:type_name -> banyandb.v1.IndexRuleEvent.ShardedIndexRule
-	18, // 23: banyandb.v1.IndexRuleEvent.action:type_name -> banyandb.v1.Action
-	17, // 24: banyandb.v1.IndexRuleEvent.time:type_name -> google.protobuf.Timestamp
-	11, // 25: banyandb.v1.IndexRuleEvent.ShardedIndexRule.rules:type_name -> banyandb.v1.IndexRule
-	26, // [26:26] is the sub-list for method output_type
-	26, // [26:26] is the sub-list for method input_type
-	26, // [26:26] is the sub-list for extension type_name
-	26, // [26:26] is the sub-list for extension extendee
-	0,  // [0:26] is the sub-list for field type_name
-}
-
-func init() { file_banyandb_v1_schema_proto_init() }
-func file_banyandb_v1_schema_proto_init() {
-	if File_banyandb_v1_schema_proto != nil {
+	return file_banyandb_database_v1_schema_proto_rawDescData
+}
+
+var file_banyandb_database_v1_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
+var file_banyandb_database_v1_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
+var file_banyandb_database_v1_schema_proto_goTypes = []interface{}{
+	(FieldType)(0),                // 0: banyandb.database.v1.FieldType
+	(Duration_DurationUnit)(0),    // 1: banyandb.database.v1.Duration.DurationUnit
+	(IndexObject_IndexType)(0),    // 2: banyandb.database.v1.IndexObject.IndexType
+	(Series_Catalog)(0),           // 3: banyandb.database.v1.Series.Catalog
+	(*ShardInfo)(nil),             // 4: banyandb.database.v1.ShardInfo
+	(*Duration)(nil),              // 5: banyandb.database.v1.Duration
+	(*FieldSpec)(nil),             // 6: banyandb.database.v1.FieldSpec
+	(*TraceStateMap)(nil),         // 7: banyandb.database.v1.TraceStateMap
+	(*TraceFieldMap)(nil),         // 8: banyandb.database.v1.TraceFieldMap
+	(*TraceSeries)(nil),           // 9: banyandb.database.v1.TraceSeries
+	(*IndexObject)(nil),           // 10: banyandb.database.v1.IndexObject
+	(*IndexRule)(nil),             // 11: banyandb.database.v1.IndexRule
+	(*Series)(nil),                // 12: banyandb.database.v1.Series
+	(*IndexRuleBinding)(nil),      // 13: banyandb.database.v1.IndexRuleBinding
+	(*v1.Metadata)(nil),           // 14: banyandb.common.v1.Metadata
+	(*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp
+}
+var file_banyandb_database_v1_schema_proto_depIdxs = []int32{
+	1,  // 0: banyandb.database.v1.Duration.unit:type_name -> banyandb.database.v1.Duration.DurationUnit
+	0,  // 1: banyandb.database.v1.FieldSpec.type:type_name -> banyandb.database.v1.FieldType
+	7,  // 2: banyandb.database.v1.TraceFieldMap.state:type_name -> banyandb.database.v1.TraceStateMap
+	14, // 3: banyandb.database.v1.TraceSeries.metadata:type_name -> banyandb.common.v1.Metadata
+	6,  // 4: banyandb.database.v1.TraceSeries.fields:type_name -> banyandb.database.v1.FieldSpec
+	8,  // 5: banyandb.database.v1.TraceSeries.reserved_fields_map:type_name -> banyandb.database.v1.TraceFieldMap
+	4,  // 6: banyandb.database.v1.TraceSeries.shard:type_name -> banyandb.database.v1.ShardInfo
+	5,  // 7: banyandb.database.v1.TraceSeries.duration:type_name -> banyandb.database.v1.Duration
+	15, // 8: banyandb.database.v1.TraceSeries.updated_at:type_name -> google.protobuf.Timestamp
+	2,  // 9: banyandb.database.v1.IndexObject.type:type_name -> banyandb.database.v1.IndexObject.IndexType
+	14, // 10: banyandb.database.v1.IndexRule.metadata:type_name -> banyandb.common.v1.Metadata
+	10, // 11: banyandb.database.v1.IndexRule.objects:type_name -> banyandb.database.v1.IndexObject
+	15, // 12: banyandb.database.v1.IndexRule.updated_at:type_name -> google.protobuf.Timestamp
+	3,  // 13: banyandb.database.v1.Series.catalog:type_name -> banyandb.database.v1.Series.Catalog
+	14, // 14: banyandb.database.v1.Series.series:type_name -> banyandb.common.v1.Metadata
+	14, // 15: banyandb.database.v1.IndexRuleBinding.metadata:type_name -> banyandb.common.v1.Metadata
+	14, // 16: banyandb.database.v1.IndexRuleBinding.rule_ref:type_name -> banyandb.common.v1.Metadata
+	12, // 17: banyandb.database.v1.IndexRuleBinding.subjects:type_name -> banyandb.database.v1.Series
+	15, // 18: banyandb.database.v1.IndexRuleBinding.begin_at:type_name -> google.protobuf.Timestamp
+	15, // 19: banyandb.database.v1.IndexRuleBinding.expire_at:type_name -> google.protobuf.Timestamp
+	15, // 20: banyandb.database.v1.IndexRuleBinding.updated_at:type_name -> google.protobuf.Timestamp
+	21, // [21:21] is the sub-list for method output_type
+	21, // [21:21] is the sub-list for method input_type
+	21, // [21:21] is the sub-list for extension type_name
+	21, // [21:21] is the sub-list for extension extendee
+	0,  // [0:21] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_database_v1_schema_proto_init() }
+func file_banyandb_database_v1_schema_proto_init() {
+	if File_banyandb_database_v1_schema_proto != nil {
 		return
 	}
-	file_banyandb_v1_database_proto_init()
 	if !protoimpl.UnsafeEnabled {
-		file_banyandb_v1_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*ShardInfo); i {
 			case 0:
 				return &v.state
@@ -1364,7 +1222,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*Duration); i {
 			case 0:
 				return &v.state
@@ -1376,7 +1234,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*FieldSpec); i {
 			case 0:
 				return &v.state
@@ -1388,7 +1246,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*TraceStateMap); i {
 			case 0:
 				return &v.state
@@ -1400,7 +1258,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*TraceFieldMap); i {
 			case 0:
 				return &v.state
@@ -1412,7 +1270,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*TraceSeries); i {
 			case 0:
 				return &v.state
@@ -1424,7 +1282,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*IndexObject); i {
 			case 0:
 				return &v.state
@@ -1436,7 +1294,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*IndexRule); i {
 			case 0:
 				return &v.state
@@ -1448,7 +1306,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*Series); i {
 			case 0:
 				return &v.state
@@ -1460,7 +1318,7 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+		file_banyandb_database_v1_schema_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*IndexRuleBinding); i {
 			case 0:
 				return &v.state
@@ -1472,48 +1330,24 @@ func file_banyandb_v1_schema_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_v1_schema_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*IndexRuleEvent); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_schema_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*IndexRuleEvent_ShardedIndexRule); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
-			RawDescriptor: file_banyandb_v1_schema_proto_rawDesc,
+			RawDescriptor: file_banyandb_database_v1_schema_proto_rawDesc,
 			NumEnums:      4,
-			NumMessages:   12,
+			NumMessages:   10,
 			NumExtensions: 0,
 			NumServices:   0,
 		},
-		GoTypes:           file_banyandb_v1_schema_proto_goTypes,
-		DependencyIndexes: file_banyandb_v1_schema_proto_depIdxs,
-		EnumInfos:         file_banyandb_v1_schema_proto_enumTypes,
-		MessageInfos:      file_banyandb_v1_schema_proto_msgTypes,
+		GoTypes:           file_banyandb_database_v1_schema_proto_goTypes,
+		DependencyIndexes: file_banyandb_database_v1_schema_proto_depIdxs,
+		EnumInfos:         file_banyandb_database_v1_schema_proto_enumTypes,
+		MessageInfos:      file_banyandb_database_v1_schema_proto_msgTypes,
 	}.Build()
-	File_banyandb_v1_schema_proto = out.File
-	file_banyandb_v1_schema_proto_rawDesc = nil
-	file_banyandb_v1_schema_proto_goTypes = nil
-	file_banyandb_v1_schema_proto_depIdxs = nil
+	File_banyandb_database_v1_schema_proto = out.File
+	file_banyandb_database_v1_schema_proto_rawDesc = nil
+	file_banyandb_database_v1_schema_proto_goTypes = nil
+	file_banyandb_database_v1_schema_proto_depIdxs = nil
 }
diff --git a/api/proto/banyandb/database/v1/schema.proto b/api/proto/banyandb/database/v1/schema.proto
new file mode 100644
index 0000000..50daff4
--- /dev/null
+++ b/api/proto/banyandb/database/v1/schema.proto
@@ -0,0 +1,188 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+syntax = "proto3";
+
+option java_package = "org.apache.skywalking.banyandb.database.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1";
+
+package banyandb.database.v1;
+
+import "google/protobuf/timestamp.proto";
+import "banyandb/common/v1/common.proto";
+
+message ShardInfo {
+    uint32 number = 1;
+    repeated string routing_fields = 2;
+}
+
+// Duration represents the elapsed time between two instants
+message Duration {
+    uint32 val = 1;
+    enum DurationUnit {
+        DURATION_UNIT_UNSPECIFIED = 0;
+        DURATION_UNIT_HOUR = 1;
+        DURATION_UNIT_DAY = 2;
+        DURATION_UNIT_WEEK = 3;
+        DURATION_UNIT_MONTH = 4;
+    }
+    DurationUnit unit = 2;
+}
+
+enum FieldType {
+    FIELD_TYPE_UNSPECIFIED=0;
+    FIELD_TYPE_STRING = 1;
+    FIELD_TYPE_INT = 2;
+    FIELD_TYPE_STRING_ARRAY = 3;
+    FIELD_TYPE_INT_ARRAY = 4;
+}
+
+message FieldSpec {
+    string name = 1;
+    FieldType type = 2;
+}
+
+message TraceStateMap {
+    string field = 1;
+    string val_success = 2;
+    string val_error = 3;
+}
+
+// The key in TraceFieldMap are reserved by trace series engine. Their corresponding value is the Fields or
+// the combination of Fields
+message TraceFieldMap {
+    // trace_id the unique identity of a single trace
+    string trace_id = 1;
+    // series_id groups entities into a storage bucket
+    repeated string series_id = 2;
+    // state indicates the trace is "success" or "error"
+    TraceStateMap state = 3;
+}
+
+// TraceSeries represents a trace storage object
+message TraceSeries {
+    // metadata is the identity of a trace series
+    common.v1.Metadata metadata = 1;
+    // fields defines accepted fields
+    repeated FieldSpec fields = 2;
+    // reserved_fields_map indicates how to index reserved fields to ingested fields
+    TraceFieldMap reserved_fields_map = 3;
+    // shard indicates how trace data distributes
+    ShardInfo shard = 4;
+    // duration determines how long a TraceSeries keeps its data
+    Duration duration = 5;
+    // updated_at_nanoseconds indicates when the TraceSeries is updated
+    google.protobuf.Timestamp updated_at = 6;
+}
+
+// IndexObject defines who should be indexed.
+message IndexObject {
+    // name is the identity of a IndexObject
+    string name = 1;
+    // fields are the combination that refers to an indexed object
+    // If the elements in fields are more than 1, the object will generate a multi-field index
+    // Caveat: All fields in a multi-field index MUST have an identical IndexType
+    repeated string fields = 2;
+    // IndexType determine the index structure under the hood
+    // Fields with SeriesInternal type is reserved by Series module, would not be indexed by Index module.
+    enum IndexType {
+        INDEX_TYPE_UNSPECIFIED = 0;
+        INDEX_TYPE_TEXT = 1;
+        INDEX_TYPE_NUMERICAL = 2;
+        INDEX_TYPE_ID = 3;
+        INDEX_TYPE_MULTI_TEXT = 4;
+        INDEX_TYPE_MULTI_NUMERICAL = 5;
+        INDEX_TYPE_SERIES_INTERNAL = 6;
+    }
+    // type is the IndexType of this IndexObject.
+    IndexType type = 3;
+}
+
+// IndexRule defines how to generate indices based on IndexObject
+// IndexRule should bind to an Series through an IndexRuleBinding to generate proper indices.
+// Example: A trace entity wants to index fields: trace_id, service_name, endpoint_name, and latency.
+//          and service_name and endpoint_name would combine a multi-field index.
+// The index rule could be:
+// IndexRule {
+//     metadata: {
+//         name: sw_trace
+//         group: production
+//     }
+//     objects: [
+//        {
+//            fields: [trace_id]
+//            type: ID
+//        },
+//        {
+//            fields: [service_name, endpoint_name]
+//            type: Text
+//        },
+//        {
+//            fields: [latency]
+//            type: Numerical
+//        },
+//    ]
+//    updated_at_nanoseconds: .......
+// }
+message IndexRule {
+    // metadata define the rule's identity
+    common.v1.Metadata metadata = 1;
+    // objects refer to which fields should be indexed
+    repeated IndexObject objects = 2;
+    // updated_at_nanoseconds indicates when the IndexRule is updated
+    google.protobuf.Timestamp updated_at = 6;
+}
+
+// Series defines which subject(series) would generate indices
+// For example, if a TraceSeries's metadata is {name: sw_trace, group: production},
+//                in consequence, the Series is
+//                series {
+//                    catalog: Trace
+//                    series: {name: sw_trace, group: production}
+//                }
+message Series {
+    // Catalog refers to a placement contains objects belonged to a particular data type
+    enum Catalog {
+        CATALOG_UNSPECIFIED = 0;
+        CATALOG_TRACE = 1;
+        CATALOG_LOG = 2;
+        CATALOG_METRIC = 3;
+    }
+    // catalog is where the subject/series belongs to
+    Catalog catalog = 1;
+    // series refers to a series in a particular catalog
+    common.v1.Metadata series = 2;
+}
+
+// IndexRuleBinding is a bridge to connect an IndexRule to several Series
+// This binding is valid between begin_at_nanoseconds and expire_at_nanoseconds, that provides flexible strategies
+// to control how to generate time series indices.
+message IndexRuleBinding {
+    // metadata is the identity of this binding
+    common.v1.Metadata metadata = 1;
+    // rule_ref refers to the IndexRule
+    common.v1.Metadata rule_ref = 2;
+    // subjects indicate the subjects of binding action
+    repeated Series subjects = 3;
+    // begin_at_nanoseconds is the timestamp, after which the binding will be active
+    google.protobuf.Timestamp begin_at = 4;
+    // expire_at_nanoseconds it the timestamp, after which the binding will be inactive
+    // expire_at_nanoseconds must be larger than begin_at_nanoseconds
+    google.protobuf.Timestamp expire_at = 5;
+    // updated_at_nanoseconds indicates when the IndexRuleBinding is updated
+    google.protobuf.Timestamp updated_at = 6;
+}
diff --git a/api/proto/banyandb/model/v1/common.pb.go b/api/proto/banyandb/model/v1/common.pb.go
new file mode 100644
index 0000000..05a9cf3
--- /dev/null
+++ b/api/proto/banyandb/model/v1/common.pb.go
@@ -0,0 +1,353 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/model/v1/common.proto
+
+package v1
+
+import (
+	reflect "reflect"
+	sync "sync"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Str struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
+}
+
+func (x *Str) Reset() {
+	*x = Str{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_common_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Str) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Str) ProtoMessage() {}
+
+func (x *Str) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_common_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Str.ProtoReflect.Descriptor instead.
+func (*Str) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_common_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Str) GetValue() string {
+	if x != nil {
+		return x.Value
+	}
+	return ""
+}
+
+type Int struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
+}
+
+func (x *Int) Reset() {
+	*x = Int{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_common_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Int) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Int) ProtoMessage() {}
+
+func (x *Int) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_common_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Int.ProtoReflect.Descriptor instead.
+func (*Int) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_common_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *Int) GetValue() int64 {
+	if x != nil {
+		return x.Value
+	}
+	return 0
+}
+
+type StrArray struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
+}
+
+func (x *StrArray) Reset() {
+	*x = StrArray{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_common_proto_msgTypes[2]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *StrArray) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*StrArray) ProtoMessage() {}
+
+func (x *StrArray) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_common_proto_msgTypes[2]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use StrArray.ProtoReflect.Descriptor instead.
+func (*StrArray) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_common_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *StrArray) GetValue() []string {
+	if x != nil {
+		return x.Value
+	}
+	return nil
+}
+
+type IntArray struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Value []int64 `protobuf:"varint,1,rep,packed,name=value,proto3" json:"value,omitempty"`
+}
+
+func (x *IntArray) Reset() {
+	*x = IntArray{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_common_proto_msgTypes[3]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *IntArray) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*IntArray) ProtoMessage() {}
+
+func (x *IntArray) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_common_proto_msgTypes[3]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use IntArray.ProtoReflect.Descriptor instead.
+func (*IntArray) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_common_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *IntArray) GetValue() []int64 {
+	if x != nil {
+		return x.Value
+	}
+	return nil
+}
+
+var File_banyandb_model_v1_common_proto protoreflect.FileDescriptor
+
+var file_banyandb_model_v1_common_proto_rawDesc = []byte{
+	0x0a, 0x1e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+	0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x12, 0x11, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+	0x2e, 0x76, 0x31, 0x22, 0x1b, 0x0a, 0x03, 0x53, 0x74, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
+	0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+	0x22, 0x1b, 0x0a, 0x03, 0x49, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x20, 0x0a,
+	0x08, 0x53, 0x74, 0x72, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
+	0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22,
+	0x20, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
+	0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
+	0x65, 0x42, 0x6c, 0x0a, 0x27, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e,
+	0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x5a, 0x41, 0x67, 0x69,
+	0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f,
+	0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61,
+	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x62,
+	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_banyandb_model_v1_common_proto_rawDescOnce sync.Once
+	file_banyandb_model_v1_common_proto_rawDescData = file_banyandb_model_v1_common_proto_rawDesc
+)
+
+func file_banyandb_model_v1_common_proto_rawDescGZIP() []byte {
+	file_banyandb_model_v1_common_proto_rawDescOnce.Do(func() {
+		file_banyandb_model_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_model_v1_common_proto_rawDescData)
+	})
+	return file_banyandb_model_v1_common_proto_rawDescData
+}
+
+var file_banyandb_model_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
+var file_banyandb_model_v1_common_proto_goTypes = []interface{}{
+	(*Str)(nil),      // 0: banyandb.model.v1.Str
+	(*Int)(nil),      // 1: banyandb.model.v1.Int
+	(*StrArray)(nil), // 2: banyandb.model.v1.StrArray
+	(*IntArray)(nil), // 3: banyandb.model.v1.IntArray
+}
+var file_banyandb_model_v1_common_proto_depIdxs = []int32{
+	0, // [0:0] is the sub-list for method output_type
+	0, // [0:0] is the sub-list for method input_type
+	0, // [0:0] is the sub-list for extension type_name
+	0, // [0:0] is the sub-list for extension extendee
+	0, // [0:0] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_model_v1_common_proto_init() }
+func file_banyandb_model_v1_common_proto_init() {
+	if File_banyandb_model_v1_common_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_banyandb_model_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Str); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_model_v1_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Int); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_model_v1_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*StrArray); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_model_v1_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*IntArray); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_model_v1_common_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   4,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_banyandb_model_v1_common_proto_goTypes,
+		DependencyIndexes: file_banyandb_model_v1_common_proto_depIdxs,
+		MessageInfos:      file_banyandb_model_v1_common_proto_msgTypes,
+	}.Build()
+	File_banyandb_model_v1_common_proto = out.File
+	file_banyandb_model_v1_common_proto_rawDesc = nil
+	file_banyandb_model_v1_common_proto_goTypes = nil
+	file_banyandb_model_v1_common_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/v1/rpc.proto b/api/proto/banyandb/model/v1/common.proto
similarity index 71%
copy from api/proto/banyandb/v1/rpc.proto
copy to api/proto/banyandb/model/v1/common.proto
index 85fafd8..59f77e0 100644
--- a/api/proto/banyandb/v1/rpc.proto
+++ b/api/proto/banyandb/model/v1/common.proto
@@ -17,15 +17,23 @@
 
 syntax = "proto3";
 
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
+package banyandb.model.v1;
 
-package banyandb.v1;
+option java_package = "org.apache.skywalking.banyandb.model.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1";
 
-import "banyandb/v1/query.proto";
-import "banyandb/v1/write.proto";
+message Str {
+    string value = 1;
+}
 
-service TraceService {
-  rpc Query(banyandb.v1.QueryRequest) returns (banyandb.v1.QueryResponse);
-  rpc Write(stream banyandb.v1.WriteRequest) returns (stream banyandb.v1.WriteResponse);
-}
\ No newline at end of file
+message Int {
+    int64 value = 1;
+}
+
+message StrArray {
+    repeated string value = 1;
+}
+
+message IntArray {
+    repeated int64 value = 1;
+}
diff --git a/api/proto/banyandb/model/v1/query.pb.go b/api/proto/banyandb/model/v1/query.pb.go
new file mode 100644
index 0000000..c834968
--- /dev/null
+++ b/api/proto/banyandb/model/v1/query.pb.go
@@ -0,0 +1,810 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/model/v1/query.proto
+
+package v1
+
+import (
+	reflect "reflect"
+	sync "sync"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// BinaryOp specifies the operation imposed to the given query condition
+// For EQ, NE, LT, GT, LE and GE, only one operand should be given, i.e. one-to-one relationship.
+// HAVING and NOT_HAVING allow multi-value to be the operand such as array/vector, i.e. one-to-many relationship.
+// For example, "keyA" contains "valueA" **and** "valueB"
+type PairQuery_BinaryOp int32
+
+const (
+	PairQuery_BINARY_OP_UNSPECIFIED PairQuery_BinaryOp = 0
+	PairQuery_BINARY_OP_EQ          PairQuery_BinaryOp = 1
+	PairQuery_BINARY_OP_NE          PairQuery_BinaryOp = 2
+	PairQuery_BINARY_OP_LT          PairQuery_BinaryOp = 3
+	PairQuery_BINARY_OP_GT          PairQuery_BinaryOp = 4
+	PairQuery_BINARY_OP_LE          PairQuery_BinaryOp = 5
+	PairQuery_BINARY_OP_GE          PairQuery_BinaryOp = 6
+	PairQuery_BINARY_OP_HAVING      PairQuery_BinaryOp = 7
+	PairQuery_BINARY_OP_NOT_HAVING  PairQuery_BinaryOp = 8
+)
+
+// Enum value maps for PairQuery_BinaryOp.
+var (
+	PairQuery_BinaryOp_name = map[int32]string{
+		0: "BINARY_OP_UNSPECIFIED",
+		1: "BINARY_OP_EQ",
+		2: "BINARY_OP_NE",
+		3: "BINARY_OP_LT",
+		4: "BINARY_OP_GT",
+		5: "BINARY_OP_LE",
+		6: "BINARY_OP_GE",
+		7: "BINARY_OP_HAVING",
+		8: "BINARY_OP_NOT_HAVING",
+	}
+	PairQuery_BinaryOp_value = map[string]int32{
+		"BINARY_OP_UNSPECIFIED": 0,
+		"BINARY_OP_EQ":          1,
+		"BINARY_OP_NE":          2,
+		"BINARY_OP_LT":          3,
+		"BINARY_OP_GT":          4,
+		"BINARY_OP_LE":          5,
+		"BINARY_OP_GE":          6,
+		"BINARY_OP_HAVING":      7,
+		"BINARY_OP_NOT_HAVING":  8,
+	}
+)
+
+func (x PairQuery_BinaryOp) Enum() *PairQuery_BinaryOp {
+	p := new(PairQuery_BinaryOp)
+	*p = x
+	return p
+}
+
+func (x PairQuery_BinaryOp) String() string {
+	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (PairQuery_BinaryOp) Descriptor() protoreflect.EnumDescriptor {
+	return file_banyandb_model_v1_query_proto_enumTypes[0].Descriptor()
+}
+
+func (PairQuery_BinaryOp) Type() protoreflect.EnumType {
+	return &file_banyandb_model_v1_query_proto_enumTypes[0]
+}
+
+func (x PairQuery_BinaryOp) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use PairQuery_BinaryOp.Descriptor instead.
+func (PairQuery_BinaryOp) EnumDescriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_query_proto_rawDescGZIP(), []int{1, 0}
+}
+
+type QueryOrder_Sort int32
+
+const (
+	QueryOrder_SORT_UNSPECIFIED QueryOrder_Sort = 0
+	QueryOrder_SORT_DESC        QueryOrder_Sort = 1
+	QueryOrder_SORT_ASC         QueryOrder_Sort = 2
+)
+
+// Enum value maps for QueryOrder_Sort.
+var (
+	QueryOrder_Sort_name = map[int32]string{
+		0: "SORT_UNSPECIFIED",
+		1: "SORT_DESC",
+		2: "SORT_ASC",
+	}
+	QueryOrder_Sort_value = map[string]int32{
+		"SORT_UNSPECIFIED": 0,
+		"SORT_DESC":        1,
+		"SORT_ASC":         2,
+	}
+)
+
+func (x QueryOrder_Sort) Enum() *QueryOrder_Sort {
+	p := new(QueryOrder_Sort)
+	*p = x
+	return p
+}
+
+func (x QueryOrder_Sort) String() string {
+	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (QueryOrder_Sort) Descriptor() protoreflect.EnumDescriptor {
+	return file_banyandb_model_v1_query_proto_enumTypes[1].Descriptor()
+}
+
+func (QueryOrder_Sort) Type() protoreflect.EnumType {
+	return &file_banyandb_model_v1_query_proto_enumTypes[1]
+}
+
+func (x QueryOrder_Sort) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use QueryOrder_Sort.Descriptor instead.
+func (QueryOrder_Sort) EnumDescriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_query_proto_rawDescGZIP(), []int{2, 0}
+}
+
+// Pair is the building block of a record which is equivalent to a key-value pair.
+// In the context of Trace, it could be metadata of a trace such as service_name, service_instance, etc.
+// Besides, other fields/tags are organized in key-value pair in the underlying storage layer.
+// One should notice that the values can be a multi-value.
+type TypedPair struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
+	// Types that are assignable to Typed:
+	//	*TypedPair_NullPair
+	//	*TypedPair_IntPair
+	//	*TypedPair_StrPair
+	//	*TypedPair_IntArrayPair
+	//	*TypedPair_StrArrayPair
+	Typed isTypedPair_Typed `protobuf_oneof:"typed"`
+}
+
+func (x *TypedPair) Reset() {
+	*x = TypedPair{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_query_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *TypedPair) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TypedPair) ProtoMessage() {}
+
+func (x *TypedPair) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_query_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use TypedPair.ProtoReflect.Descriptor instead.
+func (*TypedPair) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_query_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *TypedPair) GetKey() string {
+	if x != nil {
+		return x.Key
+	}
+	return ""
+}
+
+func (m *TypedPair) GetTyped() isTypedPair_Typed {
+	if m != nil {
+		return m.Typed
+	}
+	return nil
+}
+
+func (x *TypedPair) GetNullPair() *TypedPair_NullWithType {
+	if x, ok := x.GetTyped().(*TypedPair_NullPair); ok {
+		return x.NullPair
+	}
+	return nil
+}
+
+func (x *TypedPair) GetIntPair() *Int {
+	if x, ok := x.GetTyped().(*TypedPair_IntPair); ok {
+		return x.IntPair
+	}
+	return nil
+}
+
+func (x *TypedPair) GetStrPair() *Str {
+	if x, ok := x.GetTyped().(*TypedPair_StrPair); ok {
+		return x.StrPair
+	}
+	return nil
+}
+
+func (x *TypedPair) GetIntArrayPair() *IntArray {
+	if x, ok := x.GetTyped().(*TypedPair_IntArrayPair); ok {
+		return x.IntArrayPair
+	}
+	return nil
+}
+
+func (x *TypedPair) GetStrArrayPair() *StrArray {
+	if x, ok := x.GetTyped().(*TypedPair_StrArrayPair); ok {
+		return x.StrArrayPair
+	}
+	return nil
+}
+
+type isTypedPair_Typed interface {
+	isTypedPair_Typed()
+}
+
+type TypedPair_NullPair struct {
+	NullPair *TypedPair_NullWithType `protobuf:"bytes,2,opt,name=null_pair,json=nullPair,proto3,oneof"`
+}
+
+type TypedPair_IntPair struct {
+	IntPair *Int `protobuf:"bytes,3,opt,name=int_pair,json=intPair,proto3,oneof"`
+}
+
+type TypedPair_StrPair struct {
+	StrPair *Str `protobuf:"bytes,4,opt,name=str_pair,json=strPair,proto3,oneof"`
+}
+
+type TypedPair_IntArrayPair struct {
+	IntArrayPair *IntArray `protobuf:"bytes,5,opt,name=int_array_pair,json=intArrayPair,proto3,oneof"`
+}
+
+type TypedPair_StrArrayPair struct {
+	StrArrayPair *StrArray `protobuf:"bytes,6,opt,name=str_array_pair,json=strArrayPair,proto3,oneof"`
+}
+
+func (*TypedPair_NullPair) isTypedPair_Typed() {}
+
+func (*TypedPair_IntPair) isTypedPair_Typed() {}
+
+func (*TypedPair_StrPair) isTypedPair_Typed() {}
+
+func (*TypedPair_IntArrayPair) isTypedPair_Typed() {}
+
+func (*TypedPair_StrArrayPair) isTypedPair_Typed() {}
+
+// PairQuery consists of the query condition with a single binary operator to be imposed
+// For 1:1 BinaryOp, values in condition must be an array with length = 1,
+// while for 1:N BinaryOp, values can be an array with length >= 1.
+type PairQuery struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Op        PairQuery_BinaryOp `protobuf:"varint,1,opt,name=op,proto3,enum=banyandb.model.v1.PairQuery_BinaryOp" json:"op,omitempty"`
+	Condition *TypedPair         `protobuf:"bytes,2,opt,name=condition,proto3" json:"condition,omitempty"`
+}
+
+func (x *PairQuery) Reset() {
+	*x = PairQuery{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_query_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *PairQuery) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PairQuery) ProtoMessage() {}
+
+func (x *PairQuery) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_query_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use PairQuery.ProtoReflect.Descriptor instead.
+func (*PairQuery) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_query_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *PairQuery) GetOp() PairQuery_BinaryOp {
+	if x != nil {
+		return x.Op
+	}
+	return PairQuery_BINARY_OP_UNSPECIFIED
+}
+
+func (x *PairQuery) GetCondition() *TypedPair {
+	if x != nil {
+		return x.Condition
+	}
+	return nil
+}
+
+// QueryOrder means a Sort operation to be done for a given field.
+// The key_name refers to the key of a Pair.
+type QueryOrder struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	KeyName string          `protobuf:"bytes,1,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"`
+	Sort    QueryOrder_Sort `protobuf:"varint,2,opt,name=sort,proto3,enum=banyandb.model.v1.QueryOrder_Sort" json:"sort,omitempty"`
+}
+
+func (x *QueryOrder) Reset() {
+	*x = QueryOrder{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_query_proto_msgTypes[2]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *QueryOrder) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*QueryOrder) ProtoMessage() {}
+
+func (x *QueryOrder) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_query_proto_msgTypes[2]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use QueryOrder.ProtoReflect.Descriptor instead.
+func (*QueryOrder) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_query_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *QueryOrder) GetKeyName() string {
+	if x != nil {
+		return x.KeyName
+	}
+	return ""
+}
+
+func (x *QueryOrder) GetSort() QueryOrder_Sort {
+	if x != nil {
+		return x.Sort
+	}
+	return QueryOrder_SORT_UNSPECIFIED
+}
+
+// Projection is used to select the names of keys to be returned.
+type Projection struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// The key_name refers to the key(s) of Pair(s).
+	KeyNames []string `protobuf:"bytes,1,rep,name=key_names,json=keyNames,proto3" json:"key_names,omitempty"`
+}
+
+func (x *Projection) Reset() {
+	*x = Projection{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_query_proto_msgTypes[3]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Projection) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Projection) ProtoMessage() {}
+
+func (x *Projection) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_query_proto_msgTypes[3]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Projection.ProtoReflect.Descriptor instead.
+func (*Projection) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_query_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *Projection) GetKeyNames() []string {
+	if x != nil {
+		return x.KeyNames
+	}
+	return nil
+}
+
+// TimeRange is a range query for uint64,
+// the range here follows left-inclusive and right-exclusive rule, i.e. [begin, end) if both edges exist
+type TimeRange struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Begin *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=begin,proto3" json:"begin,omitempty"`
+	End   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
+}
+
+func (x *TimeRange) Reset() {
+	*x = TimeRange{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_query_proto_msgTypes[4]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *TimeRange) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TimeRange) ProtoMessage() {}
+
+func (x *TimeRange) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_query_proto_msgTypes[4]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use TimeRange.ProtoReflect.Descriptor instead.
+func (*TimeRange) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_query_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *TimeRange) GetBegin() *timestamppb.Timestamp {
+	if x != nil {
+		return x.Begin
+	}
+	return nil
+}
+
+func (x *TimeRange) GetEnd() *timestamppb.Timestamp {
+	if x != nil {
+		return x.End
+	}
+	return nil
+}
+
+type TypedPair_NullWithType struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Type v1.FieldType `protobuf:"varint,1,opt,name=type,proto3,enum=banyandb.database.v1.FieldType" json:"type,omitempty"`
+}
+
+func (x *TypedPair_NullWithType) Reset() {
+	*x = TypedPair_NullWithType{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_query_proto_msgTypes[5]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *TypedPair_NullWithType) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TypedPair_NullWithType) ProtoMessage() {}
+
+func (x *TypedPair_NullWithType) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_query_proto_msgTypes[5]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use TypedPair_NullWithType.ProtoReflect.Descriptor instead.
+func (*TypedPair_NullWithType) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_query_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *TypedPair_NullWithType) GetType() v1.FieldType {
+	if x != nil {
+		return x.Type
+	}
+	return v1.FieldType(0)
+}
+
+var File_banyandb_model_v1_query_proto protoreflect.FileDescriptor
+
+var file_banyandb_model_v1_query_proto_rawDesc = []byte{
+	0x0a, 0x1d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+	0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
+	0x11, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e,
+	0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d, 0x6f,
+	0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x64, 0x61,
+	0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61,
+	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x03, 0x0a, 0x09, 0x54, 0x79, 0x70, 0x65, 0x64,
+	0x50, 0x61, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x48, 0x0a, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x70,
+	0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x61, 0x6e, 0x79,
+	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79,
+	0x70, 0x65, 0x64, 0x50, 0x61, 0x69, 0x72, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x57, 0x69, 0x74, 0x68,
+	0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x69, 0x72,
+	0x12, 0x33, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f,
+	0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x69, 0x6e,
+	0x74, 0x50, 0x61, 0x69, 0x72, 0x12, 0x33, 0x0a, 0x08, 0x73, 0x74, 0x72, 0x5f, 0x70, 0x61, 0x69,
+	0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
+	0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x48,
+	0x00, 0x52, 0x07, 0x73, 0x74, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x43, 0x0a, 0x0e, 0x69, 0x6e,
+	0x74, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f,
+	0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48,
+	0x00, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x50, 0x61, 0x69, 0x72, 0x12,
+	0x43, 0x0a, 0x0e, 0x73, 0x74, 0x72, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x70, 0x61, 0x69,
+	0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
+	0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x41,
+	0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x41, 0x72, 0x72, 0x61, 0x79,
+	0x50, 0x61, 0x69, 0x72, 0x1a, 0x43, 0x0a, 0x0c, 0x4e, 0x75, 0x6c, 0x6c, 0x57, 0x69, 0x74, 0x68,
+	0x54, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x64, 0x61,
+	0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54,
+	0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x74, 0x79, 0x70,
+	0x65, 0x64, 0x22, 0xc2, 0x02, 0x0a, 0x09, 0x50, 0x61, 0x69, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79,
+	0x12, 0x35, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62,
+	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31,
+	0x2e, 0x50, 0x61, 0x69, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72,
+	0x79, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x3a, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69,
+	0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e,
+	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54,
+	0x79, 0x70, 0x65, 0x64, 0x50, 0x61, 0x69, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74,
+	0x69, 0x6f, 0x6e, 0x22, 0xc1, 0x01, 0x0a, 0x08, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x4f, 0x70,
+	0x12, 0x19, 0x0a, 0x15, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x55, 0x4e,
+	0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x42,
+	0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x45, 0x51, 0x10, 0x01, 0x12, 0x10, 0x0a,
+	0x0c, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x4e, 0x45, 0x10, 0x02, 0x12,
+	0x10, 0x0a, 0x0c, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x4c, 0x54, 0x10,
+	0x03, 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x47,
+	0x54, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50,
+	0x5f, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f,
+	0x4f, 0x50, 0x5f, 0x47, 0x45, 0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x42, 0x49, 0x4e, 0x41, 0x52,
+	0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x48, 0x41, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x12, 0x18, 0x0a,
+	0x14, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x48,
+	0x41, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x08, 0x22, 0x9a, 0x01, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72,
+	0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61,
+	0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d,
+	0x65, 0x12, 0x36, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
+	0x22, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+	0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x53,
+	0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x39, 0x0a, 0x04, 0x53, 0x6f, 0x72,
+	0x74, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
+	0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x4f, 0x52, 0x54, 0x5f,
+	0x44, 0x45, 0x53, 0x43, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x41,
+	0x53, 0x43, 0x10, 0x02, 0x22, 0x29, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69,
+	0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18,
+	0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22,
+	0x6b, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x05,
+	0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
+	0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x12, 0x2c,
+	0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
+	0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x0a, 0x27,
+	0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61,
+	0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d,
+	0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
+	0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61,
+	0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61,
+	0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x33,
+}
+
+var (
+	file_banyandb_model_v1_query_proto_rawDescOnce sync.Once
+	file_banyandb_model_v1_query_proto_rawDescData = file_banyandb_model_v1_query_proto_rawDesc
+)
+
+func file_banyandb_model_v1_query_proto_rawDescGZIP() []byte {
+	file_banyandb_model_v1_query_proto_rawDescOnce.Do(func() {
+		file_banyandb_model_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_model_v1_query_proto_rawDescData)
+	})
+	return file_banyandb_model_v1_query_proto_rawDescData
+}
+
+var file_banyandb_model_v1_query_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_banyandb_model_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_banyandb_model_v1_query_proto_goTypes = []interface{}{
+	(PairQuery_BinaryOp)(0),        // 0: banyandb.model.v1.PairQuery.BinaryOp
+	(QueryOrder_Sort)(0),           // 1: banyandb.model.v1.QueryOrder.Sort
+	(*TypedPair)(nil),              // 2: banyandb.model.v1.TypedPair
+	(*PairQuery)(nil),              // 3: banyandb.model.v1.PairQuery
+	(*QueryOrder)(nil),             // 4: banyandb.model.v1.QueryOrder
+	(*Projection)(nil),             // 5: banyandb.model.v1.Projection
+	(*TimeRange)(nil),              // 6: banyandb.model.v1.TimeRange
+	(*TypedPair_NullWithType)(nil), // 7: banyandb.model.v1.TypedPair.NullWithType
+	(*Int)(nil),                    // 8: banyandb.model.v1.Int
+	(*Str)(nil),                    // 9: banyandb.model.v1.Str
+	(*IntArray)(nil),               // 10: banyandb.model.v1.IntArray
+	(*StrArray)(nil),               // 11: banyandb.model.v1.StrArray
+	(*timestamppb.Timestamp)(nil),  // 12: google.protobuf.Timestamp
+	(v1.FieldType)(0),              // 13: banyandb.database.v1.FieldType
+}
+var file_banyandb_model_v1_query_proto_depIdxs = []int32{
+	7,  // 0: banyandb.model.v1.TypedPair.null_pair:type_name -> banyandb.model.v1.TypedPair.NullWithType
+	8,  // 1: banyandb.model.v1.TypedPair.int_pair:type_name -> banyandb.model.v1.Int
+	9,  // 2: banyandb.model.v1.TypedPair.str_pair:type_name -> banyandb.model.v1.Str
+	10, // 3: banyandb.model.v1.TypedPair.int_array_pair:type_name -> banyandb.model.v1.IntArray
+	11, // 4: banyandb.model.v1.TypedPair.str_array_pair:type_name -> banyandb.model.v1.StrArray
+	0,  // 5: banyandb.model.v1.PairQuery.op:type_name -> banyandb.model.v1.PairQuery.BinaryOp
+	2,  // 6: banyandb.model.v1.PairQuery.condition:type_name -> banyandb.model.v1.TypedPair
+	1,  // 7: banyandb.model.v1.QueryOrder.sort:type_name -> banyandb.model.v1.QueryOrder.Sort
+	12, // 8: banyandb.model.v1.TimeRange.begin:type_name -> google.protobuf.Timestamp
+	12, // 9: banyandb.model.v1.TimeRange.end:type_name -> google.protobuf.Timestamp
+	13, // 10: banyandb.model.v1.TypedPair.NullWithType.type:type_name -> banyandb.database.v1.FieldType
+	11, // [11:11] is the sub-list for method output_type
+	11, // [11:11] is the sub-list for method input_type
+	11, // [11:11] is the sub-list for extension type_name
+	11, // [11:11] is the sub-list for extension extendee
+	0,  // [0:11] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_model_v1_query_proto_init() }
+func file_banyandb_model_v1_query_proto_init() {
+	if File_banyandb_model_v1_query_proto != nil {
+		return
+	}
+	file_banyandb_model_v1_common_proto_init()
+	if !protoimpl.UnsafeEnabled {
+		file_banyandb_model_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*TypedPair); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_model_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*PairQuery); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_model_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*QueryOrder); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_model_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Projection); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_model_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*TimeRange); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_model_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*TypedPair_NullWithType); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	file_banyandb_model_v1_query_proto_msgTypes[0].OneofWrappers = []interface{}{
+		(*TypedPair_NullPair)(nil),
+		(*TypedPair_IntPair)(nil),
+		(*TypedPair_StrPair)(nil),
+		(*TypedPair_IntArrayPair)(nil),
+		(*TypedPair_StrArrayPair)(nil),
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_model_v1_query_proto_rawDesc,
+			NumEnums:      2,
+			NumMessages:   6,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_banyandb_model_v1_query_proto_goTypes,
+		DependencyIndexes: file_banyandb_model_v1_query_proto_depIdxs,
+		EnumInfos:         file_banyandb_model_v1_query_proto_enumTypes,
+		MessageInfos:      file_banyandb_model_v1_query_proto_msgTypes,
+	}.Build()
+	File_banyandb_model_v1_query_proto = out.File
+	file_banyandb_model_v1_query_proto_rawDesc = nil
+	file_banyandb_model_v1_query_proto_goTypes = nil
+	file_banyandb_model_v1_query_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/model/v1/query.proto b/api/proto/banyandb/model/v1/query.proto
new file mode 100644
index 0000000..3a4eab4
--- /dev/null
+++ b/api/proto/banyandb/model/v1/query.proto
@@ -0,0 +1,95 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+syntax = "proto3";
+
+option java_package = "org.apache.skywalking.banyandb.model.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1";
+
+package banyandb.model.v1;
+
+import "google/protobuf/timestamp.proto";
+import "banyandb/model/v1/common.proto";
+import "banyandb/database/v1/schema.proto";
+
+// Pair is the building block of a record which is equivalent to a key-value pair.
+// In the context of Trace, it could be metadata of a trace such as service_name, service_instance, etc.
+// Besides, other fields/tags are organized in key-value pair in the underlying storage layer.
+// One should notice that the values can be a multi-value.
+message TypedPair {
+    string key = 1;
+    oneof typed {
+        NullWithType null_pair = 2;
+        Int int_pair = 3;
+        Str str_pair = 4;
+        IntArray int_array_pair = 5;
+        StrArray str_array_pair = 6;
+    }
+
+    message NullWithType {
+        database.v1.FieldType type = 1;
+    }
+}
+
+// PairQuery consists of the query condition with a single binary operator to be imposed
+// For 1:1 BinaryOp, values in condition must be an array with length = 1,
+// while for 1:N BinaryOp, values can be an array with length >= 1.
+message PairQuery {
+    // BinaryOp specifies the operation imposed to the given query condition
+    // For EQ, NE, LT, GT, LE and GE, only one operand should be given, i.e. one-to-one relationship.
+    // HAVING and NOT_HAVING allow multi-value to be the operand such as array/vector, i.e. one-to-many relationship.
+    // For example, "keyA" contains "valueA" **and** "valueB"
+    enum BinaryOp {
+        BINARY_OP_UNSPECIFIED = 0;
+        BINARY_OP_EQ = 1;
+        BINARY_OP_NE = 2;
+        BINARY_OP_LT = 3;
+        BINARY_OP_GT = 4;
+        BINARY_OP_LE = 5;
+        BINARY_OP_GE = 6;
+        BINARY_OP_HAVING = 7;
+        BINARY_OP_NOT_HAVING = 8;
+    }
+    BinaryOp op = 1;
+    TypedPair condition = 2;
+}
+
+// QueryOrder means a Sort operation to be done for a given field.
+// The key_name refers to the key of a Pair.
+message QueryOrder {
+    string key_name = 1;
+    enum Sort {
+        SORT_UNSPECIFIED = 0;
+        SORT_DESC = 1;
+        SORT_ASC = 2;
+    }
+    Sort sort = 2;
+}
+
+
+// Projection is used to select the names of keys to be returned.
+message Projection {
+    // The key_name refers to the key(s) of Pair(s).
+    repeated string key_names = 1;
+}
+
+// TimeRange is a range query for uint64,
+// the range here follows left-inclusive and right-exclusive rule, i.e. [begin, end) if both edges exist
+message TimeRange {
+    google.protobuf.Timestamp begin = 1;
+    google.protobuf.Timestamp end = 2;
+}
diff --git a/api/proto/banyandb/model/v1/write.pb.go b/api/proto/banyandb/model/v1/write.pb.go
new file mode 100644
index 0000000..acabf77
--- /dev/null
+++ b/api/proto/banyandb/model/v1/write.pb.go
@@ -0,0 +1,280 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/model/v1/write.proto
+
+package v1
+
+import (
+	reflect "reflect"
+	sync "sync"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	structpb "google.golang.org/protobuf/types/known/structpb"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Field struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// Types that are assignable to ValueType:
+	//	*Field_Null
+	//	*Field_Str
+	//	*Field_StrArray
+	//	*Field_Int
+	//	*Field_IntArray
+	ValueType isField_ValueType `protobuf_oneof:"value_type"`
+}
+
+func (x *Field) Reset() {
+	*x = Field{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_model_v1_write_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Field) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Field) ProtoMessage() {}
+
+func (x *Field) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_model_v1_write_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Field.ProtoReflect.Descriptor instead.
+func (*Field) Descriptor() ([]byte, []int) {
+	return file_banyandb_model_v1_write_proto_rawDescGZIP(), []int{0}
+}
+
+func (m *Field) GetValueType() isField_ValueType {
+	if m != nil {
+		return m.ValueType
+	}
+	return nil
+}
+
+func (x *Field) GetNull() structpb.NullValue {
+	if x, ok := x.GetValueType().(*Field_Null); ok {
+		return x.Null
+	}
+	return structpb.NullValue(0)
+}
+
+func (x *Field) GetStr() *Str {
+	if x, ok := x.GetValueType().(*Field_Str); ok {
+		return x.Str
+	}
+	return nil
+}
+
+func (x *Field) GetStrArray() *StrArray {
+	if x, ok := x.GetValueType().(*Field_StrArray); ok {
+		return x.StrArray
+	}
+	return nil
+}
+
+func (x *Field) GetInt() *Int {
+	if x, ok := x.GetValueType().(*Field_Int); ok {
+		return x.Int
+	}
+	return nil
+}
+
+func (x *Field) GetIntArray() *IntArray {
+	if x, ok := x.GetValueType().(*Field_IntArray); ok {
+		return x.IntArray
+	}
+	return nil
+}
+
+type isField_ValueType interface {
+	isField_ValueType()
+}
+
+type Field_Null struct {
+	Null structpb.NullValue `protobuf:"varint,1,opt,name=null,proto3,enum=google.protobuf.NullValue,oneof"`
+}
+
+type Field_Str struct {
+	Str *Str `protobuf:"bytes,2,opt,name=str,proto3,oneof"`
+}
+
+type Field_StrArray struct {
+	StrArray *StrArray `protobuf:"bytes,3,opt,name=str_array,json=strArray,proto3,oneof"`
+}
+
+type Field_Int struct {
+	Int *Int `protobuf:"bytes,4,opt,name=int,proto3,oneof"`
+}
+
+type Field_IntArray struct {
+	IntArray *IntArray `protobuf:"bytes,5,opt,name=int_array,json=intArray,proto3,oneof"`
+}
+
+func (*Field_Null) isField_ValueType() {}
+
+func (*Field_Str) isField_ValueType() {}
+
+func (*Field_StrArray) isField_ValueType() {}
+
+func (*Field_Int) isField_ValueType() {}
+
+func (*Field_IntArray) isField_ValueType() {}
+
+var File_banyandb_model_v1_write_proto protoreflect.FileDescriptor
+
+var file_banyandb_model_v1_write_proto_rawDesc = []byte{
+	0x0a, 0x1d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+	0x2f, 0x76, 0x31, 0x2f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
+	0x11, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e,
+	0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x1a, 0x1e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+	0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x22, 0x97, 0x02, 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x75,
+	0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56,
+	0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x75, 0x6c, 0x6c, 0x12, 0x2a, 0x0a, 0x03,
+	0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61, 0x6e, 0x79,
+	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74,
+	0x72, 0x48, 0x00, 0x52, 0x03, 0x73, 0x74, 0x72, 0x12, 0x3a, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x5f,
+	0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62, 0x61,
+	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e,
+	0x53, 0x74, 0x72, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x08, 0x73, 0x74, 0x72, 0x41,
+	0x72, 0x72, 0x61, 0x79, 0x12, 0x2a, 0x0a, 0x03, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64,
+	0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x69, 0x6e, 0x74,
+	0x12, 0x3a, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x05, 0x20,
+	0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d,
+	0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79,
+	0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x42, 0x0c, 0x0a, 0x0a,
+	0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x6c, 0x0a, 0x27, 0x6f, 0x72,
+	0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b,
+	0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64,
+	0x65, 0x6c, 0x2e, 0x76, 0x31, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
+	0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b,
+	0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69,
+	0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f,
+	0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_banyandb_model_v1_write_proto_rawDescOnce sync.Once
+	file_banyandb_model_v1_write_proto_rawDescData = file_banyandb_model_v1_write_proto_rawDesc
+)
+
+func file_banyandb_model_v1_write_proto_rawDescGZIP() []byte {
+	file_banyandb_model_v1_write_proto_rawDescOnce.Do(func() {
+		file_banyandb_model_v1_write_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_model_v1_write_proto_rawDescData)
+	})
+	return file_banyandb_model_v1_write_proto_rawDescData
+}
+
+var file_banyandb_model_v1_write_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_banyandb_model_v1_write_proto_goTypes = []interface{}{
+	(*Field)(nil),           // 0: banyandb.model.v1.Field
+	(structpb.NullValue)(0), // 1: google.protobuf.NullValue
+	(*Str)(nil),             // 2: banyandb.model.v1.Str
+	(*StrArray)(nil),        // 3: banyandb.model.v1.StrArray
+	(*Int)(nil),             // 4: banyandb.model.v1.Int
+	(*IntArray)(nil),        // 5: banyandb.model.v1.IntArray
+}
+var file_banyandb_model_v1_write_proto_depIdxs = []int32{
+	1, // 0: banyandb.model.v1.Field.null:type_name -> google.protobuf.NullValue
+	2, // 1: banyandb.model.v1.Field.str:type_name -> banyandb.model.v1.Str
+	3, // 2: banyandb.model.v1.Field.str_array:type_name -> banyandb.model.v1.StrArray
+	4, // 3: banyandb.model.v1.Field.int:type_name -> banyandb.model.v1.Int
+	5, // 4: banyandb.model.v1.Field.int_array:type_name -> banyandb.model.v1.IntArray
+	5, // [5:5] is the sub-list for method output_type
+	5, // [5:5] is the sub-list for method input_type
+	5, // [5:5] is the sub-list for extension type_name
+	5, // [5:5] is the sub-list for extension extendee
+	0, // [0:5] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_model_v1_write_proto_init() }
+func file_banyandb_model_v1_write_proto_init() {
+	if File_banyandb_model_v1_write_proto != nil {
+		return
+	}
+	file_banyandb_model_v1_common_proto_init()
+	if !protoimpl.UnsafeEnabled {
+		file_banyandb_model_v1_write_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Field); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	file_banyandb_model_v1_write_proto_msgTypes[0].OneofWrappers = []interface{}{
+		(*Field_Null)(nil),
+		(*Field_Str)(nil),
+		(*Field_StrArray)(nil),
+		(*Field_Int)(nil),
+		(*Field_IntArray)(nil),
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_model_v1_write_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   1,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_banyandb_model_v1_write_proto_goTypes,
+		DependencyIndexes: file_banyandb_model_v1_write_proto_depIdxs,
+		MessageInfos:      file_banyandb_model_v1_write_proto_msgTypes,
+	}.Build()
+	File_banyandb_model_v1_write_proto = out.File
+	file_banyandb_model_v1_write_proto_rawDesc = nil
+	file_banyandb_model_v1_write_proto_goTypes = nil
+	file_banyandb_model_v1_write_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/v1/rpc.proto b/api/proto/banyandb/model/v1/write.proto
similarity index 69%
copy from api/proto/banyandb/v1/rpc.proto
copy to api/proto/banyandb/model/v1/write.proto
index 85fafd8..0888346 100644
--- a/api/proto/banyandb/v1/rpc.proto
+++ b/api/proto/banyandb/model/v1/write.proto
@@ -17,15 +17,20 @@
 
 syntax = "proto3";
 
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
+option java_package = "org.apache.skywalking.banyandb.model.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1";
 
-package banyandb.v1;
+package banyandb.model.v1;
 
-import "banyandb/v1/query.proto";
-import "banyandb/v1/write.proto";
+import "google/protobuf/struct.proto";
+import "banyandb/model/v1/common.proto";
 
-service TraceService {
-  rpc Query(banyandb.v1.QueryRequest) returns (banyandb.v1.QueryResponse);
-  rpc Write(stream banyandb.v1.WriteRequest) returns (stream banyandb.v1.WriteResponse);
-}
\ No newline at end of file
+message Field {
+    oneof value_type {
+        google.protobuf.NullValue null = 1;
+        Str str = 2;
+        StrArray str_array = 3;
+        Int int = 4;
+        IntArray int_array = 5;
+    }
+}
diff --git a/api/proto/banyandb/trace/v1/query.pb.go b/api/proto/banyandb/trace/v1/query.pb.go
new file mode 100644
index 0000000..2a637e8
--- /dev/null
+++ b/api/proto/banyandb/trace/v1/query.pb.go
@@ -0,0 +1,449 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/trace/v1/query.proto
+
+package v1
+
+import (
+	reflect "reflect"
+	sync "sync"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+
+	v11 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Entity represents
+// (Trace context) a Span defined in Google Dapper paper or equivalently a Segment in Skywalking.
+// (Log context) a log
+type Entity struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// entity_id could be span_id of a Span or segment_id of a Segment in the context of Trace
+	EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
+	// timestamp represents
+	// 1) either the start time of a Span/Segment,
+	// 2) or the timestamp of a log
+	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
+	// data_binary contains all un-indexed Tags and other key-value pairs
+	DataBinary []byte `protobuf:"bytes,3,opt,name=data_binary,json=dataBinary,proto3" json:"data_binary,omitempty"`
+	// fields contains all indexed Field. Some typical names,
+	// - trace_id
+	// - duration
+	// - service_name
+	// - service_instance_id
+	// - end_time_nanoseconds
+	Fields []*v1.TypedPair `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
+}
+
+func (x *Entity) Reset() {
+	*x = Entity{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_trace_v1_query_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Entity) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Entity) ProtoMessage() {}
+
+func (x *Entity) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_trace_v1_query_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Entity.ProtoReflect.Descriptor instead.
+func (*Entity) Descriptor() ([]byte, []int) {
+	return file_banyandb_trace_v1_query_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Entity) GetEntityId() string {
+	if x != nil {
+		return x.EntityId
+	}
+	return ""
+}
+
+func (x *Entity) GetTimestamp() *timestamppb.Timestamp {
+	if x != nil {
+		return x.Timestamp
+	}
+	return nil
+}
+
+func (x *Entity) GetDataBinary() []byte {
+	if x != nil {
+		return x.DataBinary
+	}
+	return nil
+}
+
+func (x *Entity) GetFields() []*v1.TypedPair {
+	if x != nil {
+		return x.Fields
+	}
+	return nil
+}
+
+// QueryResponse is the response for a query to the Query module.
+type QueryResponse struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// entities are the actual data returned
+	Entities []*Entity `protobuf:"bytes,1,rep,name=entities,proto3" json:"entities,omitempty"`
+}
+
+func (x *QueryResponse) Reset() {
+	*x = QueryResponse{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_trace_v1_query_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *QueryResponse) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*QueryResponse) ProtoMessage() {}
+
+func (x *QueryResponse) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_trace_v1_query_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
+func (*QueryResponse) Descriptor() ([]byte, []int) {
+	return file_banyandb_trace_v1_query_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *QueryResponse) GetEntities() []*Entity {
+	if x != nil {
+		return x.Entities
+	}
+	return nil
+}
+
+// QueryRequest is the request contract for query.
+type QueryRequest struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// metadata is required
+	Metadata *v11.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
+	// time_range is a range query with begin/end time of entities in the timeunit of nanoseconds.
+	// In the context of Trace, it represents the range of the `startTime` for spans/segments,
+	// while in the context of Log, it means the range of the timestamp(s) for logs.
+	// it is always recommended to specify time range for performance reason
+	TimeRange *v1.TimeRange `protobuf:"bytes,2,opt,name=time_range,json=timeRange,proto3" json:"time_range,omitempty"`
+	// offset is used to support pagination, together with the following limit
+	Offset uint32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
+	// limit is used to impose a boundary on the number of records being returned
+	Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
+	// order_by is given to specify the sort for a field. So far, only fields in the type of Integer are supported
+	OrderBy *v1.QueryOrder `protobuf:"bytes,5,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
+	// fields are indexed. Some typical fields are listed below,
+	// - trace_id: if given, it takes precedence over other fields and will be used to retrieve entities before other conditions are imposed
+	// - duration: typical for trace context
+	Fields []*v1.PairQuery `protobuf:"bytes,6,rep,name=fields,proto3" json:"fields,omitempty"`
+	// projection can be used to select the key names of the entities in the response
+	Projection *v1.Projection `protobuf:"bytes,7,opt,name=projection,proto3" json:"projection,omitempty"`
+}
+
+func (x *QueryRequest) Reset() {
+	*x = QueryRequest{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_trace_v1_query_proto_msgTypes[2]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *QueryRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*QueryRequest) ProtoMessage() {}
+
+func (x *QueryRequest) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_trace_v1_query_proto_msgTypes[2]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
+func (*QueryRequest) Descriptor() ([]byte, []int) {
+	return file_banyandb_trace_v1_query_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *QueryRequest) GetMetadata() *v11.Metadata {
+	if x != nil {
+		return x.Metadata
+	}
+	return nil
+}
+
+func (x *QueryRequest) GetTimeRange() *v1.TimeRange {
+	if x != nil {
+		return x.TimeRange
+	}
+	return nil
+}
+
+func (x *QueryRequest) GetOffset() uint32 {
+	if x != nil {
+		return x.Offset
+	}
+	return 0
+}
+
+func (x *QueryRequest) GetLimit() uint32 {
+	if x != nil {
+		return x.Limit
+	}
+	return 0
+}
+
+func (x *QueryRequest) GetOrderBy() *v1.QueryOrder {
+	if x != nil {
+		return x.OrderBy
+	}
+	return nil
+}
+
+func (x *QueryRequest) GetFields() []*v1.PairQuery {
+	if x != nil {
+		return x.Fields
+	}
+	return nil
+}
+
+func (x *QueryRequest) GetProjection() *v1.Projection {
+	if x != nil {
+		return x.Projection
+	}
+	return nil
+}
+
+var File_banyandb_trace_v1_query_proto protoreflect.FileDescriptor
+
+var file_banyandb_trace_v1_query_proto_rawDesc = []byte{
+	0x0a, 0x1d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65,
+	0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
+	0x11, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e,
+	0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x63, 0x6f,
+	0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d,
+	0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x22, 0xb6, 0x01, 0x0a, 0x06, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b,
+	0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x74,
+	0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
+	0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+	0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65,
+	0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x62, 0x69,
+	0x6e, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61,
+	0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73,
+	0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64,
+	0x50, 0x61, 0x69, 0x72, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x46, 0x0a, 0x0d,
+	0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a,
+	0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
+	0x19, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65,
+	0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69,
+	0x74, 0x69, 0x65, 0x73, 0x22, 0xe2, 0x02, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65,
+	0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+	0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
+	0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74,
+	0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12,
+	0x3b, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d,
+	0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x61, 0x6e, 0x67,
+	0x65, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06,
+	0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66,
+	0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20,
+	0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x6f, 0x72,
+	0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62,
+	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31,
+	0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x07, 0x6f, 0x72, 0x64,
+	0x65, 0x72, 0x42, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x06,
+	0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
+	0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x51, 0x75, 0x65,
+	0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x72,
+	0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d,
+	0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e,
+	0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70,
+	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x0a, 0x27, 0x6f, 0x72, 0x67,
+	0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69,
+	0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63,
+	0x65, 0x2e, 0x76, 0x31, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
+	0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69,
+	0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x74,
+	0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_banyandb_trace_v1_query_proto_rawDescOnce sync.Once
+	file_banyandb_trace_v1_query_proto_rawDescData = file_banyandb_trace_v1_query_proto_rawDesc
+)
+
+func file_banyandb_trace_v1_query_proto_rawDescGZIP() []byte {
+	file_banyandb_trace_v1_query_proto_rawDescOnce.Do(func() {
+		file_banyandb_trace_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_trace_v1_query_proto_rawDescData)
+	})
+	return file_banyandb_trace_v1_query_proto_rawDescData
+}
+
+var file_banyandb_trace_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_banyandb_trace_v1_query_proto_goTypes = []interface{}{
+	(*Entity)(nil),                // 0: banyandb.trace.v1.Entity
+	(*QueryResponse)(nil),         // 1: banyandb.trace.v1.QueryResponse
+	(*QueryRequest)(nil),          // 2: banyandb.trace.v1.QueryRequest
+	(*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp
+	(*v1.TypedPair)(nil),          // 4: banyandb.model.v1.TypedPair
+	(*v11.Metadata)(nil),          // 5: banyandb.common.v1.Metadata
+	(*v1.TimeRange)(nil),          // 6: banyandb.model.v1.TimeRange
+	(*v1.QueryOrder)(nil),         // 7: banyandb.model.v1.QueryOrder
+	(*v1.PairQuery)(nil),          // 8: banyandb.model.v1.PairQuery
+	(*v1.Projection)(nil),         // 9: banyandb.model.v1.Projection
+}
+var file_banyandb_trace_v1_query_proto_depIdxs = []int32{
+	3, // 0: banyandb.trace.v1.Entity.timestamp:type_name -> google.protobuf.Timestamp
+	4, // 1: banyandb.trace.v1.Entity.fields:type_name -> banyandb.model.v1.TypedPair
+	0, // 2: banyandb.trace.v1.QueryResponse.entities:type_name -> banyandb.trace.v1.Entity
+	5, // 3: banyandb.trace.v1.QueryRequest.metadata:type_name -> banyandb.common.v1.Metadata
+	6, // 4: banyandb.trace.v1.QueryRequest.time_range:type_name -> banyandb.model.v1.TimeRange
+	7, // 5: banyandb.trace.v1.QueryRequest.order_by:type_name -> banyandb.model.v1.QueryOrder
+	8, // 6: banyandb.trace.v1.QueryRequest.fields:type_name -> banyandb.model.v1.PairQuery
+	9, // 7: banyandb.trace.v1.QueryRequest.projection:type_name -> banyandb.model.v1.Projection
+	8, // [8:8] is the sub-list for method output_type
+	8, // [8:8] is the sub-list for method input_type
+	8, // [8:8] is the sub-list for extension type_name
+	8, // [8:8] is the sub-list for extension extendee
+	0, // [0:8] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_trace_v1_query_proto_init() }
+func file_banyandb_trace_v1_query_proto_init() {
+	if File_banyandb_trace_v1_query_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_banyandb_trace_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Entity); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_trace_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*QueryResponse); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_trace_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*QueryRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_trace_v1_query_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   3,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_banyandb_trace_v1_query_proto_goTypes,
+		DependencyIndexes: file_banyandb_trace_v1_query_proto_depIdxs,
+		MessageInfos:      file_banyandb_trace_v1_query_proto_msgTypes,
+	}.Build()
+	File_banyandb_trace_v1_query_proto = out.File
+	file_banyandb_trace_v1_query_proto_rawDesc = nil
+	file_banyandb_trace_v1_query_proto_goTypes = nil
+	file_banyandb_trace_v1_query_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/v1/query.proto b/api/proto/banyandb/trace/v1/query.proto
similarity index 53%
rename from api/proto/banyandb/v1/query.proto
rename to api/proto/banyandb/trace/v1/query.proto
index 6a64fb6..2587b8c 100644
--- a/api/proto/banyandb/v1/query.proto
+++ b/api/proto/banyandb/trace/v1/query.proto
@@ -17,71 +17,14 @@
 
 syntax = "proto3";
 
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
+option java_package = "org.apache.skywalking.banyandb.trace.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1";
 
-package banyandb.v1;
+package banyandb.trace.v1;
 
 import "google/protobuf/timestamp.proto";
-import "banyandb/v1/database.proto";
-
-// IntPair in a typed pair with an array of int64 as values
-message IntPair {
-  string key = 1;
-  repeated int64 values = 2;
-}
-
-// StrPair in a typed pair with an array of string as values
-message StrPair {
-  string key = 1;
-  repeated string values = 2;
-}
-
-// Pair is the building block of a record which is equivalent to a key-value pair.
-// In the context of Trace, it could be metadata of a trace such as service_name, service_instance, etc.
-// Besides, other fields/tags are organized in key-value pair in the underlying storage layer.
-// One should notice that the values can be a multi-value.
-message TypedPair {
-  oneof typed {
-    IntPair int_pair = 1;
-    StrPair str_pair = 2;
-  }
-}
-
-// PairQuery consists of the query condition with a single binary operator to be imposed
-// For 1:1 BinaryOp, values in condition must be an array with length = 1,
-// while for 1:N BinaryOp, values can be an array with length >= 1.
-message PairQuery {
-  // BinaryOp specifies the operation imposed to the given query condition
-  // For EQ, NE, LT, GT, LE and GE, only one operand should be given, i.e. one-to-one relationship.
-  // HAVING and NOT_HAVING allow multi-value to be the operand such as array/vector, i.e. one-to-many relationship.
-  // For example, "keyA" contains "valueA" **and** "valueB"
-  enum BinaryOp {
-    BINARY_OP_UNSPECIFIED = 0;
-    BINARY_OP_EQ = 1;
-    BINARY_OP_NE = 2;
-    BINARY_OP_LT = 3;
-    BINARY_OP_GT = 4;
-    BINARY_OP_LE = 5;
-    BINARY_OP_GE = 6;
-    BINARY_OP_HAVING = 7;
-    BINARY_OP_NOT_HAVING = 8;
-  }
-  BinaryOp op = 1;
-  TypedPair condition = 2;
-}
-
-// QueryOrder means a Sort operation to be done for a given field.
-// The key_name refers to the key of a Pair.
-message QueryOrder {
-  string key_name = 1;
-  enum Sort {
-    SORT_UNSPECIFIED = 0;
-    SORT_DESC = 1;
-    SORT_ASC = 2;
-  }
-  Sort sort = 2;
-}
+import "banyandb/common/v1/common.proto";
+import "banyandb/model/v1/query.proto";
 
 // Entity represents
 // (Trace context) a Span defined in Google Dapper paper or equivalently a Segment in Skywalking.
@@ -101,7 +44,7 @@ message Entity {
   // - service_name
   // - service_instance_id
   // - end_time_nanoseconds
-  repeated TypedPair fields = 4;
+  repeated model.v1.TypedPair fields = 4;
 }
 
 // QueryResponse is the response for a query to the Query module.
@@ -110,38 +53,25 @@ message QueryResponse {
   repeated Entity entities = 1;
 }
 
-// Projection is used to select the names of keys to be returned.
-message Projection {
-  // The key_name refers to the key(s) of Pair(s).
-  repeated string key_names = 1;
-}
-
-// TimeRange is a range query for uint64,
-// the range here follows left-inclusive and right-exclusive rule, i.e. [begin, end) if both edges exist
-message TimeRange {
-  google.protobuf.Timestamp begin = 1;
-  google.protobuf.Timestamp end = 2;
-}
-
 // QueryRequest is the request contract for query.
 message QueryRequest {
   // metadata is required
-  Metadata metadata = 1;
+  common.v1.Metadata metadata = 1;
   // time_range is a range query with begin/end time of entities in the timeunit of nanoseconds.
   // In the context of Trace, it represents the range of the `startTime` for spans/segments,
   // while in the context of Log, it means the range of the timestamp(s) for logs.
   // it is always recommended to specify time range for performance reason
-  TimeRange time_range = 2;
+  model.v1.TimeRange time_range = 2;
   // offset is used to support pagination, together with the following limit
   uint32 offset = 3;
   // limit is used to impose a boundary on the number of records being returned
   uint32 limit = 4;
   // order_by is given to specify the sort for a field. So far, only fields in the type of Integer are supported
-  QueryOrder order_by = 5;
+  model.v1.QueryOrder order_by = 5;
   // fields are indexed. Some typical fields are listed below,
   // - trace_id: if given, it takes precedence over other fields and will be used to retrieve entities before other conditions are imposed
   // - duration: typical for trace context
-  repeated PairQuery fields = 6;
+  repeated model.v1.PairQuery fields = 6;
   // projection can be used to select the key names of the entities in the response
-  Projection projection = 7;
+  model.v1.Projection projection = 7;
 }
diff --git a/api/proto/banyandb/trace/v1/rpc.pb.go b/api/proto/banyandb/trace/v1/rpc.pb.go
new file mode 100644
index 0000000..c188019
--- /dev/null
+++ b/api/proto/banyandb/trace/v1/rpc.pb.go
@@ -0,0 +1,113 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/trace/v1/rpc.proto
+
+package v1
+
+import (
+	reflect "reflect"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+var File_banyandb_trace_v1_rpc_proto protoreflect.FileDescriptor
+
+var file_banyandb_trace_v1_rpc_proto_rawDesc = []byte{
+	0x0a, 0x1b, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65,
+	0x2f, 0x76, 0x31, 0x2f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x62,
+	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31,
+	0x1a, 0x1d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65,
+	0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
+	0x1d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f,
+	0x76, 0x31, 0x2f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xaa,
+	0x01, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
+	0x4a, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1f, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65,
+	0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x62, 0x61, 0x6e, 0x79,
+	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75,
+	0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x05, 0x57,
+	0x72, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
+	0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65,
+	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62,
+	0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52,
+	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x6c, 0x0a, 0x27, 0x6f,
+	0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c,
+	0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72,
+	0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
+	0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c,
+	0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70,
+	0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62,
+	0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x33,
+}
+
+var file_banyandb_trace_v1_rpc_proto_goTypes = []interface{}{
+	(*QueryRequest)(nil),  // 0: banyandb.trace.v1.QueryRequest
+	(*WriteRequest)(nil),  // 1: banyandb.trace.v1.WriteRequest
+	(*QueryResponse)(nil), // 2: banyandb.trace.v1.QueryResponse
+	(*WriteResponse)(nil), // 3: banyandb.trace.v1.WriteResponse
+}
+var file_banyandb_trace_v1_rpc_proto_depIdxs = []int32{
+	0, // 0: banyandb.trace.v1.TraceService.Query:input_type -> banyandb.trace.v1.QueryRequest
+	1, // 1: banyandb.trace.v1.TraceService.Write:input_type -> banyandb.trace.v1.WriteRequest
+	2, // 2: banyandb.trace.v1.TraceService.Query:output_type -> banyandb.trace.v1.QueryResponse
+	3, // 3: banyandb.trace.v1.TraceService.Write:output_type -> banyandb.trace.v1.WriteResponse
+	2, // [2:4] is the sub-list for method output_type
+	0, // [0:2] is the sub-list for method input_type
+	0, // [0:0] is the sub-list for extension type_name
+	0, // [0:0] is the sub-list for extension extendee
+	0, // [0:0] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_trace_v1_rpc_proto_init() }
+func file_banyandb_trace_v1_rpc_proto_init() {
+	if File_banyandb_trace_v1_rpc_proto != nil {
+		return
+	}
+	file_banyandb_trace_v1_query_proto_init()
+	file_banyandb_trace_v1_write_proto_init()
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_trace_v1_rpc_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   0,
+			NumExtensions: 0,
+			NumServices:   1,
+		},
+		GoTypes:           file_banyandb_trace_v1_rpc_proto_goTypes,
+		DependencyIndexes: file_banyandb_trace_v1_rpc_proto_depIdxs,
+	}.Build()
+	File_banyandb_trace_v1_rpc_proto = out.File
+	file_banyandb_trace_v1_rpc_proto_rawDesc = nil
+	file_banyandb_trace_v1_rpc_proto_goTypes = nil
+	file_banyandb_trace_v1_rpc_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/v1/rpc.proto b/api/proto/banyandb/trace/v1/rpc.proto
similarity index 70%
rename from api/proto/banyandb/v1/rpc.proto
rename to api/proto/banyandb/trace/v1/rpc.proto
index 85fafd8..14d9e85 100644
--- a/api/proto/banyandb/v1/rpc.proto
+++ b/api/proto/banyandb/trace/v1/rpc.proto
@@ -17,15 +17,15 @@
 
 syntax = "proto3";
 
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
+option java_package = "org.apache.skywalking.banyandb.trace.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1";
 
-package banyandb.v1;
+package banyandb.trace.v1;
 
-import "banyandb/v1/query.proto";
-import "banyandb/v1/write.proto";
+import "banyandb/trace/v1/query.proto";
+import "banyandb/trace/v1/write.proto";
 
 service TraceService {
-  rpc Query(banyandb.v1.QueryRequest) returns (banyandb.v1.QueryResponse);
-  rpc Write(stream banyandb.v1.WriteRequest) returns (stream banyandb.v1.WriteResponse);
+  rpc Query(banyandb.trace.v1.QueryRequest) returns (banyandb.trace.v1.QueryResponse);
+  rpc Write(stream banyandb.trace.v1.WriteRequest) returns (stream banyandb.trace.v1.WriteResponse);
 }
\ No newline at end of file
diff --git a/api/proto/banyandb/v1/rpc_grpc.pb.go b/api/proto/banyandb/trace/v1/rpc_grpc.pb.go
similarity index 94%
rename from api/proto/banyandb/v1/rpc_grpc.pb.go
rename to api/proto/banyandb/trace/v1/rpc_grpc.pb.go
index 9fb2551..5e3c16b 100644
--- a/api/proto/banyandb/v1/rpc_grpc.pb.go
+++ b/api/proto/banyandb/trace/v1/rpc_grpc.pb.go
@@ -33,7 +33,7 @@ func NewTraceServiceClient(cc grpc.ClientConnInterface) TraceServiceClient {
 
 func (c *traceServiceClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) {
 	out := new(QueryResponse)
-	err := c.cc.Invoke(ctx, "/banyandb.v1.TraceService/Query", in, out, opts...)
+	err := c.cc.Invoke(ctx, "/banyandb.trace.v1.TraceService/Query", in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -41,7 +41,7 @@ func (c *traceServiceClient) Query(ctx context.Context, in *QueryRequest, opts .
 }
 
 func (c *traceServiceClient) Write(ctx context.Context, opts ...grpc.CallOption) (TraceService_WriteClient, error) {
-	stream, err := c.cc.NewStream(ctx, &TraceService_ServiceDesc.Streams[0], "/banyandb.v1.TraceService/Write", opts...)
+	stream, err := c.cc.NewStream(ctx, &TraceService_ServiceDesc.Streams[0], "/banyandb.trace.v1.TraceService/Write", opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -113,7 +113,7 @@ func _TraceService_Query_Handler(srv interface{}, ctx context.Context, dec func(
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/banyandb.v1.TraceService/Query",
+		FullMethod: "/banyandb.trace.v1.TraceService/Query",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(TraceServiceServer).Query(ctx, req.(*QueryRequest))
@@ -151,7 +151,7 @@ func (x *traceServiceWriteServer) Recv() (*WriteRequest, error) {
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
 var TraceService_ServiceDesc = grpc.ServiceDesc{
-	ServiceName: "banyandb.v1.TraceService",
+	ServiceName: "banyandb.trace.v1.TraceService",
 	HandlerType: (*TraceServiceServer)(nil),
 	Methods: []grpc.MethodDesc{
 		{
@@ -167,5 +167,5 @@ var TraceService_ServiceDesc = grpc.ServiceDesc{
 			ClientStreams: true,
 		},
 	},
-	Metadata: "banyandb/v1/rpc.proto",
+	Metadata: "banyandb/trace/v1/rpc.proto",
 }
diff --git a/api/proto/banyandb/trace/v1/write.pb.go b/api/proto/banyandb/trace/v1/write.pb.go
new file mode 100644
index 0000000..cf92680
--- /dev/null
+++ b/api/proto/banyandb/trace/v1/write.pb.go
@@ -0,0 +1,357 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: banyandb/trace/v1/write.proto
+
+package v1
+
+import (
+	reflect "reflect"
+	sync "sync"
+
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+
+	v11 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type EntityValue struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// entity_id could be span_id of a Span or segment_id of a Segment in the context of Trace
+	EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
+	// timestamp_nanoseconds is in the timeunit of nanoseconds. It represents
+	// 1) either the start time of a Span/Segment,
+	// 2) or the timestamp of a log
+	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
+	// binary representation of segments, including tags, spans...
+	DataBinary []byte `protobuf:"bytes,3,opt,name=data_binary,json=dataBinary,proto3" json:"data_binary,omitempty"`
+	// support all of indexed fields in the fields.
+	// Field only has value, as the value of value_type match with the key
+	// by the index rules and index rule bindings of Metadata group.
+	// indexed fields of multiple entities are compression in the fields.
+	Fields []*v1.Field `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
+}
+
+func (x *EntityValue) Reset() {
+	*x = EntityValue{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_trace_v1_write_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *EntityValue) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EntityValue) ProtoMessage() {}
+
+func (x *EntityValue) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_trace_v1_write_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use EntityValue.ProtoReflect.Descriptor instead.
+func (*EntityValue) Descriptor() ([]byte, []int) {
+	return file_banyandb_trace_v1_write_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *EntityValue) GetEntityId() string {
+	if x != nil {
+		return x.EntityId
+	}
+	return ""
+}
+
+func (x *EntityValue) GetTimestamp() *timestamppb.Timestamp {
+	if x != nil {
+		return x.Timestamp
+	}
+	return nil
+}
+
+func (x *EntityValue) GetDataBinary() []byte {
+	if x != nil {
+		return x.DataBinary
+	}
+	return nil
+}
+
+func (x *EntityValue) GetFields() []*v1.Field {
+	if x != nil {
+		return x.Fields
+	}
+	return nil
+}
+
+type WriteRequest struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// the metadata is only required in the first write.
+	Metadata *v11.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
+	// the entity is required.
+	Entity *EntityValue `protobuf:"bytes,2,opt,name=entity,proto3" json:"entity,omitempty"`
+}
+
+func (x *WriteRequest) Reset() {
+	*x = WriteRequest{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_trace_v1_write_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *WriteRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*WriteRequest) ProtoMessage() {}
+
+func (x *WriteRequest) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_trace_v1_write_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead.
+func (*WriteRequest) Descriptor() ([]byte, []int) {
+	return file_banyandb_trace_v1_write_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *WriteRequest) GetMetadata() *v11.Metadata {
+	if x != nil {
+		return x.Metadata
+	}
+	return nil
+}
+
+func (x *WriteRequest) GetEntity() *EntityValue {
+	if x != nil {
+		return x.Entity
+	}
+	return nil
+}
+
+type WriteResponse struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+}
+
+func (x *WriteResponse) Reset() {
+	*x = WriteResponse{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_banyandb_trace_v1_write_proto_msgTypes[2]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *WriteResponse) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*WriteResponse) ProtoMessage() {}
+
+func (x *WriteResponse) ProtoReflect() protoreflect.Message {
+	mi := &file_banyandb_trace_v1_write_proto_msgTypes[2]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead.
+func (*WriteResponse) Descriptor() ([]byte, []int) {
+	return file_banyandb_trace_v1_write_proto_rawDescGZIP(), []int{2}
+}
+
+var File_banyandb_trace_v1_write_proto protoreflect.FileDescriptor
+
+var file_banyandb_trace_v1_write_proto_rawDesc = []byte{
+	0x0a, 0x1d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65,
+	0x2f, 0x76, 0x31, 0x2f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
+	0x11, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e,
+	0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x63, 0x6f,
+	0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d,
+	0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x01, 0x0a, 0x0b, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x61,
+	0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64,
+	0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52,
+	0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x61,
+	0x74, 0x61, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52,
+	0x0a, 0x64, 0x61, 0x74, 0x61, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x06, 0x66,
+	0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x61,
+	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e,
+	0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x80, 0x01,
+	0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38,
+	0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
+	0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+	0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08,
+	0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69,
+	0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74,
+	0x69, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
+	0x22, 0x0f, 0x0a, 0x0d, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+	0x65, 0x42, 0x6c, 0x0a, 0x27, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e,
+	0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x5a, 0x41, 0x67, 0x69,
+	0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f,
+	0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61,
+	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62,
+	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_banyandb_trace_v1_write_proto_rawDescOnce sync.Once
+	file_banyandb_trace_v1_write_proto_rawDescData = file_banyandb_trace_v1_write_proto_rawDesc
+)
+
+func file_banyandb_trace_v1_write_proto_rawDescGZIP() []byte {
+	file_banyandb_trace_v1_write_proto_rawDescOnce.Do(func() {
+		file_banyandb_trace_v1_write_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_trace_v1_write_proto_rawDescData)
+	})
+	return file_banyandb_trace_v1_write_proto_rawDescData
+}
+
+var file_banyandb_trace_v1_write_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_banyandb_trace_v1_write_proto_goTypes = []interface{}{
+	(*EntityValue)(nil),           // 0: banyandb.trace.v1.EntityValue
+	(*WriteRequest)(nil),          // 1: banyandb.trace.v1.WriteRequest
+	(*WriteResponse)(nil),         // 2: banyandb.trace.v1.WriteResponse
+	(*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp
+	(*v1.Field)(nil),              // 4: banyandb.model.v1.Field
+	(*v11.Metadata)(nil),          // 5: banyandb.common.v1.Metadata
+}
+var file_banyandb_trace_v1_write_proto_depIdxs = []int32{
+	3, // 0: banyandb.trace.v1.EntityValue.timestamp:type_name -> google.protobuf.Timestamp
+	4, // 1: banyandb.trace.v1.EntityValue.fields:type_name -> banyandb.model.v1.Field
+	5, // 2: banyandb.trace.v1.WriteRequest.metadata:type_name -> banyandb.common.v1.Metadata
+	0, // 3: banyandb.trace.v1.WriteRequest.entity:type_name -> banyandb.trace.v1.EntityValue
+	4, // [4:4] is the sub-list for method output_type
+	4, // [4:4] is the sub-list for method input_type
+	4, // [4:4] is the sub-list for extension type_name
+	4, // [4:4] is the sub-list for extension extendee
+	0, // [0:4] is the sub-list for field type_name
+}
+
+func init() { file_banyandb_trace_v1_write_proto_init() }
+func file_banyandb_trace_v1_write_proto_init() {
+	if File_banyandb_trace_v1_write_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_banyandb_trace_v1_write_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*EntityValue); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_trace_v1_write_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*WriteRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_banyandb_trace_v1_write_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*WriteResponse); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_banyandb_trace_v1_write_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   3,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_banyandb_trace_v1_write_proto_goTypes,
+		DependencyIndexes: file_banyandb_trace_v1_write_proto_depIdxs,
+		MessageInfos:      file_banyandb_trace_v1_write_proto_msgTypes,
+	}.Build()
+	File_banyandb_trace_v1_write_proto = out.File
+	file_banyandb_trace_v1_write_proto_rawDesc = nil
+	file_banyandb_trace_v1_write_proto_goTypes = nil
+	file_banyandb_trace_v1_write_proto_depIdxs = nil
+}
diff --git a/api/proto/banyandb/v1/write.proto b/api/proto/banyandb/trace/v1/write.proto
similarity index 74%
rename from api/proto/banyandb/v1/write.proto
rename to api/proto/banyandb/trace/v1/write.proto
index 02e2d1a..b0ed668 100644
--- a/api/proto/banyandb/v1/write.proto
+++ b/api/proto/banyandb/trace/v1/write.proto
@@ -17,40 +17,14 @@
 
 syntax = "proto3";
 
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
+option java_package = "org.apache.skywalking.banyandb.trace.v1";
+option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1";
 
-package banyandb.v1;
+package banyandb.trace.v1;
 
 import "google/protobuf/timestamp.proto";
-import "google/protobuf/struct.proto";
-import "banyandb/v1/database.proto";
-
-message Str {
-  string value = 1;
-}
-
-message Int {
-  int64 value = 1;
-}
-
-message StrArray {
-  repeated string value = 1;
-}
-
-message IntArray {
-  repeated int64 value = 1;
-}
-
-message Field {
-  oneof value_type {
-    google.protobuf.NullValue null = 1;
-    Str str = 2;
-    StrArray str_array = 3;
-    Int int = 4;
-    IntArray int_array = 5;
-  }
-}
+import "banyandb/common/v1/common.proto";
+import "banyandb/model/v1/write.proto";
 
 message EntityValue {
   // entity_id could be span_id of a Span or segment_id of a Segment in the context of Trace
@@ -65,14 +39,14 @@ message EntityValue {
   // Field only has value, as the value of value_type match with the key
   // by the index rules and index rule bindings of Metadata group.
   // indexed fields of multiple entities are compression in the fields.
-  repeated Field fields = 4;
+  repeated model.v1.Field fields = 4;
 }
 
 message WriteRequest {
   // the metadata is only required in the first write.
-  Metadata metadata = 1;
+  common.v1.Metadata metadata = 1;
   // the entity is required.
   EntityValue entity = 2;
 }
 
-message WriteResponse {}
\ No newline at end of file
+message WriteResponse {}
diff --git a/api/proto/banyandb/v1/database.pb.go b/api/proto/banyandb/v1/database.pb.go
deleted file mode 100644
index e20e29c..0000000
--- a/api/proto/banyandb/v1/database.pb.go
+++ /dev/null
@@ -1,644 +0,0 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.27.1
-// 	protoc        v3.17.3
-// source: banyandb/v1/database.proto
-
-package v1
-
-import (
-	reflect "reflect"
-	sync "sync"
-
-	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
-	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
-	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
-)
-
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type Action int32
-
-const (
-	Action_ACTION_UNSPECIFIED Action = 0
-	Action_ACTION_PUT         Action = 1
-	Action_ACTION_DELETE      Action = 2
-)
-
-// Enum value maps for Action.
-var (
-	Action_name = map[int32]string{
-		0: "ACTION_UNSPECIFIED",
-		1: "ACTION_PUT",
-		2: "ACTION_DELETE",
-	}
-	Action_value = map[string]int32{
-		"ACTION_UNSPECIFIED": 0,
-		"ACTION_PUT":         1,
-		"ACTION_DELETE":      2,
-	}
-)
-
-func (x Action) Enum() *Action {
-	p := new(Action)
-	*p = x
-	return p
-}
-
-func (x Action) String() string {
-	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (Action) Descriptor() protoreflect.EnumDescriptor {
-	return file_banyandb_v1_database_proto_enumTypes[0].Descriptor()
-}
-
-func (Action) Type() protoreflect.EnumType {
-	return &file_banyandb_v1_database_proto_enumTypes[0]
-}
-
-func (x Action) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use Action.Descriptor instead.
-func (Action) EnumDescriptor() ([]byte, []int) {
-	return file_banyandb_v1_database_proto_rawDescGZIP(), []int{0}
-}
-
-type Node struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
-	Addr      string                 `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
-	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
-	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
-}
-
-func (x *Node) Reset() {
-	*x = Node{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_database_proto_msgTypes[0]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *Node) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Node) ProtoMessage() {}
-
-func (x *Node) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_database_proto_msgTypes[0]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use Node.ProtoReflect.Descriptor instead.
-func (*Node) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_database_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *Node) GetId() string {
-	if x != nil {
-		return x.Id
-	}
-	return ""
-}
-
-func (x *Node) GetAddr() string {
-	if x != nil {
-		return x.Addr
-	}
-	return ""
-}
-
-func (x *Node) GetUpdatedAt() *timestamppb.Timestamp {
-	if x != nil {
-		return x.UpdatedAt
-	}
-	return nil
-}
-
-func (x *Node) GetCreatedAt() *timestamppb.Timestamp {
-	if x != nil {
-		return x.CreatedAt
-	}
-	return nil
-}
-
-type Shard struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Id        uint64                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
-	Series    *Metadata              `protobuf:"bytes,2,opt,name=series,proto3" json:"series,omitempty"`
-	Node      *Node                  `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"`
-	Total     uint32                 `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"`
-	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
-	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
-}
-
-func (x *Shard) Reset() {
-	*x = Shard{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_database_proto_msgTypes[1]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *Shard) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Shard) ProtoMessage() {}
-
-func (x *Shard) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_database_proto_msgTypes[1]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use Shard.ProtoReflect.Descriptor instead.
-func (*Shard) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_database_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *Shard) GetId() uint64 {
-	if x != nil {
-		return x.Id
-	}
-	return 0
-}
-
-func (x *Shard) GetSeries() *Metadata {
-	if x != nil {
-		return x.Series
-	}
-	return nil
-}
-
-func (x *Shard) GetNode() *Node {
-	if x != nil {
-		return x.Node
-	}
-	return nil
-}
-
-func (x *Shard) GetTotal() uint32 {
-	if x != nil {
-		return x.Total
-	}
-	return 0
-}
-
-func (x *Shard) GetUpdatedAt() *timestamppb.Timestamp {
-	if x != nil {
-		return x.UpdatedAt
-	}
-	return nil
-}
-
-func (x *Shard) GetCreatedAt() *timestamppb.Timestamp {
-	if x != nil {
-		return x.CreatedAt
-	}
-	return nil
-}
-
-type ShardEvent struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Shard  *Shard                 `protobuf:"bytes,1,opt,name=shard,proto3" json:"shard,omitempty"`
-	Action Action                 `protobuf:"varint,2,opt,name=action,proto3,enum=banyandb.v1.Action" json:"action,omitempty"`
-	Time   *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3" json:"time,omitempty"`
-}
-
-func (x *ShardEvent) Reset() {
-	*x = ShardEvent{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_database_proto_msgTypes[2]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *ShardEvent) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ShardEvent) ProtoMessage() {}
-
-func (x *ShardEvent) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_database_proto_msgTypes[2]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use ShardEvent.ProtoReflect.Descriptor instead.
-func (*ShardEvent) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_database_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *ShardEvent) GetShard() *Shard {
-	if x != nil {
-		return x.Shard
-	}
-	return nil
-}
-
-func (x *ShardEvent) GetAction() Action {
-	if x != nil {
-		return x.Action
-	}
-	return Action_ACTION_UNSPECIFIED
-}
-
-func (x *ShardEvent) GetTime() *timestamppb.Timestamp {
-	if x != nil {
-		return x.Time
-	}
-	return nil
-}
-
-type SeriesEvent struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Series                      *Metadata              `protobuf:"bytes,1,opt,name=series,proto3" json:"series,omitempty"`
-	FieldNamesCompositeSeriesId []string               `protobuf:"bytes,2,rep,name=field_names_composite_series_id,json=fieldNamesCompositeSeriesId,proto3" json:"field_names_composite_series_id,omitempty"`
-	Action                      Action                 `protobuf:"varint,3,opt,name=action,proto3,enum=banyandb.v1.Action" json:"action,omitempty"`
-	Time                        *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"`
-}
-
-func (x *SeriesEvent) Reset() {
-	*x = SeriesEvent{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_database_proto_msgTypes[3]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *SeriesEvent) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*SeriesEvent) ProtoMessage() {}
-
-func (x *SeriesEvent) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_database_proto_msgTypes[3]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use SeriesEvent.ProtoReflect.Descriptor instead.
-func (*SeriesEvent) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_database_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *SeriesEvent) GetSeries() *Metadata {
-	if x != nil {
-		return x.Series
-	}
-	return nil
-}
-
-func (x *SeriesEvent) GetFieldNamesCompositeSeriesId() []string {
-	if x != nil {
-		return x.FieldNamesCompositeSeriesId
-	}
-	return nil
-}
-
-func (x *SeriesEvent) GetAction() Action {
-	if x != nil {
-		return x.Action
-	}
-	return Action_ACTION_UNSPECIFIED
-}
-
-func (x *SeriesEvent) GetTime() *timestamppb.Timestamp {
-	if x != nil {
-		return x.Time
-	}
-	return nil
-}
-
-// Metadata is for multi-tenant, multi-model use
-type Metadata struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// group contains a set of options, like retention policy, max
-	Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
-	// name of the entity
-	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
-}
-
-func (x *Metadata) Reset() {
-	*x = Metadata{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_database_proto_msgTypes[4]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *Metadata) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Metadata) ProtoMessage() {}
-
-func (x *Metadata) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_database_proto_msgTypes[4]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use Metadata.ProtoReflect.Descriptor instead.
-func (*Metadata) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_database_proto_rawDescGZIP(), []int{4}
-}
-
-func (x *Metadata) GetGroup() string {
-	if x != nil {
-		return x.Group
-	}
-	return ""
-}
-
-func (x *Metadata) GetName() string {
-	if x != nil {
-		return x.Name
-	}
-	return ""
-}
-
-var File_banyandb_v1_database_proto protoreflect.FileDescriptor
-
-var file_banyandb_v1_database_proto_rawDesc = []byte{
-	0x0a, 0x1a, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61,
-	0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x61,
-	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
-	0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73,
-	0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x01, 0x0a, 0x04, 0x4e,
-	0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74,
-	0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
-	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
-	0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64,
-	0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74,
-	0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
-	0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xf9, 0x01,
-	0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65,
-	0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
-	0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06,
-	0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x03,
-	0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
-	0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a,
-	0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f,
-	0x74, 0x61, 0x6c, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61,
-	0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
-	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
-	0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39,
-	0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01,
-	0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09,
-	0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x93, 0x01, 0x0a, 0x0a, 0x53, 0x68,
-	0x61, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72,
-	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
-	0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x05, 0x73, 0x68, 0x61,
-	0x72, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31,
-	0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
-	0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
-	0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
-	0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22,
-	0xdf, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12,
-	0x2d, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
-	0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65,
-	0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x44,
-	0x0a, 0x1f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x5f, 0x63, 0x6f,
-	0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x69,
-	0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61,
-	0x6d, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x53, 0x65, 0x72, 0x69,
-	0x65, 0x73, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03,
-	0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
-	0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f,
-	0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
-	0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
-	0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d,
-	0x65, 0x22, 0x34, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a,
-	0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72,
-	0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x43, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f,
-	0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50,
-	0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x43, 0x54,
-	0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x54,
-	0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x42, 0x60, 0x0a, 0x1e,
-	0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61,
-	0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x5a, 0x3e,
-	0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68,
-	0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e,
-	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
-	0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var (
-	file_banyandb_v1_database_proto_rawDescOnce sync.Once
-	file_banyandb_v1_database_proto_rawDescData = file_banyandb_v1_database_proto_rawDesc
-)
-
-func file_banyandb_v1_database_proto_rawDescGZIP() []byte {
-	file_banyandb_v1_database_proto_rawDescOnce.Do(func() {
-		file_banyandb_v1_database_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_v1_database_proto_rawDescData)
-	})
-	return file_banyandb_v1_database_proto_rawDescData
-}
-
-var file_banyandb_v1_database_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_banyandb_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
-var file_banyandb_v1_database_proto_goTypes = []interface{}{
-	(Action)(0),                   // 0: banyandb.v1.Action
-	(*Node)(nil),                  // 1: banyandb.v1.Node
-	(*Shard)(nil),                 // 2: banyandb.v1.Shard
-	(*ShardEvent)(nil),            // 3: banyandb.v1.ShardEvent
-	(*SeriesEvent)(nil),           // 4: banyandb.v1.SeriesEvent
-	(*Metadata)(nil),              // 5: banyandb.v1.Metadata
-	(*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp
-}
-var file_banyandb_v1_database_proto_depIdxs = []int32{
-	6,  // 0: banyandb.v1.Node.updated_at:type_name -> google.protobuf.Timestamp
-	6,  // 1: banyandb.v1.Node.created_at:type_name -> google.protobuf.Timestamp
-	5,  // 2: banyandb.v1.Shard.series:type_name -> banyandb.v1.Metadata
-	1,  // 3: banyandb.v1.Shard.node:type_name -> banyandb.v1.Node
-	6,  // 4: banyandb.v1.Shard.updated_at:type_name -> google.protobuf.Timestamp
-	6,  // 5: banyandb.v1.Shard.created_at:type_name -> google.protobuf.Timestamp
-	2,  // 6: banyandb.v1.ShardEvent.shard:type_name -> banyandb.v1.Shard
-	0,  // 7: banyandb.v1.ShardEvent.action:type_name -> banyandb.v1.Action
-	6,  // 8: banyandb.v1.ShardEvent.time:type_name -> google.protobuf.Timestamp
-	5,  // 9: banyandb.v1.SeriesEvent.series:type_name -> banyandb.v1.Metadata
-	0,  // 10: banyandb.v1.SeriesEvent.action:type_name -> banyandb.v1.Action
-	6,  // 11: banyandb.v1.SeriesEvent.time:type_name -> google.protobuf.Timestamp
-	12, // [12:12] is the sub-list for method output_type
-	12, // [12:12] is the sub-list for method input_type
-	12, // [12:12] is the sub-list for extension type_name
-	12, // [12:12] is the sub-list for extension extendee
-	0,  // [0:12] is the sub-list for field type_name
-}
-
-func init() { file_banyandb_v1_database_proto_init() }
-func file_banyandb_v1_database_proto_init() {
-	if File_banyandb_v1_database_proto != nil {
-		return
-	}
-	if !protoimpl.UnsafeEnabled {
-		file_banyandb_v1_database_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Node); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_database_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Shard); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_database_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*ShardEvent); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_database_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*SeriesEvent); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_database_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Metadata); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-	}
-	type x struct{}
-	out := protoimpl.TypeBuilder{
-		File: protoimpl.DescBuilder{
-			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
-			RawDescriptor: file_banyandb_v1_database_proto_rawDesc,
-			NumEnums:      1,
-			NumMessages:   5,
-			NumExtensions: 0,
-			NumServices:   0,
-		},
-		GoTypes:           file_banyandb_v1_database_proto_goTypes,
-		DependencyIndexes: file_banyandb_v1_database_proto_depIdxs,
-		EnumInfos:         file_banyandb_v1_database_proto_enumTypes,
-		MessageInfos:      file_banyandb_v1_database_proto_msgTypes,
-	}.Build()
-	File_banyandb_v1_database_proto = out.File
-	file_banyandb_v1_database_proto_rawDesc = nil
-	file_banyandb_v1_database_proto_goTypes = nil
-	file_banyandb_v1_database_proto_depIdxs = nil
-}
diff --git a/api/proto/banyandb/v1/query.pb.go b/api/proto/banyandb/v1/query.pb.go
deleted file mode 100644
index 4fd3288..0000000
--- a/api/proto/banyandb/v1/query.pb.go
+++ /dev/null
@@ -1,1132 +0,0 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.27.1
-// 	protoc        v3.17.3
-// source: banyandb/v1/query.proto
-
-package v1
-
-import (
-	reflect "reflect"
-	sync "sync"
-
-	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
-	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
-	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
-)
-
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-// BinaryOp specifies the operation imposed to the given query condition
-// For EQ, NE, LT, GT, LE and GE, only one operand should be given, i.e. one-to-one relationship.
-// HAVING and NOT_HAVING allow multi-value to be the operand such as array/vector, i.e. one-to-many relationship.
-// For example, "keyA" contains "valueA" **and** "valueB"
-type PairQuery_BinaryOp int32
-
-const (
-	PairQuery_BINARY_OP_UNSPECIFIED PairQuery_BinaryOp = 0
-	PairQuery_BINARY_OP_EQ          PairQuery_BinaryOp = 1
-	PairQuery_BINARY_OP_NE          PairQuery_BinaryOp = 2
-	PairQuery_BINARY_OP_LT          PairQuery_BinaryOp = 3
-	PairQuery_BINARY_OP_GT          PairQuery_BinaryOp = 4
-	PairQuery_BINARY_OP_LE          PairQuery_BinaryOp = 5
-	PairQuery_BINARY_OP_GE          PairQuery_BinaryOp = 6
-	PairQuery_BINARY_OP_HAVING      PairQuery_BinaryOp = 7
-	PairQuery_BINARY_OP_NOT_HAVING  PairQuery_BinaryOp = 8
-)
-
-// Enum value maps for PairQuery_BinaryOp.
-var (
-	PairQuery_BinaryOp_name = map[int32]string{
-		0: "BINARY_OP_UNSPECIFIED",
-		1: "BINARY_OP_EQ",
-		2: "BINARY_OP_NE",
-		3: "BINARY_OP_LT",
-		4: "BINARY_OP_GT",
-		5: "BINARY_OP_LE",
-		6: "BINARY_OP_GE",
-		7: "BINARY_OP_HAVING",
-		8: "BINARY_OP_NOT_HAVING",
-	}
-	PairQuery_BinaryOp_value = map[string]int32{
-		"BINARY_OP_UNSPECIFIED": 0,
-		"BINARY_OP_EQ":          1,
-		"BINARY_OP_NE":          2,
-		"BINARY_OP_LT":          3,
-		"BINARY_OP_GT":          4,
-		"BINARY_OP_LE":          5,
-		"BINARY_OP_GE":          6,
-		"BINARY_OP_HAVING":      7,
-		"BINARY_OP_NOT_HAVING":  8,
-	}
-)
-
-func (x PairQuery_BinaryOp) Enum() *PairQuery_BinaryOp {
-	p := new(PairQuery_BinaryOp)
-	*p = x
-	return p
-}
-
-func (x PairQuery_BinaryOp) String() string {
-	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (PairQuery_BinaryOp) Descriptor() protoreflect.EnumDescriptor {
-	return file_banyandb_v1_query_proto_enumTypes[0].Descriptor()
-}
-
-func (PairQuery_BinaryOp) Type() protoreflect.EnumType {
-	return &file_banyandb_v1_query_proto_enumTypes[0]
-}
-
-func (x PairQuery_BinaryOp) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use PairQuery_BinaryOp.Descriptor instead.
-func (PairQuery_BinaryOp) EnumDescriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{3, 0}
-}
-
-type QueryOrder_Sort int32
-
-const (
-	QueryOrder_SORT_UNSPECIFIED QueryOrder_Sort = 0
-	QueryOrder_SORT_DESC        QueryOrder_Sort = 1
-	QueryOrder_SORT_ASC         QueryOrder_Sort = 2
-)
-
-// Enum value maps for QueryOrder_Sort.
-var (
-	QueryOrder_Sort_name = map[int32]string{
-		0: "SORT_UNSPECIFIED",
-		1: "SORT_DESC",
-		2: "SORT_ASC",
-	}
-	QueryOrder_Sort_value = map[string]int32{
-		"SORT_UNSPECIFIED": 0,
-		"SORT_DESC":        1,
-		"SORT_ASC":         2,
-	}
-)
-
-func (x QueryOrder_Sort) Enum() *QueryOrder_Sort {
-	p := new(QueryOrder_Sort)
-	*p = x
-	return p
-}
-
-func (x QueryOrder_Sort) String() string {
-	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (QueryOrder_Sort) Descriptor() protoreflect.EnumDescriptor {
-	return file_banyandb_v1_query_proto_enumTypes[1].Descriptor()
-}
-
-func (QueryOrder_Sort) Type() protoreflect.EnumType {
-	return &file_banyandb_v1_query_proto_enumTypes[1]
-}
-
-func (x QueryOrder_Sort) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use QueryOrder_Sort.Descriptor instead.
-func (QueryOrder_Sort) EnumDescriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{4, 0}
-}
-
-// IntPair in a typed pair with an array of int64 as values
-type IntPair struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Key    string  `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
-	Values []int64 `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"`
-}
-
-func (x *IntPair) Reset() {
-	*x = IntPair{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[0]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *IntPair) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*IntPair) ProtoMessage() {}
-
-func (x *IntPair) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[0]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use IntPair.ProtoReflect.Descriptor instead.
-func (*IntPair) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *IntPair) GetKey() string {
-	if x != nil {
-		return x.Key
-	}
-	return ""
-}
-
-func (x *IntPair) GetValues() []int64 {
-	if x != nil {
-		return x.Values
-	}
-	return nil
-}
-
-// StrPair in a typed pair with an array of string as values
-type StrPair struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Key    string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
-	Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
-}
-
-func (x *StrPair) Reset() {
-	*x = StrPair{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[1]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *StrPair) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*StrPair) ProtoMessage() {}
-
-func (x *StrPair) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[1]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use StrPair.ProtoReflect.Descriptor instead.
-func (*StrPair) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *StrPair) GetKey() string {
-	if x != nil {
-		return x.Key
-	}
-	return ""
-}
-
-func (x *StrPair) GetValues() []string {
-	if x != nil {
-		return x.Values
-	}
-	return nil
-}
-
-// Pair is the building block of a record which is equivalent to a key-value pair.
-// In the context of Trace, it could be metadata of a trace such as service_name, service_instance, etc.
-// Besides, other fields/tags are organized in key-value pair in the underlying storage layer.
-// One should notice that the values can be a multi-value.
-type TypedPair struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// Types that are assignable to Typed:
-	//	*TypedPair_IntPair
-	//	*TypedPair_StrPair
-	Typed isTypedPair_Typed `protobuf_oneof:"typed"`
-}
-
-func (x *TypedPair) Reset() {
-	*x = TypedPair{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[2]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *TypedPair) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TypedPair) ProtoMessage() {}
-
-func (x *TypedPair) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[2]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use TypedPair.ProtoReflect.Descriptor instead.
-func (*TypedPair) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{2}
-}
-
-func (m *TypedPair) GetTyped() isTypedPair_Typed {
-	if m != nil {
-		return m.Typed
-	}
-	return nil
-}
-
-func (x *TypedPair) GetIntPair() *IntPair {
-	if x, ok := x.GetTyped().(*TypedPair_IntPair); ok {
-		return x.IntPair
-	}
-	return nil
-}
-
-func (x *TypedPair) GetStrPair() *StrPair {
-	if x, ok := x.GetTyped().(*TypedPair_StrPair); ok {
-		return x.StrPair
-	}
-	return nil
-}
-
-type isTypedPair_Typed interface {
-	isTypedPair_Typed()
-}
-
-type TypedPair_IntPair struct {
-	IntPair *IntPair `protobuf:"bytes,1,opt,name=int_pair,json=intPair,proto3,oneof"`
-}
-
-type TypedPair_StrPair struct {
-	StrPair *StrPair `protobuf:"bytes,2,opt,name=str_pair,json=strPair,proto3,oneof"`
-}
-
-func (*TypedPair_IntPair) isTypedPair_Typed() {}
-
-func (*TypedPair_StrPair) isTypedPair_Typed() {}
-
-// PairQuery consists of the query condition with a single binary operator to be imposed
-// For 1:1 BinaryOp, values in condition must be an array with length = 1,
-// while for 1:N BinaryOp, values can be an array with length >= 1.
-type PairQuery struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Op        PairQuery_BinaryOp `protobuf:"varint,1,opt,name=op,proto3,enum=banyandb.v1.PairQuery_BinaryOp" json:"op,omitempty"`
-	Condition *TypedPair         `protobuf:"bytes,2,opt,name=condition,proto3" json:"condition,omitempty"`
-}
-
-func (x *PairQuery) Reset() {
-	*x = PairQuery{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[3]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *PairQuery) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*PairQuery) ProtoMessage() {}
-
-func (x *PairQuery) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[3]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use PairQuery.ProtoReflect.Descriptor instead.
-func (*PairQuery) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *PairQuery) GetOp() PairQuery_BinaryOp {
-	if x != nil {
-		return x.Op
-	}
-	return PairQuery_BINARY_OP_UNSPECIFIED
-}
-
-func (x *PairQuery) GetCondition() *TypedPair {
-	if x != nil {
-		return x.Condition
-	}
-	return nil
-}
-
-// QueryOrder means a Sort operation to be done for a given field.
-// The key_name refers to the key of a Pair.
-type QueryOrder struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	KeyName string          `protobuf:"bytes,1,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"`
-	Sort    QueryOrder_Sort `protobuf:"varint,2,opt,name=sort,proto3,enum=banyandb.v1.QueryOrder_Sort" json:"sort,omitempty"`
-}
-
-func (x *QueryOrder) Reset() {
-	*x = QueryOrder{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[4]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *QueryOrder) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*QueryOrder) ProtoMessage() {}
-
-func (x *QueryOrder) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[4]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use QueryOrder.ProtoReflect.Descriptor instead.
-func (*QueryOrder) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{4}
-}
-
-func (x *QueryOrder) GetKeyName() string {
-	if x != nil {
-		return x.KeyName
-	}
-	return ""
-}
-
-func (x *QueryOrder) GetSort() QueryOrder_Sort {
-	if x != nil {
-		return x.Sort
-	}
-	return QueryOrder_SORT_UNSPECIFIED
-}
-
-// Entity represents
-// (Trace context) a Span defined in Google Dapper paper or equivalently a Segment in Skywalking.
-// (Log context) a log
-type Entity struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// entity_id could be span_id of a Span or segment_id of a Segment in the context of Trace
-	EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
-	// timestamp represents
-	// 1) either the start time of a Span/Segment,
-	// 2) or the timestamp of a log
-	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
-	// data_binary contains all un-indexed Tags and other key-value pairs
-	DataBinary []byte `protobuf:"bytes,3,opt,name=data_binary,json=dataBinary,proto3" json:"data_binary,omitempty"`
-	// fields contains all indexed Field. Some typical names,
-	// - trace_id
-	// - duration
-	// - service_name
-	// - service_instance_id
-	// - end_time_nanoseconds
-	Fields []*TypedPair `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
-}
-
-func (x *Entity) Reset() {
-	*x = Entity{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[5]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *Entity) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Entity) ProtoMessage() {}
-
-func (x *Entity) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[5]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use Entity.ProtoReflect.Descriptor instead.
-func (*Entity) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{5}
-}
-
-func (x *Entity) GetEntityId() string {
-	if x != nil {
-		return x.EntityId
-	}
-	return ""
-}
-
-func (x *Entity) GetTimestamp() *timestamppb.Timestamp {
-	if x != nil {
-		return x.Timestamp
-	}
-	return nil
-}
-
-func (x *Entity) GetDataBinary() []byte {
-	if x != nil {
-		return x.DataBinary
-	}
-	return nil
-}
-
-func (x *Entity) GetFields() []*TypedPair {
-	if x != nil {
-		return x.Fields
-	}
-	return nil
-}
-
-// QueryResponse is the response for a query to the Query module.
-type QueryResponse struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// entities are the actual data returned
-	Entities []*Entity `protobuf:"bytes,1,rep,name=entities,proto3" json:"entities,omitempty"`
-}
-
-func (x *QueryResponse) Reset() {
-	*x = QueryResponse{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[6]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *QueryResponse) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*QueryResponse) ProtoMessage() {}
-
-func (x *QueryResponse) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[6]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
-func (*QueryResponse) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{6}
-}
-
-func (x *QueryResponse) GetEntities() []*Entity {
-	if x != nil {
-		return x.Entities
-	}
-	return nil
-}
-
-// Projection is used to select the names of keys to be returned.
-type Projection struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// The key_name refers to the key(s) of Pair(s).
-	KeyNames []string `protobuf:"bytes,1,rep,name=key_names,json=keyNames,proto3" json:"key_names,omitempty"`
-}
-
-func (x *Projection) Reset() {
-	*x = Projection{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[7]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *Projection) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Projection) ProtoMessage() {}
-
-func (x *Projection) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[7]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use Projection.ProtoReflect.Descriptor instead.
-func (*Projection) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{7}
-}
-
-func (x *Projection) GetKeyNames() []string {
-	if x != nil {
-		return x.KeyNames
-	}
-	return nil
-}
-
-// TimeRange is a range query for uint64,
-// the range here follows left-inclusive and right-exclusive rule, i.e. [begin, end) if both edges exist
-type TimeRange struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Begin *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=begin,proto3" json:"begin,omitempty"`
-	End   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
-}
-
-func (x *TimeRange) Reset() {
-	*x = TimeRange{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[8]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *TimeRange) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TimeRange) ProtoMessage() {}
-
-func (x *TimeRange) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[8]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use TimeRange.ProtoReflect.Descriptor instead.
-func (*TimeRange) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{8}
-}
-
-func (x *TimeRange) GetBegin() *timestamppb.Timestamp {
-	if x != nil {
-		return x.Begin
-	}
-	return nil
-}
-
-func (x *TimeRange) GetEnd() *timestamppb.Timestamp {
-	if x != nil {
-		return x.End
-	}
-	return nil
-}
-
-// QueryRequest is the request contract for query.
-type QueryRequest struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// metadata is required
-	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
-	// time_range is a range query with begin/end time of entities in the timeunit of nanoseconds.
-	// In the context of Trace, it represents the range of the `startTime` for spans/segments,
-	// while in the context of Log, it means the range of the timestamp(s) for logs.
-	// it is always recommended to specify time range for performance reason
-	TimeRange *TimeRange `protobuf:"bytes,2,opt,name=time_range,json=timeRange,proto3" json:"time_range,omitempty"`
-	// offset is used to support pagination, together with the following limit
-	Offset uint32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
-	// limit is used to impose a boundary on the number of records being returned
-	Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
-	// order_by is given to specify the sort for a field. So far, only fields in the type of Integer are supported
-	OrderBy *QueryOrder `protobuf:"bytes,5,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
-	// fields are indexed. Some typical fields are listed below,
-	// - trace_id: if given, it takes precedence over other fields and will be used to retrieve entities before other conditions are imposed
-	// - duration: typical for trace context
-	Fields []*PairQuery `protobuf:"bytes,6,rep,name=fields,proto3" json:"fields,omitempty"`
-	// projection can be used to select the key names of the entities in the response
-	Projection *Projection `protobuf:"bytes,7,opt,name=projection,proto3" json:"projection,omitempty"`
-}
-
-func (x *QueryRequest) Reset() {
-	*x = QueryRequest{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_query_proto_msgTypes[9]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *QueryRequest) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*QueryRequest) ProtoMessage() {}
-
-func (x *QueryRequest) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_query_proto_msgTypes[9]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
-func (*QueryRequest) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_query_proto_rawDescGZIP(), []int{9}
-}
-
-func (x *QueryRequest) GetMetadata() *Metadata {
-	if x != nil {
-		return x.Metadata
-	}
-	return nil
-}
-
-func (x *QueryRequest) GetTimeRange() *TimeRange {
-	if x != nil {
-		return x.TimeRange
-	}
-	return nil
-}
-
-func (x *QueryRequest) GetOffset() uint32 {
-	if x != nil {
-		return x.Offset
-	}
-	return 0
-}
-
-func (x *QueryRequest) GetLimit() uint32 {
-	if x != nil {
-		return x.Limit
-	}
-	return 0
-}
-
-func (x *QueryRequest) GetOrderBy() *QueryOrder {
-	if x != nil {
-		return x.OrderBy
-	}
-	return nil
-}
-
-func (x *QueryRequest) GetFields() []*PairQuery {
-	if x != nil {
-		return x.Fields
-	}
-	return nil
-}
-
-func (x *QueryRequest) GetProjection() *Projection {
-	if x != nil {
-		return x.Projection
-	}
-	return nil
-}
-
-var File_banyandb_v1_query_proto protoreflect.FileDescriptor
-
-var file_banyandb_v1_query_proto_rawDesc = []byte{
-	0x0a, 0x17, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75,
-	0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x61, 0x6e, 0x79, 0x61,
-	0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
-	0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
-	0x62, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72,
-	0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x07, 0x49, 0x6e, 0x74, 0x50, 0x61, 0x69, 0x72, 0x12, 0x10,
-	0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
-	0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03,
-	0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x33, 0x0a, 0x07, 0x53, 0x74, 0x72, 0x50,
-	0x61, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18,
-	0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x7a, 0x0a,
-	0x09, 0x54, 0x79, 0x70, 0x65, 0x64, 0x50, 0x61, 0x69, 0x72, 0x12, 0x31, 0x0a, 0x08, 0x69, 0x6e,
-	0x74, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62,
-	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x50, 0x61,
-	0x69, 0x72, 0x48, 0x00, 0x52, 0x07, 0x69, 0x6e, 0x74, 0x50, 0x61, 0x69, 0x72, 0x12, 0x31, 0x0a,
-	0x08, 0x73, 0x74, 0x72, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
-	0x14, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74,
-	0x72, 0x50, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x07, 0x73, 0x74, 0x72, 0x50, 0x61, 0x69, 0x72,
-	0x42, 0x07, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x64, 0x22, 0xb6, 0x02, 0x0a, 0x09, 0x50, 0x61,
-	0x69, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76,
-	0x31, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x69, 0x6e, 0x61,
-	0x72, 0x79, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x34, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64,
-	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61,
-	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x50,
-	0x61, 0x69, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc1,
-	0x01, 0x0a, 0x08, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x4f, 0x70, 0x12, 0x19, 0x0a, 0x15, 0x42,
-	0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
-	0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59,
-	0x5f, 0x4f, 0x50, 0x5f, 0x45, 0x51, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x49, 0x4e, 0x41,
-	0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x49,
-	0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x4c, 0x54, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c,
-	0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x47, 0x54, 0x10, 0x04, 0x12, 0x10,
-	0x0a, 0x0c, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x4c, 0x45, 0x10, 0x05,
-	0x12, 0x10, 0x0a, 0x0c, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x47, 0x45,
-	0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f,
-	0x48, 0x41, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x12, 0x18, 0x0a, 0x14, 0x42, 0x49, 0x4e, 0x41,
-	0x52, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x48, 0x41, 0x56, 0x49, 0x4e, 0x47,
-	0x10, 0x08, 0x22, 0x94, 0x01, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65,
-	0x72, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x04,
-	0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e,
-	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72,
-	0x64, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x39,
-	0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x55,
-	0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09,
-	0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53,
-	0x4f, 0x52, 0x54, 0x5f, 0x41, 0x53, 0x43, 0x10, 0x02, 0x22, 0xb0, 0x01, 0x0a, 0x06, 0x45, 0x6e,
-	0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69,
-	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49,
-	0x64, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
-	0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
-	0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x64,
-	0x61, 0x74, 0x61, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c,
-	0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x2e, 0x0a, 0x06,
-	0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62,
-	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64,
-	0x50, 0x61, 0x69, 0x72, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x40, 0x0a, 0x0d,
-	0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a,
-	0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
-	0x13, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e,
-	0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x29,
-	0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09,
-	0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
-	0x08, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x6b, 0x0a, 0x09, 0x54, 0x69, 0x6d,
-	0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
-	0x70, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
-	0x70, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0xc3, 0x02, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79,
-	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64,
-	0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79,
-	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
-	0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, 0x0a, 0x74, 0x69,
-	0x6d, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16,
-	0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d,
-	0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x61, 0x6e, 0x67,
-	0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d,
-	0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12,
-	0x32, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28,
-	0x0b, 0x32, 0x17, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e,
-	0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65,
-	0x72, 0x42, 0x79, 0x12, 0x2e, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x06, 0x20,
-	0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76,
-	0x31, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65,
-	0x6c, 0x64, 0x73, 0x12, 0x37, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f,
-	0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
-	0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
-	0x52, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x60, 0x0a, 0x1e,
-	0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61,
-	0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x5a, 0x3e,
-	0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68,
-	0x65, 0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e,
-	0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
-	0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var (
-	file_banyandb_v1_query_proto_rawDescOnce sync.Once
-	file_banyandb_v1_query_proto_rawDescData = file_banyandb_v1_query_proto_rawDesc
-)
-
-func file_banyandb_v1_query_proto_rawDescGZIP() []byte {
-	file_banyandb_v1_query_proto_rawDescOnce.Do(func() {
-		file_banyandb_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_v1_query_proto_rawDescData)
-	})
-	return file_banyandb_v1_query_proto_rawDescData
-}
-
-var file_banyandb_v1_query_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
-var file_banyandb_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
-var file_banyandb_v1_query_proto_goTypes = []interface{}{
-	(PairQuery_BinaryOp)(0),       // 0: banyandb.v1.PairQuery.BinaryOp
-	(QueryOrder_Sort)(0),          // 1: banyandb.v1.QueryOrder.Sort
-	(*IntPair)(nil),               // 2: banyandb.v1.IntPair
-	(*StrPair)(nil),               // 3: banyandb.v1.StrPair
-	(*TypedPair)(nil),             // 4: banyandb.v1.TypedPair
-	(*PairQuery)(nil),             // 5: banyandb.v1.PairQuery
-	(*QueryOrder)(nil),            // 6: banyandb.v1.QueryOrder
-	(*Entity)(nil),                // 7: banyandb.v1.Entity
-	(*QueryResponse)(nil),         // 8: banyandb.v1.QueryResponse
-	(*Projection)(nil),            // 9: banyandb.v1.Projection
-	(*TimeRange)(nil),             // 10: banyandb.v1.TimeRange
-	(*QueryRequest)(nil),          // 11: banyandb.v1.QueryRequest
-	(*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp
-	(*Metadata)(nil),              // 13: banyandb.v1.Metadata
-}
-var file_banyandb_v1_query_proto_depIdxs = []int32{
-	2,  // 0: banyandb.v1.TypedPair.int_pair:type_name -> banyandb.v1.IntPair
-	3,  // 1: banyandb.v1.TypedPair.str_pair:type_name -> banyandb.v1.StrPair
-	0,  // 2: banyandb.v1.PairQuery.op:type_name -> banyandb.v1.PairQuery.BinaryOp
-	4,  // 3: banyandb.v1.PairQuery.condition:type_name -> banyandb.v1.TypedPair
-	1,  // 4: banyandb.v1.QueryOrder.sort:type_name -> banyandb.v1.QueryOrder.Sort
-	12, // 5: banyandb.v1.Entity.timestamp:type_name -> google.protobuf.Timestamp
-	4,  // 6: banyandb.v1.Entity.fields:type_name -> banyandb.v1.TypedPair
-	7,  // 7: banyandb.v1.QueryResponse.entities:type_name -> banyandb.v1.Entity
-	12, // 8: banyandb.v1.TimeRange.begin:type_name -> google.protobuf.Timestamp
-	12, // 9: banyandb.v1.TimeRange.end:type_name -> google.protobuf.Timestamp
-	13, // 10: banyandb.v1.QueryRequest.metadata:type_name -> banyandb.v1.Metadata
-	10, // 11: banyandb.v1.QueryRequest.time_range:type_name -> banyandb.v1.TimeRange
-	6,  // 12: banyandb.v1.QueryRequest.order_by:type_name -> banyandb.v1.QueryOrder
-	5,  // 13: banyandb.v1.QueryRequest.fields:type_name -> banyandb.v1.PairQuery
-	9,  // 14: banyandb.v1.QueryRequest.projection:type_name -> banyandb.v1.Projection
-	15, // [15:15] is the sub-list for method output_type
-	15, // [15:15] is the sub-list for method input_type
-	15, // [15:15] is the sub-list for extension type_name
-	15, // [15:15] is the sub-list for extension extendee
-	0,  // [0:15] is the sub-list for field type_name
-}
-
-func init() { file_banyandb_v1_query_proto_init() }
-func file_banyandb_v1_query_proto_init() {
-	if File_banyandb_v1_query_proto != nil {
-		return
-	}
-	file_banyandb_v1_database_proto_init()
-	if !protoimpl.UnsafeEnabled {
-		file_banyandb_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*IntPair); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*StrPair); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*TypedPair); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*PairQuery); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*QueryOrder); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Entity); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*QueryResponse); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Projection); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*TimeRange); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*QueryRequest); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-	}
-	file_banyandb_v1_query_proto_msgTypes[2].OneofWrappers = []interface{}{
-		(*TypedPair_IntPair)(nil),
-		(*TypedPair_StrPair)(nil),
-	}
-	type x struct{}
-	out := protoimpl.TypeBuilder{
-		File: protoimpl.DescBuilder{
-			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
-			RawDescriptor: file_banyandb_v1_query_proto_rawDesc,
-			NumEnums:      2,
-			NumMessages:   10,
-			NumExtensions: 0,
-			NumServices:   0,
-		},
-		GoTypes:           file_banyandb_v1_query_proto_goTypes,
-		DependencyIndexes: file_banyandb_v1_query_proto_depIdxs,
-		EnumInfos:         file_banyandb_v1_query_proto_enumTypes,
-		MessageInfos:      file_banyandb_v1_query_proto_msgTypes,
-	}.Build()
-	File_banyandb_v1_query_proto = out.File
-	file_banyandb_v1_query_proto_rawDesc = nil
-	file_banyandb_v1_query_proto_goTypes = nil
-	file_banyandb_v1_query_proto_depIdxs = nil
-}
diff --git a/api/proto/banyandb/v1/rpc.pb.go b/api/proto/banyandb/v1/rpc.pb.go
deleted file mode 100644
index 6f7e175..0000000
--- a/api/proto/banyandb/v1/rpc.pb.go
+++ /dev/null
@@ -1,109 +0,0 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.27.1
-// 	protoc        v3.17.3
-// source: banyandb/v1/rpc.proto
-
-package v1
-
-import (
-	reflect "reflect"
-
-	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
-	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
-)
-
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-var File_banyandb_v1_rpc_proto protoreflect.FileDescriptor
-
-var file_banyandb_v1_rpc_proto_rawDesc = []byte{
-	0x0a, 0x15, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x70,
-	0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
-	0x62, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76,
-	0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x62,
-	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x72, 0x69, 0x74, 0x65,
-	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x92, 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x63, 0x65,
-	0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79,
-	0x12, 0x19, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x51,
-	0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x61,
-	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
-	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65,
-	0x12, 0x19, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x57,
-	0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x61,
-	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52,
-	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x60, 0x0a, 0x1e, 0x6f,
-	0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c,
-	0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x5a, 0x3e, 0x67,
-	0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65,
-	0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79,
-	0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62,
-	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var file_banyandb_v1_rpc_proto_goTypes = []interface{}{
-	(*QueryRequest)(nil),  // 0: banyandb.v1.QueryRequest
-	(*WriteRequest)(nil),  // 1: banyandb.v1.WriteRequest
-	(*QueryResponse)(nil), // 2: banyandb.v1.QueryResponse
-	(*WriteResponse)(nil), // 3: banyandb.v1.WriteResponse
-}
-var file_banyandb_v1_rpc_proto_depIdxs = []int32{
-	0, // 0: banyandb.v1.TraceService.Query:input_type -> banyandb.v1.QueryRequest
-	1, // 1: banyandb.v1.TraceService.Write:input_type -> banyandb.v1.WriteRequest
-	2, // 2: banyandb.v1.TraceService.Query:output_type -> banyandb.v1.QueryResponse
-	3, // 3: banyandb.v1.TraceService.Write:output_type -> banyandb.v1.WriteResponse
-	2, // [2:4] is the sub-list for method output_type
-	0, // [0:2] is the sub-list for method input_type
-	0, // [0:0] is the sub-list for extension type_name
-	0, // [0:0] is the sub-list for extension extendee
-	0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_banyandb_v1_rpc_proto_init() }
-func file_banyandb_v1_rpc_proto_init() {
-	if File_banyandb_v1_rpc_proto != nil {
-		return
-	}
-	file_banyandb_v1_query_proto_init()
-	file_banyandb_v1_write_proto_init()
-	type x struct{}
-	out := protoimpl.TypeBuilder{
-		File: protoimpl.DescBuilder{
-			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
-			RawDescriptor: file_banyandb_v1_rpc_proto_rawDesc,
-			NumEnums:      0,
-			NumMessages:   0,
-			NumExtensions: 0,
-			NumServices:   1,
-		},
-		GoTypes:           file_banyandb_v1_rpc_proto_goTypes,
-		DependencyIndexes: file_banyandb_v1_rpc_proto_depIdxs,
-	}.Build()
-	File_banyandb_v1_rpc_proto = out.File
-	file_banyandb_v1_rpc_proto_rawDesc = nil
-	file_banyandb_v1_rpc_proto_goTypes = nil
-	file_banyandb_v1_rpc_proto_depIdxs = nil
-}
diff --git a/api/proto/banyandb/v1/schema.proto b/api/proto/banyandb/v1/schema.proto
deleted file mode 100644
index b262c2f..0000000
--- a/api/proto/banyandb/v1/schema.proto
+++ /dev/null
@@ -1,198 +0,0 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-syntax = "proto3";
-
-option java_package = "org.apache.skywalking.banyandb";
-option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1;v1";
-
-package banyandb.v1;
-
-import "google/protobuf/timestamp.proto";
-import "banyandb/v1/database.proto";
-
-message ShardInfo {
-  uint32 number = 1;
-  repeated string routing_fields = 2;
-}
-
-// Duration represents the elapsed time between two instants
-message Duration {
-  uint32 val = 1;
-  enum DurationUnit {
-    DURATION_UNIT_UNSPECIFIED = 0;
-    DURATION_UNIT_HOUR = 1;
-    DURATION_UNIT_DAY = 2;
-    DURATION_UNIT_WEEK = 3;
-    DURATION_UNIT_MONTH = 4;
-  }
-  DurationUnit unit = 2;
-}
-
-message FieldSpec {
-  string name = 1;
-  enum FieldType {
-    FIELD_TYPE_UNSPECIFIED = 0;
-    FIELD_TYPE_STRING = 1;
-    FIELD_TYPE_INT = 2;
-    FIELD_TYPE_STRING_ARRAY = 3;
-    FIELD_TYPE_INT_ARRAY = 4;
-  }
-  FieldType type = 2;
-}
-
-message TraceStateMap {
-  string field = 1;
-  string val_success = 2;
-  string val_error = 3;
-}
-
-// The key in TraceFieldMap are reserved by trace series engine. Their corresponding value is the Fields or
-// the combination of Fields
-message TraceFieldMap {
-  // trace_id the unique identity of a single trace
-  string trace_id = 1;
-  // series_id groups entities into a storage bucket
-  repeated string series_id = 2;
-  // state indicates the trace is "success" or "error"
-  TraceStateMap state = 3;
-}
-
-// TraceSeries represents a trace storage object
-message TraceSeries {
-  // metadata is the identity of a trace series
-  Metadata metadata = 1;
-  // fields defines accepted fields
-  repeated FieldSpec fields = 2;
-  // reserved_fields_map indicates how to index reserved fields to ingested fields
-  TraceFieldMap reserved_fields_map = 3;
-  // shard indicates how trace data distributes
-  ShardInfo shard = 4;
-  // duration determines how long a TraceSeries keeps its data
-  Duration duration = 5;
-  // updated_at_nanoseconds indicates when the TraceSeries is updated
-  google.protobuf.Timestamp updated_at = 6;
-}
-
-// IndexObject defines who should be indexed.
-message IndexObject {
-  // name is the identity of a IndexObject
-  string name = 1;
-  // fields are the combination that refers to an indexed object
-  // If the elements in fields are more than 1, the object will generate a multi-field index
-  // Caveat: All fields in a multi-field index MUST have an identical IndexType
-  repeated string fields = 2;
-  // IndexType determine the index structure under the hood
-  // Fields with SeriesInternal type is reserved by Series module, would not be indexed by Index module.
-  enum IndexType {
-    INDEX_TYPE_UNSPECIFIED = 0;
-    INDEX_TYPE_TEXT = 1;
-    INDEX_TYPE_NUMERICAL = 2;
-    INDEX_TYPE_ID = 3;
-    INDEX_TYPE_MULTI_TEXT = 4;
-    INDEX_TYPE_MULTI_NUMERICAL = 5;
-    INDEX_TYPE_SERIES_INTERNAL = 6;
-  }
-  // type is the IndexType of this IndexObject.
-  IndexType type = 3;
-}
-
-// IndexRule defines how to generate indices based on IndexObject
-// IndexRule should bind to an Series through an IndexRuleBinding to generate proper indices.
-// Example: A trace entity wants to index fields: trace_id, service_name, endpoint_name, and latency.
-//          and service_name and endpoint_name would combine a multi-field index.
-// The index rule could be:
-// IndexRule {
-//     metadata: {
-//         name: sw_trace
-//         group: production
-//     }
-//     objects: [
-//        {
-//            fields: [trace_id]
-//            type: ID
-//        },
-//        {
-//            fields: [service_name, endpoint_name]
-//            type: Text
-//        },
-//        {
-//            fields: [latency]
-//            type: Numerical
-//        },
-//    ]
-//    updated_at_nanoseconds: .......
-// }
-message IndexRule {
-  // metadata define the rule's identity
-  Metadata metadata = 1;
-  // objects refer to which fields should be indexed
-  repeated IndexObject objects = 2;
-  // updated_at_nanoseconds indicates when the IndexRule is updated
-  google.protobuf.Timestamp updated_at = 6;
-}
-
-// Series defines which subject(series) would generate indices
-// For example, if a TraceSeries's metadata is {name: sw_trace, group: production},
-//                in consequence, the Series is
-//                series {
-//                    catalog: Trace
-//                    series: {name: sw_trace, group: production}
-//                }
-message Series {
-  // Catalog refers to a placement contains objects belonged to a particular data type
-  enum Catalog {
-    CATALOG_UNSPECIFIED = 0;
-    CATALOG_TRACE = 1;
-    CATALOG_LOG = 2;
-    CATALOG_METRIC = 3;
-  }
-  // catalog is where the subject/series belongs to
-  Catalog catalog = 1;
-  // series refers to a series in a particular catalog
-  Metadata series = 2;
-}
-
-// IndexRuleBinding is a bridge to connect an IndexRule to several Series
-// This binding is valid between begin_at_nanoseconds and expire_at_nanoseconds, that provides flexible strategies
-// to control how to generate time series indices.
-message IndexRuleBinding {
-  // metadata is the identity of this binding
-  Metadata metadata = 1;
-  // rule_ref refers to the IndexRule
-  Metadata rule_ref = 2;
-  // subjects indicate the subjects of binding action
-  repeated Series subjects = 3;
-  // begin_at_nanoseconds is the timestamp, after which the binding will be active
-  google.protobuf.Timestamp begin_at = 4;
-  // expire_at_nanoseconds it the timestamp, after which the binding will be inactive
-  // expire_at_nanoseconds must be larger than begin_at_nanoseconds
-  google.protobuf.Timestamp expire_at = 5;
-  // updated_at_nanoseconds indicates when the IndexRuleBinding is updated
-  google.protobuf.Timestamp updated_at = 6;
-}
-
-message IndexRuleEvent {
-  Metadata series = 1;
-  message ShardedIndexRule {
-    uint64 shard_id = 1;
-    repeated IndexRule rules  = 2;
-  }
-  repeated ShardedIndexRule rules = 2;
-  Action action = 4;
-  google.protobuf.Timestamp time = 5;
-}
diff --git a/api/proto/banyandb/v1/write.pb.go b/api/proto/banyandb/v1/write.pb.go
deleted file mode 100644
index c2c1026..0000000
--- a/api/proto/banyandb/v1/write.pb.go
+++ /dev/null
@@ -1,764 +0,0 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.27.1
-// 	protoc        v3.17.3
-// source: banyandb/v1/write.proto
-
-package v1
-
-import (
-	reflect "reflect"
-	sync "sync"
-
-	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
-	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
-	structpb "google.golang.org/protobuf/types/known/structpb"
-	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
-)
-
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type Str struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (x *Str) Reset() {
-	*x = Str{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_write_proto_msgTypes[0]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *Str) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Str) ProtoMessage() {}
-
-func (x *Str) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_write_proto_msgTypes[0]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use Str.ProtoReflect.Descriptor instead.
-func (*Str) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_write_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *Str) GetValue() string {
-	if x != nil {
-		return x.Value
-	}
-	return ""
-}
-
-type Int struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (x *Int) Reset() {
-	*x = Int{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_write_proto_msgTypes[1]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *Int) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Int) ProtoMessage() {}
-
-func (x *Int) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_write_proto_msgTypes[1]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use Int.ProtoReflect.Descriptor instead.
-func (*Int) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_write_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *Int) GetValue() int64 {
-	if x != nil {
-		return x.Value
-	}
-	return 0
-}
-
-type StrArray struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
-}
-
-func (x *StrArray) Reset() {
-	*x = StrArray{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_write_proto_msgTypes[2]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *StrArray) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*StrArray) ProtoMessage() {}
-
-func (x *StrArray) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_write_proto_msgTypes[2]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use StrArray.ProtoReflect.Descriptor instead.
-func (*StrArray) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_write_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *StrArray) GetValue() []string {
-	if x != nil {
-		return x.Value
-	}
-	return nil
-}
-
-type IntArray struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Value []int64 `protobuf:"varint,1,rep,packed,name=value,proto3" json:"value,omitempty"`
-}
-
-func (x *IntArray) Reset() {
-	*x = IntArray{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_write_proto_msgTypes[3]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *IntArray) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*IntArray) ProtoMessage() {}
-
-func (x *IntArray) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_write_proto_msgTypes[3]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use IntArray.ProtoReflect.Descriptor instead.
-func (*IntArray) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_write_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *IntArray) GetValue() []int64 {
-	if x != nil {
-		return x.Value
-	}
-	return nil
-}
-
-type Field struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// Types that are assignable to ValueType:
-	//	*Field_Null
-	//	*Field_Str
-	//	*Field_StrArray
-	//	*Field_Int
-	//	*Field_IntArray
-	ValueType isField_ValueType `protobuf_oneof:"value_type"`
-}
-
-func (x *Field) Reset() {
-	*x = Field{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_write_proto_msgTypes[4]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *Field) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Field) ProtoMessage() {}
-
-func (x *Field) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_write_proto_msgTypes[4]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use Field.ProtoReflect.Descriptor instead.
-func (*Field) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_write_proto_rawDescGZIP(), []int{4}
-}
-
-func (m *Field) GetValueType() isField_ValueType {
-	if m != nil {
-		return m.ValueType
-	}
-	return nil
-}
-
-func (x *Field) GetNull() structpb.NullValue {
-	if x, ok := x.GetValueType().(*Field_Null); ok {
-		return x.Null
-	}
-	return structpb.NullValue(0)
-}
-
-func (x *Field) GetStr() *Str {
-	if x, ok := x.GetValueType().(*Field_Str); ok {
-		return x.Str
-	}
-	return nil
-}
-
-func (x *Field) GetStrArray() *StrArray {
-	if x, ok := x.GetValueType().(*Field_StrArray); ok {
-		return x.StrArray
-	}
-	return nil
-}
-
-func (x *Field) GetInt() *Int {
-	if x, ok := x.GetValueType().(*Field_Int); ok {
-		return x.Int
-	}
-	return nil
-}
-
-func (x *Field) GetIntArray() *IntArray {
-	if x, ok := x.GetValueType().(*Field_IntArray); ok {
-		return x.IntArray
-	}
-	return nil
-}
-
-type isField_ValueType interface {
-	isField_ValueType()
-}
-
-type Field_Null struct {
-	Null structpb.NullValue `protobuf:"varint,1,opt,name=null,proto3,enum=google.protobuf.NullValue,oneof"`
-}
-
-type Field_Str struct {
-	Str *Str `protobuf:"bytes,2,opt,name=str,proto3,oneof"`
-}
-
-type Field_StrArray struct {
-	StrArray *StrArray `protobuf:"bytes,3,opt,name=str_array,json=strArray,proto3,oneof"`
-}
-
-type Field_Int struct {
-	Int *Int `protobuf:"bytes,4,opt,name=int,proto3,oneof"`
-}
-
-type Field_IntArray struct {
-	IntArray *IntArray `protobuf:"bytes,5,opt,name=int_array,json=intArray,proto3,oneof"`
-}
-
-func (*Field_Null) isField_ValueType() {}
-
-func (*Field_Str) isField_ValueType() {}
-
-func (*Field_StrArray) isField_ValueType() {}
-
-func (*Field_Int) isField_ValueType() {}
-
-func (*Field_IntArray) isField_ValueType() {}
-
-type EntityValue struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// entity_id could be span_id of a Span or segment_id of a Segment in the context of Trace
-	EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
-	// timestamp_nanoseconds is in the timeunit of nanoseconds. It represents
-	// 1) either the start time of a Span/Segment,
-	// 2) or the timestamp of a log
-	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
-	// binary representation of segments, including tags, spans...
-	DataBinary []byte `protobuf:"bytes,3,opt,name=data_binary,json=dataBinary,proto3" json:"data_binary,omitempty"`
-	// support all of indexed fields in the fields.
-	// Field only has value, as the value of value_type match with the key
-	// by the index rules and index rule bindings of Metadata group.
-	// indexed fields of multiple entities are compression in the fields.
-	Fields []*Field `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
-}
-
-func (x *EntityValue) Reset() {
-	*x = EntityValue{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_write_proto_msgTypes[5]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *EntityValue) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*EntityValue) ProtoMessage() {}
-
-func (x *EntityValue) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_write_proto_msgTypes[5]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use EntityValue.ProtoReflect.Descriptor instead.
-func (*EntityValue) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_write_proto_rawDescGZIP(), []int{5}
-}
-
-func (x *EntityValue) GetEntityId() string {
-	if x != nil {
-		return x.EntityId
-	}
-	return ""
-}
-
-func (x *EntityValue) GetTimestamp() *timestamppb.Timestamp {
-	if x != nil {
-		return x.Timestamp
-	}
-	return nil
-}
-
-func (x *EntityValue) GetDataBinary() []byte {
-	if x != nil {
-		return x.DataBinary
-	}
-	return nil
-}
-
-func (x *EntityValue) GetFields() []*Field {
-	if x != nil {
-		return x.Fields
-	}
-	return nil
-}
-
-type WriteRequest struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// the metadata is only required in the first write.
-	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
-	// the entity is required.
-	Entity *EntityValue `protobuf:"bytes,2,opt,name=entity,proto3" json:"entity,omitempty"`
-}
-
-func (x *WriteRequest) Reset() {
-	*x = WriteRequest{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_write_proto_msgTypes[6]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *WriteRequest) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*WriteRequest) ProtoMessage() {}
-
-func (x *WriteRequest) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_write_proto_msgTypes[6]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead.
-func (*WriteRequest) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_write_proto_rawDescGZIP(), []int{6}
-}
-
-func (x *WriteRequest) GetMetadata() *Metadata {
-	if x != nil {
-		return x.Metadata
-	}
-	return nil
-}
-
-func (x *WriteRequest) GetEntity() *EntityValue {
-	if x != nil {
-		return x.Entity
-	}
-	return nil
-}
-
-type WriteResponse struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-}
-
-func (x *WriteResponse) Reset() {
-	*x = WriteResponse{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_v1_write_proto_msgTypes[7]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *WriteResponse) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*WriteResponse) ProtoMessage() {}
-
-func (x *WriteResponse) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_v1_write_proto_msgTypes[7]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead.
-func (*WriteResponse) Descriptor() ([]byte, []int) {
-	return file_banyandb_v1_write_proto_rawDescGZIP(), []int{7}
-}
-
-var File_banyandb_v1_write_proto protoreflect.FileDescriptor
-
-var file_banyandb_v1_write_proto_rawDesc = []byte{
-	0x0a, 0x17, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x72,
-	0x69, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x61, 0x6e, 0x79, 0x61,
-	0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
-	0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f,
-	0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x22, 0x1b, 0x0a, 0x03, 0x53, 0x74, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
-	0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x1b,
-	0x0a, 0x03, 0x49, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x20, 0x0a, 0x08, 0x53,
-	0x74, 0x72, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
-	0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x20, 0x0a,
-	0x08, 0x49, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
-	0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22,
-	0xff, 0x01, 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x75, 0x6c,
-	0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
-	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61,
-	0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x75, 0x6c, 0x6c, 0x12, 0x24, 0x0a, 0x03, 0x73,
-	0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
-	0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x48, 0x00, 0x52, 0x03, 0x73, 0x74,
-	0x72, 0x12, 0x34, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x03,
-	0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
-	0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x08, 0x73,
-	0x74, 0x72, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x24, 0x0a, 0x03, 0x69, 0x6e, 0x74, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
-	0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x69, 0x6e, 0x74, 0x12, 0x34, 0x0a,
-	0x09, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
-	0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x49,
-	0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x41, 0x72,
-	0x72, 0x61, 0x79, 0x42, 0x0c, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x74, 0x79, 0x70,
-	0x65, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75,
-	0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x38,
-	0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
-	0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74,
-	0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61,
-	0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x64,
-	0x61, 0x74, 0x61, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x2a, 0x0a, 0x06, 0x66, 0x69, 0x65,
-	0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x61, 0x6e, 0x79,
-	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66,
-	0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x73, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65,
-	0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
-	0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
-	0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08,
-	0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69,
-	0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61,
-	0x6e, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x61, 0x6c,
-	0x75, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x0f, 0x0a, 0x0d, 0x57, 0x72,
-	0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x60, 0x0a, 0x1e, 0x6f,
-	0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c,
-	0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x5a, 0x3e, 0x67,
-	0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65,
-	0x2f, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79,
-	0x61, 0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62,
-	0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var (
-	file_banyandb_v1_write_proto_rawDescOnce sync.Once
-	file_banyandb_v1_write_proto_rawDescData = file_banyandb_v1_write_proto_rawDesc
-)
-
-func file_banyandb_v1_write_proto_rawDescGZIP() []byte {
-	file_banyandb_v1_write_proto_rawDescOnce.Do(func() {
-		file_banyandb_v1_write_proto_rawDescData = protoimpl.X.CompressGZIP(file_banyandb_v1_write_proto_rawDescData)
-	})
-	return file_banyandb_v1_write_proto_rawDescData
-}
-
-var file_banyandb_v1_write_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
-var file_banyandb_v1_write_proto_goTypes = []interface{}{
-	(*Str)(nil),                   // 0: banyandb.v1.Str
-	(*Int)(nil),                   // 1: banyandb.v1.Int
-	(*StrArray)(nil),              // 2: banyandb.v1.StrArray
-	(*IntArray)(nil),              // 3: banyandb.v1.IntArray
-	(*Field)(nil),                 // 4: banyandb.v1.Field
-	(*EntityValue)(nil),           // 5: banyandb.v1.EntityValue
-	(*WriteRequest)(nil),          // 6: banyandb.v1.WriteRequest
-	(*WriteResponse)(nil),         // 7: banyandb.v1.WriteResponse
-	(structpb.NullValue)(0),       // 8: google.protobuf.NullValue
-	(*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
-	(*Metadata)(nil),              // 10: banyandb.v1.Metadata
-}
-var file_banyandb_v1_write_proto_depIdxs = []int32{
-	8,  // 0: banyandb.v1.Field.null:type_name -> google.protobuf.NullValue
-	0,  // 1: banyandb.v1.Field.str:type_name -> banyandb.v1.Str
-	2,  // 2: banyandb.v1.Field.str_array:type_name -> banyandb.v1.StrArray
-	1,  // 3: banyandb.v1.Field.int:type_name -> banyandb.v1.Int
-	3,  // 4: banyandb.v1.Field.int_array:type_name -> banyandb.v1.IntArray
-	9,  // 5: banyandb.v1.EntityValue.timestamp:type_name -> google.protobuf.Timestamp
-	4,  // 6: banyandb.v1.EntityValue.fields:type_name -> banyandb.v1.Field
-	10, // 7: banyandb.v1.WriteRequest.metadata:type_name -> banyandb.v1.Metadata
-	5,  // 8: banyandb.v1.WriteRequest.entity:type_name -> banyandb.v1.EntityValue
-	9,  // [9:9] is the sub-list for method output_type
-	9,  // [9:9] is the sub-list for method input_type
-	9,  // [9:9] is the sub-list for extension type_name
-	9,  // [9:9] is the sub-list for extension extendee
-	0,  // [0:9] is the sub-list for field type_name
-}
-
-func init() { file_banyandb_v1_write_proto_init() }
-func file_banyandb_v1_write_proto_init() {
-	if File_banyandb_v1_write_proto != nil {
-		return
-	}
-	file_banyandb_v1_database_proto_init()
-	if !protoimpl.UnsafeEnabled {
-		file_banyandb_v1_write_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Str); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_write_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Int); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_write_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*StrArray); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_write_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*IntArray); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_write_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Field); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_write_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*EntityValue); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_write_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*WriteRequest); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_banyandb_v1_write_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*WriteResponse); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-	}
-	file_banyandb_v1_write_proto_msgTypes[4].OneofWrappers = []interface{}{
-		(*Field_Null)(nil),
-		(*Field_Str)(nil),
-		(*Field_StrArray)(nil),
-		(*Field_Int)(nil),
-		(*Field_IntArray)(nil),
-	}
-	type x struct{}
-	out := protoimpl.TypeBuilder{
-		File: protoimpl.DescBuilder{
-			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
-			RawDescriptor: file_banyandb_v1_write_proto_rawDesc,
-			NumEnums:      0,
-			NumMessages:   8,
-			NumExtensions: 0,
-			NumServices:   0,
-		},
-		GoTypes:           file_banyandb_v1_write_proto_goTypes,
-		DependencyIndexes: file_banyandb_v1_write_proto_depIdxs,
-		MessageInfos:      file_banyandb_v1_write_proto_msgTypes,
-	}.Build()
-	File_banyandb_v1_write_proto = out.File
-	file_banyandb_v1_write_proto_rawDesc = nil
-	file_banyandb_v1_write_proto_goTypes = nil
-	file_banyandb_v1_write_proto_depIdxs = nil
-}
diff --git a/api/schema/index.go b/api/schema/index.go
index b3ef8a3..adaa8ca 100644
--- a/api/schema/index.go
+++ b/api/schema/index.go
@@ -19,7 +19,7 @@ package schema
 
 import (
 	"github.com/apache/skywalking-banyandb/api/common"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 )
 
 var IndexRuleKindVersion = common.KindVersion{Version: "v1", Kind: "schema-index-rule"}
diff --git a/api/schema/series.go b/api/schema/series.go
index 6151c28..e75a4cf 100644
--- a/api/schema/series.go
+++ b/api/schema/series.go
@@ -19,7 +19,7 @@ package schema
 
 import (
 	"github.com/apache/skywalking-banyandb/api/common"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 )
 
 var SeriesKindVersion = common.KindVersion{Version: "v1", Kind: "schema-series"}
diff --git a/banyand/index/index.go b/banyand/index/index.go
index 98a049a..262c665 100644
--- a/banyand/index/index.go
+++ b/banyand/index/index.go
@@ -26,7 +26,9 @@ import (
 
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/event"
-	apiv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	commonv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+	databasev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
+	modelv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1"
 	"github.com/apache/skywalking-banyandb/banyand/discovery"
 	"github.com/apache/skywalking-banyandb/banyand/index/tsdb"
 	"github.com/apache/skywalking-banyandb/pkg/bus"
@@ -43,7 +45,7 @@ var (
 type Condition struct {
 	Key    string
 	Values [][]byte
-	Op     apiv1.PairQuery_BinaryOp
+	Op     modelv1.PairQuery_BinaryOp
 }
 
 type Field struct {
@@ -66,7 +68,7 @@ type Builder interface {
 type ReadyOption func(map[string]*series) bool
 
 func MetaExists(group, name string) ReadyOption {
-	seriesID := &apiv1.Metadata{
+	seriesID := &commonv1.Metadata{
 		Name:  "sw",
 		Group: "default",
 	}
@@ -89,7 +91,7 @@ type series struct {
 }
 
 type shard struct {
-	meta  map[string][]*apiv1.IndexObject
+	meta  map[string][]*databasev1.IndexObject
 	store tsdb.GlobalStore
 }
 
@@ -199,7 +201,7 @@ type indexMeta struct {
 	sync.RWMutex
 }
 
-func (i *indexMeta) get(series *apiv1.Metadata) *series {
+func (i *indexMeta) get(series *commonv1.Metadata) *series {
 	i.RWMutex.RLock()
 	defer i.RWMutex.RUnlock()
 	s, ok := i.meta[compositeSeriesID(series)]
@@ -216,20 +218,20 @@ type indexRuleListener struct {
 }
 
 func (i *indexRuleListener) Rev(message bus.Message) (resp bus.Message) {
-	indexRuleEvent, ok := message.Data().(*apiv1.IndexRuleEvent)
+	indexRuleEvent, ok := message.Data().(*databasev1.IndexRuleEvent)
 	if !ok {
 		i.log.Warn().Msg("invalid event data type")
 		return
 	}
 	i.log.Info().
-		Str("action", apiv1.Action_name[int32(indexRuleEvent.Action)]).
+		Str("action", databasev1.Action_name[int32(indexRuleEvent.Action)]).
 		Str("series-name", indexRuleEvent.Series.Name).
 		Str("series-group", indexRuleEvent.Series.Group).
 		Msg("received an index rule")
 	i.indexMeta.Lock()
 	defer i.indexMeta.Unlock()
 	switch indexRuleEvent.Action {
-	case apiv1.Action_ACTION_PUT:
+	case databasev1.Action_ACTION_PUT:
 		seriesID := compositeSeriesID(indexRuleEvent.Series)
 		newSeries := &series{
 			repo: make(map[uint]*shard),
@@ -237,7 +239,7 @@ func (i *indexRuleListener) Rev(message bus.Message) (resp bus.Message) {
 		for _, rule := range indexRuleEvent.Rules {
 			store := tsdb.NewStore(indexRuleEvent.Series.Name, indexRuleEvent.Series.Group, uint(rule.ShardId))
 			fields := make([]tsdb.FieldSpec, 0, len(rule.Rules))
-			meta := make(map[string][]*apiv1.IndexObject)
+			meta := make(map[string][]*databasev1.IndexObject)
 			for _, indexRule := range rule.GetRules() {
 				for _, object := range indexRule.Objects {
 					fieldsSize := len(object.Fields)
@@ -256,7 +258,7 @@ func (i *indexRuleListener) Rev(message bus.Message) (resp bus.Message) {
 					fields = append(fields, fieldSpec)
 					objects, existed := meta[field]
 					if !existed {
-						objects = make([]*apiv1.IndexObject, 0, 1)
+						objects = make([]*databasev1.IndexObject, 0, 1)
 					}
 					objects = append(objects, object)
 					meta[field] = objects
@@ -282,6 +284,6 @@ func compositeFieldID(indexObjectName, field string) string {
 	return indexObjectName + ":" + field
 }
 
-func compositeSeriesID(series *apiv1.Metadata) string {
+func compositeSeriesID(series *commonv1.Metadata) string {
 	return series.Name + "-" + series.Group
 }
diff --git a/banyand/index/index_test.go b/banyand/index/index_test.go
index cd09710..fde4e9f 100644
--- a/banyand/index/index_test.go
+++ b/banyand/index/index_test.go
@@ -28,7 +28,8 @@ import (
 
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/event"
-	apiv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	commonv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+	databasev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 	"github.com/apache/skywalking-banyandb/banyand/discovery"
 	"github.com/apache/skywalking-banyandb/pkg/bus"
 	"github.com/apache/skywalking-banyandb/pkg/convert"
@@ -136,9 +137,9 @@ func setUpModules(tester *assert.Assertions) *service {
 	tester.NoError(err)
 	tester.NoError(svc.PreRun())
 
-	rules := []*apiv1.IndexRule{
+	rules := []*databasev1.IndexRule{
 		{
-			Objects: []*apiv1.IndexObject{
+			Objects: []*databasev1.IndexObject{
 				{
 					Name:   "endpoint",
 					Fields: []string{"endpoint"},
@@ -150,13 +151,13 @@ func setUpModules(tester *assert.Assertions) *service {
 			},
 		},
 	}
-	seriesID := &apiv1.Metadata{
+	seriesID := &commonv1.Metadata{
 		Name:  "sw",
 		Group: "default",
 	}
-	_, err = repo.Publish(event.TopicIndexRule, bus.NewMessage(bus.MessageID(time.Now().UnixNano()), &apiv1.IndexRuleEvent{
+	_, err = repo.Publish(event.TopicIndexRule, bus.NewMessage(bus.MessageID(time.Now().UnixNano()), &databasev1.IndexRuleEvent{
 		Series: seriesID,
-		Rules: []*apiv1.IndexRuleEvent_ShardedIndexRule{
+		Rules: []*databasev1.IndexRuleEvent_ShardedIndexRule{
 			{
 				ShardId: 0,
 				Rules:   rules,
@@ -166,7 +167,7 @@ func setUpModules(tester *assert.Assertions) *service {
 				Rules:   rules,
 			},
 		},
-		Action: apiv1.Action_ACTION_PUT,
+		Action: databasev1.Action_ACTION_PUT,
 		Time:   timestamppb.Now(),
 	}))
 	tester.NoError(err)
diff --git a/banyand/index/search.go b/banyand/index/search.go
index 97da458..d25ad88 100644
--- a/banyand/index/search.go
+++ b/banyand/index/search.go
@@ -25,7 +25,7 @@ import (
 	"github.com/pkg/errors"
 
 	"github.com/apache/skywalking-banyandb/api/common"
-	apiv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	modelv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1"
 	"github.com/apache/skywalking-banyandb/banyand/index/tsdb"
 	"github.com/apache/skywalking-banyandb/pkg/bytes"
 	"github.com/apache/skywalking-banyandb/pkg/posting"
@@ -85,30 +85,30 @@ func buildSearchTree(searcher tsdb.Searcher, indexObject string, conditions []Co
 				}
 				opts := rangeLeaf.Opts
 				switch cond.Op {
-				case apiv1.PairQuery_BINARY_OP_GT:
+				case modelv1.PairQuery_BINARY_OP_GT:
 					opts.Lower = bytes.Join(cond.Values...)
-				case apiv1.PairQuery_BINARY_OP_GE:
+				case modelv1.PairQuery_BINARY_OP_GE:
 					opts.Lower = bytes.Join(cond.Values...)
 					opts.IncludesLower = true
-				case apiv1.PairQuery_BINARY_OP_LT:
+				case modelv1.PairQuery_BINARY_OP_LT:
 					opts.Upper = bytes.Join(cond.Values...)
-				case apiv1.PairQuery_BINARY_OP_LE:
+				case modelv1.PairQuery_BINARY_OP_LE:
 					opts.Upper = bytes.Join(cond.Values...)
 					opts.IncludesUpper = true
 				}
 				continue
 			}
 			switch cond.Op {
-			case apiv1.PairQuery_BINARY_OP_EQ:
+			case modelv1.PairQuery_BINARY_OP_EQ:
 				root.addEq(key, cond.Values)
-			case apiv1.PairQuery_BINARY_OP_NE:
+			case modelv1.PairQuery_BINARY_OP_NE:
 				root.addNot(key, root.newEq(key, cond.Values))
-			case apiv1.PairQuery_BINARY_OP_HAVING:
+			case modelv1.PairQuery_BINARY_OP_HAVING:
 				n := root.addOrNode(len(cond.Values))
 				for _, v := range cond.Values {
 					n.addEq(key, [][]byte{v})
 				}
-			case apiv1.PairQuery_BINARY_OP_NOT_HAVING:
+			case modelv1.PairQuery_BINARY_OP_NOT_HAVING:
 				n := root.newOrNode(len(cond.Values))
 				for _, v := range cond.Values {
 					n.addEq(key, [][]byte{v})
@@ -120,12 +120,12 @@ func buildSearchTree(searcher tsdb.Searcher, indexObject string, conditions []Co
 	return root, nil
 }
 
-func rangeOP(op apiv1.PairQuery_BinaryOp) bool {
+func rangeOP(op modelv1.PairQuery_BinaryOp) bool {
 	switch op {
-	case apiv1.PairQuery_BINARY_OP_GT,
-		apiv1.PairQuery_BINARY_OP_GE,
-		apiv1.PairQuery_BINARY_OP_LT,
-		apiv1.PairQuery_BINARY_OP_LE:
+	case modelv1.PairQuery_BINARY_OP_GT,
+		modelv1.PairQuery_BINARY_OP_GE,
+		modelv1.PairQuery_BINARY_OP_LT,
+		modelv1.PairQuery_BINARY_OP_LE:
 		return true
 	}
 	return false
diff --git a/banyand/index/search_test.go b/banyand/index/search_test.go
index d9eb8d9..8423cec 100644
--- a/banyand/index/search_test.go
+++ b/banyand/index/search_test.go
@@ -24,7 +24,7 @@ import (
 	"github.com/stretchr/testify/assert"
 
 	"github.com/apache/skywalking-banyandb/api/common"
-	apiv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	modelv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1"
 	"github.com/apache/skywalking-banyandb/pkg/convert"
 	"github.com/apache/skywalking-banyandb/pkg/posting"
 	"github.com/apache/skywalking-banyandb/pkg/posting/roaring"
@@ -49,7 +49,7 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "endpoint",
-						Op:     apiv1.PairQuery_BINARY_OP_EQ,
+						Op:     modelv1.PairQuery_BINARY_OP_EQ,
 						Values: [][]byte{[]byte("/product")},
 					},
 				},
@@ -63,7 +63,7 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "endpoint",
-						Op:     apiv1.PairQuery_BINARY_OP_NE,
+						Op:     modelv1.PairQuery_BINARY_OP_NE,
 						Values: [][]byte{[]byte("/product")},
 					},
 				},
@@ -77,7 +77,7 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "endpoint",
-						Op:     apiv1.PairQuery_BINARY_OP_HAVING,
+						Op:     modelv1.PairQuery_BINARY_OP_HAVING,
 						Values: [][]byte{[]byte("/product"), []byte("/sales")},
 					},
 				},
@@ -91,7 +91,7 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "endpoint",
-						Op:     apiv1.PairQuery_BINARY_OP_NOT_HAVING,
+						Op:     modelv1.PairQuery_BINARY_OP_NOT_HAVING,
 						Values: [][]byte{[]byte("/product"), []byte("/sales")},
 					},
 				},
@@ -105,7 +105,7 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "duration",
-						Op:     apiv1.PairQuery_BINARY_OP_EQ,
+						Op:     modelv1.PairQuery_BINARY_OP_EQ,
 						Values: [][]byte{convert.Int64ToBytes(500)},
 					},
 				},
@@ -119,7 +119,7 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "duration",
-						Op:     apiv1.PairQuery_BINARY_OP_NE,
+						Op:     modelv1.PairQuery_BINARY_OP_NE,
 						Values: [][]byte{convert.Int64ToBytes(500)},
 					},
 				},
@@ -133,7 +133,7 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "duration",
-						Op:     apiv1.PairQuery_BINARY_OP_HAVING,
+						Op:     modelv1.PairQuery_BINARY_OP_HAVING,
 						Values: [][]byte{convert.Int64ToBytes(500), convert.Int64ToBytes(50)},
 					},
 				},
@@ -147,7 +147,7 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "duration",
-						Op:     apiv1.PairQuery_BINARY_OP_NOT_HAVING,
+						Op:     modelv1.PairQuery_BINARY_OP_NOT_HAVING,
 						Values: [][]byte{convert.Int64ToBytes(500), convert.Int64ToBytes(50)},
 					},
 				},
@@ -161,12 +161,12 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "duration",
-						Op:     apiv1.PairQuery_BINARY_OP_GT,
+						Op:     modelv1.PairQuery_BINARY_OP_GT,
 						Values: [][]byte{convert.Int64ToBytes(50)},
 					},
 					{
 						Key:    "duration",
-						Op:     apiv1.PairQuery_BINARY_OP_LT,
+						Op:     modelv1.PairQuery_BINARY_OP_LT,
 						Values: [][]byte{convert.Int64ToBytes(5000)},
 					},
 				},
@@ -180,12 +180,12 @@ func Test_service_Search(t *testing.T) {
 				conditions: []Condition{
 					{
 						Key:    "duration",
-						Op:     apiv1.PairQuery_BINARY_OP_GE,
+						Op:     modelv1.PairQuery_BINARY_OP_GE,
 						Values: [][]byte{convert.Int64ToBytes(50)},
 					},
 					{
 						Key:    "duration",
-						Op:     apiv1.PairQuery_BINARY_OP_LE,
+						Op:     modelv1.PairQuery_BINARY_OP_LE,
 						Values: [][]byte{convert.Int64ToBytes(5000)},
 					},
 				},
diff --git a/banyand/liaison/grpc/data/server_cert.pem b/banyand/liaison/grpc/testdata/server_cert.pem
similarity index 100%
rename from banyand/liaison/grpc/data/server_cert.pem
rename to banyand/liaison/grpc/testdata/server_cert.pem
diff --git a/banyand/liaison/grpc/data/server_key.pem b/banyand/liaison/grpc/testdata/server_key.pem
similarity index 100%
rename from banyand/liaison/grpc/data/server_key.pem
rename to banyand/liaison/grpc/testdata/server_key.pem
diff --git a/banyand/liaison/grpc/grpc.go b/banyand/liaison/grpc/trace.go
similarity index 56%
rename from banyand/liaison/grpc/grpc.go
rename to banyand/liaison/grpc/trace.go
index 2ea2623..9ee1f35 100644
--- a/banyand/liaison/grpc/grpc.go
+++ b/banyand/liaison/grpc/trace.go
@@ -19,12 +19,9 @@ package grpc
 
 import (
 	"context"
-	"fmt"
 	"io"
 	"net"
-	"path/filepath"
-	"runtime"
-	"strings"
+	"strconv"
 	"sync"
 	"time"
 
@@ -35,7 +32,9 @@ import (
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/data"
 	"github.com/apache/skywalking-banyandb/api/event"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	databasev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
+	modelv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1"
+	tracev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1"
 	apischema "github.com/apache/skywalking-banyandb/api/schema"
 	"github.com/apache/skywalking-banyandb/banyand/discovery"
 	"github.com/apache/skywalking-banyandb/banyand/queue"
@@ -55,12 +54,14 @@ var (
 	ErrServerKey       = errors.New("invalid server key file")
 	ErrNoAddr          = errors.New("no address")
 	ErrQueryMsg        = errors.New("invalid query message")
+
+	defaultRecvSize = 1024 * 1024 * 10
 )
 
 type Server struct {
 	addr           string
 	maxRecvMsgSize int
-	tlsVal         bool
+	tls            bool
 	certFile       string
 	keyFile        string
 	log            *logger.Logger
@@ -69,90 +70,102 @@ type Server struct {
 	repo           discovery.ServiceRepo
 	shardInfo      *shardInfo
 	seriesInfo     *seriesInfo
-	v1.UnimplementedTraceServiceServer
+	tracev1.UnimplementedTraceServiceServer
+	creds credentials.TransportCredentials
 }
 
 type shardInfo struct {
-	log        *logger.Logger
-	shardEvent *shardEvent
+	log            *logger.Logger
+	shardEventsMap map[string]uint32
+	sync.RWMutex
 }
 
 func (s *shardInfo) Rev(message bus.Message) (resp bus.Message) {
-	event, ok := message.Data().(*v1.ShardEvent)
+	e, ok := message.Data().(*databasev1.ShardEvent)
 	if !ok {
-		s.log.Warn().Msg("invalid event data type")
+		s.log.Warn().Msg("invalid e data type")
 		return
 	}
-	s.shardEvent.setShardEvents(event)
+	s.setShardNum(e)
 	s.log.Info().
-		Str("action", v1.Action_name[int32(event.Action)]).
-		Uint64("shardID", event.Shard.Id).
-		Msg("received a shard event")
+		Str("action", databasev1.Action_name[int32(e.Action)]).
+		Uint64("shardID", e.Shard.Id).
+		Msg("received a shard e")
 	return
 }
 
-type shardEvent struct {
-	shardEventsMap map[string]*v1.ShardEvent
-	sync.RWMutex
-}
-
-func (s *shardEvent) setShardEvents(eventVal *v1.ShardEvent) {
+func (s *shardInfo) setShardNum(eventVal *databasev1.ShardEvent) {
 	s.RWMutex.Lock()
 	defer s.RWMutex.Unlock()
 	idx := eventVal.Shard.Series.GetName() + "-" + eventVal.Shard.Series.GetGroup()
-	if eventVal.Action == v1.Action_ACTION_PUT {
-		s.shardEventsMap[idx] = eventVal
-	} else if eventVal.Action == v1.Action_ACTION_DELETE {
+	if eventVal.Action == databasev1.Action_ACTION_PUT {
+		s.shardEventsMap[idx] = eventVal.Shard.Total
+	} else if eventVal.Action == databasev1.Action_ACTION_DELETE {
 		delete(s.shardEventsMap, idx)
 	}
 }
 
-func (s *shardEvent) getShardEvent(idx string) *v1.ShardEvent {
+func (s *shardInfo) shardNum(idx string) uint32 {
 	s.RWMutex.RLock()
 	defer s.RWMutex.RUnlock()
 	return s.shardEventsMap[idx]
 }
 
 type seriesInfo struct {
-	log         *logger.Logger
-	seriesEvent *seriesEvent
+	log             *logger.Logger
+	seriesEventsMap map[string][]int
+	sync.RWMutex
 }
 
 func (s *seriesInfo) Rev(message bus.Message) (resp bus.Message) {
-	event, ok := message.Data().(*v1.SeriesEvent)
+	e, ok := message.Data().(*databasev1.SeriesEvent)
 	if !ok {
-		s.log.Warn().Msg("invalid event data type")
+		s.log.Warn().Msg("invalid e data type")
 		return
 	}
-	s.seriesEvent.setSeriesEvents(event)
+	s.updateFieldIndexCompositeSeriesID(e)
 	s.log.Info().
-		Str("action", v1.Action_name[int32(event.Action)]).
-		Str("name", event.Series.Name).
-		Str("group", event.Series.Group).
-		Msg("received a shard event")
+		Str("action", databasev1.Action_name[int32(e.Action)]).
+		Str("name", e.Series.Name).
+		Str("group", e.Series.Group).
+		Msg("received a shard e")
 	return
 }
 
-type seriesEvent struct {
-	seriesEventsMap map[string]*v1.SeriesEvent
-	sync.RWMutex
-}
-
-func (s *seriesEvent) setSeriesEvents(seriesEventVal *v1.SeriesEvent) {
+func (s *seriesInfo) updateFieldIndexCompositeSeriesID(seriesEventVal *databasev1.SeriesEvent) {
 	s.RWMutex.Lock()
 	defer s.RWMutex.Unlock()
 	str := seriesEventVal.Series.GetName() + "-" + seriesEventVal.Series.GetGroup()
-	if seriesEventVal.Action == v1.Action_ACTION_PUT {
-		s.seriesEventsMap[str] = seriesEventVal
-	} else if seriesEventVal.Action == v1.Action_ACTION_DELETE {
+	if seriesEventVal.Action == databasev1.Action_ACTION_PUT {
+		ana := logical.DefaultAnalyzer()
+		metadata := common.Metadata{
+			KindVersion: apischema.SeriesKindVersion,
+			Spec:        seriesEventVal.Series,
+		}
+		schema, err := ana.BuildTraceSchema(context.TODO(), metadata)
+		if err != nil {
+			s.log.Err(err).Msg("build trace schema")
+			return
+		}
+		fieldRefs, errField := schema.CreateRef(seriesEventVal.FieldNamesCompositeSeriesId...)
+		if errField != nil {
+			s.log.Err(errField).Msg("create series ref")
+			return
+		}
+		refIdx := make([]int, len(fieldRefs))
+		for i, ref := range fieldRefs {
+			refIdx[i] = ref.Spec.Idx
+		}
+		s.seriesEventsMap[str] = refIdx
+	} else if seriesEventVal.Action == databasev1.Action_ACTION_DELETE {
 		delete(s.seriesEventsMap, str)
 	}
 }
 
-func (s *seriesEvent) getSeriesEvent(idx string) *v1.SeriesEvent {
+func (s *seriesInfo) FieldIndexCompositeSeriesID(seriesMeta string) []int {
 	s.RWMutex.RLock()
 	defer s.RWMutex.RUnlock()
-	return s.seriesEventsMap[idx]
+	return s.seriesEventsMap[seriesMeta]
 }
 
 func (s *Server) PreRun() error {
@@ -166,12 +179,12 @@ func (s *Server) PreRun() error {
 	return s.repo.Subscribe(event.TopicSeriesEvent, s.seriesInfo)
 }
 
-func NewServer(ctx context.Context, pipeline queue.Queue, repo discovery.ServiceRepo) *Server {
+func NewServer(_ context.Context, pipeline queue.Queue, repo discovery.ServiceRepo) *Server {
 	return &Server{
 		pipeline:   pipeline,
 		repo:       repo,
-		shardInfo:  &shardInfo{shardEvent: &shardEvent{shardEventsMap: map[string]*v1.ShardEvent{}}},
-		seriesInfo: &seriesInfo{seriesEvent: &seriesEvent{seriesEventsMap: map[string]*v1.SeriesEvent{}}},
+		shardInfo:  &shardInfo{shardEventsMap: make(map[string]uint32)},
+		seriesInfo: &seriesInfo{seriesEventsMap: make(map[string][]int)},
 	}
 }
 
@@ -180,19 +193,12 @@ func (s *Server) Name() string {
 }
 
 func (s *Server) FlagSet() *run.FlagSet {
-	size := 1024 * 1024 * 10
-	_, currentFile, _, _ := runtime.Caller(0)
-	basePath := filepath.Dir(currentFile)
-	serverCert := filepath.Join(basePath, "data/server_cert.pem")
-	serverKey := filepath.Join(basePath, "data/server_key.pem")
-
 	fs := run.NewFlagSet("grpc")
-	fs.IntVarP(&s.maxRecvMsgSize, "maxRecvMsgSize", "", size, "The size of max receiving message")
-	fs.BoolVarP(&s.tlsVal, "tlsVal", "", true, "Connection uses TLS if true, else plain TCP")
-	fs.StringVarP(&s.certFile, "certFile", "", serverCert, "The TLS cert file")
-	fs.StringVarP(&s.keyFile, "keyFile", "", serverKey, "The TLS key file")
+	fs.IntVarP(&s.maxRecvMsgSize, "max-recv-msg-size", "", defaultRecvSize, "The size of max receiving message")
+	fs.BoolVarP(&s.tls, "tls", "", true, "Connection uses TLS if true, else plain TCP")
+	fs.StringVarP(&s.certFile, "cert-file", "", "server_cert.pem", "The TLS cert file")
+	fs.StringVarP(&s.keyFile, "key-file", "", "server_key.pem", "The TLS key file")
 	fs.StringVarP(&s.addr, "addr", "", ":17912", "The address of banyand listens")
-
 	return fs
 }
 
@@ -200,18 +206,20 @@ func (s *Server) Validate() error {
 	if s.addr == "" {
 		return ErrNoAddr
 	}
-	if s.tlsVal {
-		if s.certFile == "" {
-			return ErrServerCert
-		}
-		if s.keyFile == "" {
-			return ErrServerKey
-		}
-		_, errTLS := credentials.NewServerTLSFromFile(s.certFile, s.keyFile)
-		if errTLS != nil {
-			return errTLS
-		}
+	if !s.tls {
+		return nil
+	}
+	if s.certFile == "" {
+		return ErrServerCert
+	}
+	if s.keyFile == "" {
+		return ErrServerKey
+	}
+	creds, errTLS := credentials.NewServerTLSFromFile(s.certFile, s.keyFile)
+	if errTLS != nil {
+		return errTLS
 	}
+	s.creds = creds
 	return nil
 }
 
@@ -224,13 +232,12 @@ func (s *Server) Serve() error {
 		s.log.Fatal().Err(errValidate).Msg("Failed to validate data")
 	}
 	var opts []grpclib.ServerOption
-	if s.tlsVal {
-		creds, _ := credentials.NewServerTLSFromFile(s.certFile, s.keyFile)
-		opts = []grpclib.ServerOption{grpclib.Creds(creds)}
+	if s.tls {
+		opts = []grpclib.ServerOption{grpclib.Creds(s.creds)}
 	}
 	opts = append(opts, grpclib.MaxRecvMsgSize(s.maxRecvMsgSize))
 	s.ser = grpclib.NewServer(opts...)
-	v1.RegisterTraceServiceServer(s.ser, s)
+	tracev1.RegisterTraceServiceServer(s.ser, s)
 
 	return s.ser.Serve(lis)
 }
@@ -240,72 +247,52 @@ func (s *Server) GracefulStop() {
 	s.ser.GracefulStop()
 }
 
-func (s *Server) computeSeriesID(writeEntity *v1.WriteRequest, mapIndexName string) (SeriesID []byte, err error) {
-	ana := logical.DefaultAnalyzer()
-	metadata := common.Metadata{
-		KindVersion: apischema.SeriesKindVersion,
-		Spec:        writeEntity.GetMetadata(),
-	}
-	schema, ruleError := ana.BuildTraceSchema(context.TODO(), metadata)
-	if ruleError != nil {
-		return nil, ruleError
-	}
-	seriesEventVal := s.seriesInfo.seriesEvent.getSeriesEvent(mapIndexName)
-	if seriesEventVal == nil {
+func (s *Server) computeSeriesID(writeEntity *tracev1.WriteRequest, mapIndexName string) ([]byte, error) {
+	fieldNames := s.seriesInfo.FieldIndexCompositeSeriesID(mapIndexName)
+	if fieldNames == nil {
 		return nil, ErrSeriesEvents
 	}
 	var str string
-	var arr []string
-	fieldRefs, errField := schema.CreateRef(seriesEventVal.FieldNamesCompositeSeriesId...)
-	if errField != nil {
-		return nil, errField
-	}
-	for _, ref := range fieldRefs {
-		field := writeEntity.GetEntity().GetFields()[ref.Spec.Idx]
+	for _, ref := range fieldNames {
+		field := writeEntity.GetEntity().GetFields()[ref]
 		switch v := field.GetValueType().(type) {
-		case *v1.Field_StrArray:
+		case *modelv1.Field_StrArray:
 			for j := 0; j < len(v.StrArray.Value); j++ {
-				arr = append(arr, v.StrArray.Value[j])
+				str = str + v.StrArray.Value[j]
 			}
-		case *v1.Field_IntArray:
+		case *modelv1.Field_IntArray:
 			for t := 0; t < len(v.IntArray.Value); t++ {
-				arr = append(arr, fmt.Sprint(v.IntArray.Value[t]))
+				str = str + strconv.FormatInt(v.IntArray.Value[t], 10)
 			}
-		case *v1.Field_Int:
-			arr = append(arr, fmt.Sprint(v.Int.Value))
-		case *v1.Field_Str:
-			arr = append(arr, fmt.Sprint(v.Str.Value))
+		case *modelv1.Field_Int:
+			str = str + strconv.FormatInt(v.Int.Value, 10)
+		case *modelv1.Field_Str:
+			str = str + v.Str.Value
 		}
+		str = str + ":"
 	}
-	str = strings.Join(arr, "")
 	if str == "" {
 		return nil, ErrInvalidSeriesID
 	}
-	seriesID := []byte(str)
 
-	return seriesID, nil
+	return []byte(str), nil
 }
 
-func (s *Server) computeShardID(seriesID []byte, mapIndexName string) (shardID uint, err error) {
-	shardEventVal := s.shardInfo.shardEvent.getShardEvent(mapIndexName)
-	if shardEventVal == nil {
-		return 0, ErrShardEvents
-	}
-	shardNum := shardEventVal.GetShard().GetId()
+func (s *Server) computeShardID(seriesID []byte, mapIndexName string) (uint, error) {
+	shardNum := s.shardInfo.shardNum(mapIndexName)
 	if shardNum < 1 {
-		shardNum = 1
+		return 0, ErrShardEvents
 	}
-	shardID, shardIDError := partition.ShardID(seriesID, uint32(shardNum))
+	shardID, shardIDError := partition.ShardID(seriesID, shardNum)
 	if shardIDError != nil {
 		return 0, shardIDError
 	}
-
 	return shardID, nil
 }
 
-func (s *Server) Write(TraceWriteServer v1.TraceService_WriteServer) error {
+func (s *Server) Write(stream tracev1.TraceService_WriteServer) error {
 	for {
-		writeEntity, err := TraceWriteServer.Recv()
+		writeEntity, err := stream.Recv()
 		if err == io.EOF {
 			return nil
 		}
@@ -327,13 +314,13 @@ func (s *Server) Write(TraceWriteServer v1.TraceService_WriteServer) error {
 		if errWritePub != nil {
 			return errWritePub
 		}
-		if errSend := TraceWriteServer.Send(&v1.WriteResponse{}); errSend != nil {
+		if errSend := stream.Send(&tracev1.WriteResponse{}); errSend != nil {
 			return errSend
 		}
 	}
 }
 
-func (s *Server) Query(ctx context.Context, entityCriteria *v1.QueryRequest) (*v1.QueryResponse, error) {
+func (s *Server) Query(_ context.Context, entityCriteria *tracev1.QueryRequest) (*tracev1.QueryResponse, error) {
 	message := bus.NewMessage(bus.MessageID(time.Now().UnixNano()), entityCriteria)
 	feat, errQuery := s.pipeline.Publish(data.TopicQueryEvent, message)
 	if errQuery != nil {
@@ -347,14 +334,14 @@ func (s *Server) Query(ctx context.Context, entityCriteria *v1.QueryRequest) (*v
 	if !ok {
 		return nil, ErrQueryMsg
 	}
-	var arr []*v1.Entity
+	var arr []*tracev1.Entity
 	for i := 0; i < len(queryMsg); i++ {
 		arr = append(arr, queryMsg[i].Entity)
 	}
 
-	return &v1.QueryResponse{Entities: arr}, nil
+	return &tracev1.QueryResponse{Entities: arr}, nil
 }
 
-func assemblyWriteData(shardID uint, writeEntity *v1.WriteRequest, seriesID uint64) data.TraceWriteDate {
+func assemblyWriteData(shardID uint, writeEntity *tracev1.WriteRequest, seriesID uint64) data.TraceWriteDate {
 	return data.TraceWriteDate{ShardID: shardID, SeriesID: seriesID, WriteRequest: writeEntity}
 }
diff --git a/banyand/liaison/grpc/grpc_test.go b/banyand/liaison/grpc/trace_test.go
similarity index 90%
rename from banyand/liaison/grpc/grpc_test.go
rename to banyand/liaison/grpc/trace_test.go
index 7b13bdd..84a2830 100644
--- a/banyand/liaison/grpc/grpc_test.go
+++ b/banyand/liaison/grpc/trace_test.go
@@ -33,7 +33,7 @@ import (
 	grpclib "google.golang.org/grpc"
 	"google.golang.org/grpc/credentials"
 
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	tracev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1"
 	"github.com/apache/skywalking-banyandb/banyand/discovery"
 	"github.com/apache/skywalking-banyandb/banyand/index"
 	"github.com/apache/skywalking-banyandb/banyand/liaison/grpc"
@@ -82,9 +82,9 @@ func setup(tester *require.Assertions) (*grpc.Server, *grpc.Server, func()) {
 	tester.NoError(err)
 	// Init `liaison` module
 	tcp := grpc.NewServer(context.TODO(), pipeline, repo)
-	tester.NoError(tcp.FlagSet().Parse([]string{"--tlsVal=false", "--addr=:17912"}))
+	tester.NoError(tcp.FlagSet().Parse([]string{"--tls=false", "--addr=:17912"}))
 	tcpTLS := grpc.NewServer(context.TODO(), pipeline, repo)
-	tester.NoError(tcpTLS.FlagSet().Parse([]string{"--tlsVal=true", "--addr=:17913"}))
+	tester.NoError(tcpTLS.FlagSet().Parse([]string{"--tls=true", "--addr=:17913", "--cert-file=testdata/server_cert.pem", "--key-file=testdata/server_key.pem"}))
 
 	err = indexSvc.PreRun()
 	tester.NoError(err)
@@ -127,8 +127,8 @@ func setup(tester *require.Assertions) (*grpc.Server, *grpc.Server, func()) {
 
 type caseData struct {
 	name           string
-	queryGenerator func(baseTs time.Time) *v1.QueryRequest
-	writeGenerator func() *v1.WriteRequest
+	queryGenerator func(baseTs time.Time) *tracev1.QueryRequest
+	writeGenerator func() *tracev1.WriteRequest
 	args           testData
 	wantLen        int
 }
@@ -139,11 +139,11 @@ func TestTraceService(t *testing.T) {
 	defer gracefulStop()
 	_, currentFile, _, _ := runtime.Caller(0)
 	basePath := filepath.Dir(currentFile)
-	certFile := filepath.Join(basePath, "data/server_cert.pem")
+	certFile := filepath.Join(basePath, "testdata/server_cert.pem")
 	testCases := []caseData{
 		{
 			name: "isTLS",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(10).
 					Offset(0).
@@ -153,7 +153,7 @@ func TestTraceService(t *testing.T) {
 					Projection("trace_id").
 					Build()
 			},
-			writeGenerator: func() *v1.WriteRequest {
+			writeGenerator: func() *tracev1.WriteRequest {
 				entityValue := pb.NewEntityValueBuilder().
 					EntityID("entityId123").
 					DataBinary([]byte{12}).
@@ -185,7 +185,7 @@ func TestTraceService(t *testing.T) {
 		},
 		{
 			name: "noTLS",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(10).
 					Offset(0).
@@ -195,7 +195,7 @@ func TestTraceService(t *testing.T) {
 					Projection("trace_id").
 					Build()
 			},
-			writeGenerator: func() *v1.WriteRequest {
+			writeGenerator: func() *tracev1.WriteRequest {
 				entityValue := pb.NewEntityValueBuilder().
 					EntityID("entityId123").
 					DataBinary([]byte{12}).
@@ -254,7 +254,7 @@ func dialService(t *testing.T, tc caseData, opts []grpclib.DialOption) {
 }
 
 func traceWrite(t *testing.T, tc caseData, conn *grpclib.ClientConn) {
-	client := v1.NewTraceServiceClient(conn)
+	client := tracev1.NewTraceServiceClient(conn)
 	ctx := context.Background()
 	stream, errorWrite := client.Write(ctx)
 	if errorWrite != nil {
@@ -283,7 +283,7 @@ func traceWrite(t *testing.T, tc caseData, conn *grpclib.ClientConn) {
 }
 
 func traceQuery(t *testing.T, tc caseData, conn *grpclib.ClientConn) {
-	client := v1.NewTraceServiceClient(conn)
+	client := tracev1.NewTraceServiceClient(conn)
 	ctx := context.Background()
 	baseTs := time.Now()
 	stream, errRev := client.Query(ctx, tc.queryGenerator(baseTs))
diff --git a/banyand/query/processor.go b/banyand/query/processor.go
index 807fcc7..b86f6a7 100644
--- a/banyand/query/processor.go
+++ b/banyand/query/processor.go
@@ -23,7 +23,7 @@ import (
 
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/data"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1"
 	apischema "github.com/apache/skywalking-banyandb/api/schema"
 	"github.com/apache/skywalking-banyandb/banyand/discovery"
 	"github.com/apache/skywalking-banyandb/banyand/index"
diff --git a/banyand/query/processor_test.go b/banyand/query/processor_test.go
index a1abe7b..bfa555f 100644
--- a/banyand/query/processor_test.go
+++ b/banyand/query/processor_test.go
@@ -29,7 +29,8 @@ import (
 
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/data"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	commonv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+	tracev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1"
 	"github.com/apache/skywalking-banyandb/banyand/discovery"
 	"github.com/apache/skywalking-banyandb/banyand/index"
 	"github.com/apache/skywalking-banyandb/banyand/liaison/grpc"
@@ -127,7 +128,7 @@ func setupServices(t *testing.T, tester *require.Assertions) (series.Service, qu
 
 func setupData(tester *require.Assertions, baseTs time.Time, svc series.Service) {
 	metadata := common.Metadata{
-		Spec: &v1.Metadata{
+		Spec: &commonv1.Metadata{
 			Name:  "sw",
 			Group: "default",
 		},
@@ -297,13 +298,13 @@ func TestQueryProcessor(t *testing.T) {
 		// name of the test case
 		name string
 		// queryGenerator is used to generate a Query
-		queryGenerator func(baseTs time.Time) *v1.QueryRequest
+		queryGenerator func(baseTs time.Time) *tracev1.QueryRequest
 		// wantLen is the length of entities expected to return
 		wantLen int
 	}{
 		{
 			name: "query given timeRange is out of the time range of data",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(10).
 					Offset(0).
@@ -316,7 +317,7 @@ func TestQueryProcessor(t *testing.T) {
 		},
 		{
 			name: "query given timeRange which slightly covers the first three segments",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(10).
 					Offset(0).
@@ -329,7 +330,7 @@ func TestQueryProcessor(t *testing.T) {
 		},
 		{
 			name: "query TraceID given timeRange includes the time range of data",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(10).
 					Offset(0).
@@ -343,7 +344,7 @@ func TestQueryProcessor(t *testing.T) {
 		},
 		{
 			name: "query TraceID given timeRange includes the time range of data but limit to 1",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(1).
 					Offset(0).
@@ -357,7 +358,7 @@ func TestQueryProcessor(t *testing.T) {
 		},
 		{
 			name: "Numerical Index - query duration < 200",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(1).
 					Offset(0).
@@ -371,7 +372,7 @@ func TestQueryProcessor(t *testing.T) {
 		},
 		{
 			name: "Numerical Index - query duration < 400",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(10).
 					Offset(0).
@@ -385,7 +386,7 @@ func TestQueryProcessor(t *testing.T) {
 		},
 		{
 			name: "Textual Index - db.type == MySQL",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(10).
 					Offset(0).
@@ -399,7 +400,7 @@ func TestQueryProcessor(t *testing.T) {
 		},
 		{
 			name: "Mixed Index - db.type == MySQL AND duration <= 300",
-			queryGenerator: func(baseTs time.Time) *v1.QueryRequest {
+			queryGenerator: func(baseTs time.Time) *tracev1.QueryRequest {
 				return pb.NewQueryRequestBuilder().
 					Limit(10).
 					Offset(0).
diff --git a/banyand/series/schema/sw/sw.go b/banyand/series/schema/sw/sw.go
index a38bc7f..c4d91a0 100644
--- a/banyand/series/schema/sw/sw.go
+++ b/banyand/series/schema/sw/sw.go
@@ -16,10 +16,10 @@
 // under the License.
 
 //nolint
-//go:generate sh -c "protoc -I../../../../api/proto --encode=banyandb.v1.TraceSeries ../../../../api/proto/banyandb/v1/schema.proto < trace_series.textproto > trace_series.bin"
-//go:generate sh -c "protoc -I../../../../api/proto --encode=banyandb.v1.IndexRule ../../../../api/proto/banyandb/v1/schema.proto < index_rule.textproto > index_rule.bin"
+//go:generate sh -c "protoc -I../../../../api/proto --encode=banyandb.database.v1.TraceSeries ../../../../api/proto/banyandb/database/v1/schema.proto < trace_series.textproto > trace_series.bin"
+//go:generate sh -c "protoc -I../../../../api/proto --encode=banyandb.database.v1.IndexRule ../../../../api/proto/banyandb/database/v1/schema.proto < index_rule.textproto > index_rule.bin"
 //nolint
-//go:generate sh -c "protoc -I../../../../api/proto --encode=banyandb.v1.IndexRuleBinding ../../../../api/proto/banyandb/v1/schema.proto < index_rule_binding.textproto > index_rule_binding.bin"
+//go:generate sh -c "protoc -I../../../../api/proto --encode=banyandb.database.v1.IndexRuleBinding ../../../../api/proto/banyandb/database/v1/schema.proto < index_rule_binding.textproto > index_rule_binding.bin"
 package sw
 
 import (
@@ -30,7 +30,7 @@ import (
 	"github.com/golang/protobuf/proto"
 
 	"github.com/apache/skywalking-banyandb/api/common"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 	apischema "github.com/apache/skywalking-banyandb/api/schema"
 	"github.com/apache/skywalking-banyandb/banyand/series/schema"
 )
diff --git a/banyand/series/series.go b/banyand/series/series.go
index f10b60e..02de4df 100644
--- a/banyand/series/series.go
+++ b/banyand/series/series.go
@@ -24,7 +24,7 @@ import (
 
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/data"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 	"github.com/apache/skywalking-banyandb/banyand/series/schema"
 	posting2 "github.com/apache/skywalking-banyandb/pkg/posting"
 	"github.com/apache/skywalking-banyandb/pkg/run"
diff --git a/banyand/series/trace/common_test.go b/banyand/series/trace/common_test.go
index 8d13a7c..9445c62 100644
--- a/banyand/series/trace/common_test.go
+++ b/banyand/series/trace/common_test.go
@@ -32,7 +32,7 @@ import (
 
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/data"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
 	"github.com/apache/skywalking-banyandb/banyand/index"
 	"github.com/apache/skywalking-banyandb/banyand/storage"
 	"github.com/apache/skywalking-banyandb/pkg/convert"
diff --git a/banyand/series/trace/query.go b/banyand/series/trace/query.go
index 770c877..aaf8b9f 100644
--- a/banyand/series/trace/query.go
+++ b/banyand/series/trace/query.go
@@ -27,7 +27,7 @@ import (
 
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/data"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1"
 	"github.com/apache/skywalking-banyandb/banyand/kv"
 	"github.com/apache/skywalking-banyandb/banyand/series"
 	"github.com/apache/skywalking-banyandb/pkg/convert"
@@ -213,15 +213,16 @@ func (t *traceSeries) parseFetchInfo(opt series.ScanOptions) (fetchDataBinary bo
 			t.l.Debug().Msg("to fetch data binary")
 			continue
 		}
-		index, ok := t.fieldIndex[p]
+		f, ok := t.fieldIndex[p]
 		if !ok {
 			return false, nil, errors.Wrapf(ErrFieldNotFound, "field name:%s", p)
 		}
 		fetchFieldsIndices = append(fetchFieldsIndices, pb.FieldEntry{
 			Key:   p,
-			Index: index,
+			Index: f.idx,
+			Type:  f.spec.GetType(),
 		})
-		t.l.Debug().Str("name", p).Int("index", index).Msg("to fetch the field")
+		t.l.Debug().Str("name", p).Interface("index", f).Msg("to fetch the field")
 	}
 	return fetchDataBinary, fetchFieldsIndices, nil
 }
diff --git a/banyand/series/trace/query_test.go b/banyand/series/trace/query_test.go
index 056af1d..5f7e94c 100644
--- a/banyand/series/trace/query_test.go
+++ b/banyand/series/trace/query_test.go
@@ -66,12 +66,12 @@ func Test_traceSeries_FetchEntity(t *testing.T) {
 				opt:            series.ScanOptions{Projection: []string{"trace_id", "service_name", "state", "duration", "mq.queue"}},
 			},
 			wantEntities: []wantEntity{
-				{entityID: "1", fieldsSize: 4},
-				{entityID: "2", fieldsSize: 2},
-				{entityID: "3", fieldsSize: 4},
-				{entityID: "4", fieldsSize: 4},
+				{entityID: "1", fieldsSize: 5},
+				{entityID: "2", fieldsSize: 5},
+				{entityID: "3", fieldsSize: 5},
+				{entityID: "4", fieldsSize: 5},
 				{entityID: "5", fieldsSize: 5},
-				{entityID: "6", fieldsSize: 4},
+				{entityID: "6", fieldsSize: 5},
 				{entityID: "7", fieldsSize: 5},
 			},
 		},
diff --git a/banyand/series/trace/schema.go b/banyand/series/trace/schema.go
index a8e4227..f98d039 100644
--- a/banyand/series/trace/schema.go
+++ b/banyand/series/trace/schema.go
@@ -24,7 +24,8 @@ import (
 	"go.uber.org/multierr"
 
 	"github.com/apache/skywalking-banyandb/api/common"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	commonv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+	databasev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 	"github.com/apache/skywalking-banyandb/banyand/series"
 	"github.com/apache/skywalking-banyandb/banyand/series/schema"
 	"github.com/apache/skywalking-banyandb/banyand/series/schema/sw"
@@ -44,7 +45,7 @@ func (s *service) IndexRuleBinding() schema.IndexRuleBinding {
 	return sw.NewIndexRuleBinding()
 }
 
-func (s *service) IndexRules(ctx context.Context, subject *v1.Series, filter series.IndexObjectFilter) ([]*v1.IndexRule, error) {
+func (s *service) IndexRules(ctx context.Context, subject *databasev1.Series, filter series.IndexObjectFilter) ([]*databasev1.IndexRule, error) {
 	group := subject.Series.GetGroup()
 	bindings, err := s.IndexRuleBinding().List(ctx, schema.ListOpt{Group: group})
 	if err != nil {
@@ -55,7 +56,7 @@ func (s *service) IndexRules(ctx context.Context, subject *v1.Series, filter ser
 		return nil, nil
 	}
 	now := time.Now()
-	foundRules := make([]*v1.Metadata, 0)
+	foundRules := make([]*commonv1.Metadata, 0)
 	for _, binding := range bindings {
 		spec := binding.Spec
 		if spec.GetBeginAt().AsTime().After(now) ||
@@ -77,7 +78,7 @@ func (s *service) IndexRules(ctx context.Context, subject *v1.Series, filter ser
 			}
 		}
 	}
-	result := make([]*v1.IndexRule, 0)
+	result := make([]*databasev1.IndexRule, 0)
 	var indexRuleErr error
 	for _, rule := range foundRules {
 		object, getErr := s.IndexRule().Get(ctx, common.Metadata{KindVersion: common.MetadataKindVersion, Spec: rule})
diff --git a/banyand/series/trace/schema_test.go b/banyand/series/trace/schema_test.go
index baf619d..adcbef8 100644
--- a/banyand/series/trace/schema_test.go
+++ b/banyand/series/trace/schema_test.go
@@ -23,20 +23,21 @@ import (
 	"testing"
 
 	"github.com/apache/skywalking-banyandb/api/common"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	commonv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+	databasev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 	"github.com/apache/skywalking-banyandb/banyand/series"
 	"github.com/apache/skywalking-banyandb/banyand/series/schema/sw"
 )
 
 func Test_service_RulesBySubject(t *testing.T) {
 	type args struct {
-		series *v1.Series
+		series *databasev1.Series
 		filter series.IndexObjectFilter
 	}
 	tests := []struct {
 		name    string
 		args    args
-		want    []*v1.IndexRule
+		want    []*databasev1.IndexRule
 		wantErr bool
 	}{
 		{
@@ -50,7 +51,7 @@ func Test_service_RulesBySubject(t *testing.T) {
 			name: "filter index object",
 			args: args{
 				series: createSubject("sw", "default"),
-				filter: func(object *v1.IndexObject) bool {
+				filter: func(object *databasev1.IndexObject) bool {
 					return object.GetFields()[0] == "trace_id"
 				},
 			},
@@ -60,7 +61,7 @@ func Test_service_RulesBySubject(t *testing.T) {
 			name: "got empty idWithShard",
 			args: args{
 				series: createSubject("sw", "default"),
-				filter: func(object *v1.IndexObject) bool {
+				filter: func(object *databasev1.IndexObject) bool {
 					return object.GetFields()[0] == "invalid"
 				},
 			},
@@ -85,23 +86,23 @@ func Test_service_RulesBySubject(t *testing.T) {
 	}
 }
 
-func getIndexRule(name, group string) []*v1.IndexRule {
+func getIndexRule(name, group string) []*databasev1.IndexRule {
 	indexRule, _ := sw.NewIndexRule().Get(context.Background(), common.Metadata{
 		KindVersion: common.MetadataKindVersion,
-		Spec: &v1.Metadata{
+		Spec: &commonv1.Metadata{
 			Group: group,
 			Name:  name,
 		}},
 	)
-	return []*v1.IndexRule{indexRule.Spec}
+	return []*databasev1.IndexRule{indexRule.Spec}
 }
 
-func createSubject(name, group string) *v1.Series {
-	return &v1.Series{
-		Series: &v1.Metadata{
+func createSubject(name, group string) *databasev1.Series {
+	return &databasev1.Series{
+		Series: &commonv1.Metadata{
 			Group: group,
 			Name:  name,
 		},
-		Catalog: v1.Series_CATALOG_TRACE,
+		Catalog: databasev1.Series_CATALOG_TRACE,
 	}
 }
diff --git a/banyand/series/trace/service.go b/banyand/series/trace/service.go
index d646447..05fd04c 100644
--- a/banyand/series/trace/service.go
+++ b/banyand/series/trace/service.go
@@ -26,7 +26,8 @@ import (
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/data"
 	"github.com/apache/skywalking-banyandb/api/event"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	commonv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
+	databasev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
 	"github.com/apache/skywalking-banyandb/banyand/discovery"
 	"github.com/apache/skywalking-banyandb/banyand/index"
 	"github.com/apache/skywalking-banyandb/banyand/queue"
@@ -96,27 +97,27 @@ func (s *service) Serve() error {
 			SeriesMetadata(sMeta.group, sMeta.name).
 			FieldNames(sMeta.fieldsNamesCompositeSeriesID...).
 			Time(time.Now()).
-			Action(v1.Action_ACTION_PUT).
+			Action(databasev1.Action_ACTION_PUT).
 			Build()
 		_, err := s.repo.Publish(event.TopicSeriesEvent, bus.NewMessage(bus.MessageID(now), e))
 		if err != nil {
 			return err
 		}
-		seriesObj := &v1.Series{
-			Series: &v1.Metadata{
+		seriesObj := &databasev1.Series{
+			Series: &commonv1.Metadata{
 				Name:  sMeta.name,
 				Group: sMeta.group,
 			},
-			Catalog: v1.Series_CATALOG_TRACE,
+			Catalog: databasev1.Series_CATALOG_TRACE,
 		}
 		rules, errGetRules := s.IndexRules(context.Background(), seriesObj, nil)
 		if errGetRules != nil {
 			return errGetRules
 		}
-		shardedRuleIndex := make([]*v1.IndexRuleEvent_ShardedIndexRule, 0, len(rules)*int(sMeta.shardNum))
+		shardedRuleIndex := make([]*databasev1.IndexRuleEvent_ShardedIndexRule, 0, len(rules)*int(sMeta.shardNum))
 		for i := 0; i < int(sMeta.shardNum); i++ {
 			t := time.Now()
-			e := pb.NewShardEventBuilder().Action(v1.Action_ACTION_PUT).Time(t).
+			e := pb.NewShardEventBuilder().Action(databasev1.Action_ACTION_PUT).Time(t).
 				Shard(
 					pb.NewShardBuilder().
 						ID(uint64(i)).Total(sMeta.shardNum).SeriesMetadata(sMeta.group, sMeta.name).UpdatedAt(t).CreatedAt(t).
@@ -129,16 +130,16 @@ func (s *service) Serve() error {
 			if errShard != nil {
 				return errShard
 			}
-			shardedRuleIndex = append(shardedRuleIndex, &v1.IndexRuleEvent_ShardedIndexRule{
+			shardedRuleIndex = append(shardedRuleIndex, &databasev1.IndexRuleEvent_ShardedIndexRule{
 				ShardId: uint64(i),
 				Rules:   rules,
 			})
 		}
 
-		indexRule := &v1.IndexRuleEvent{
+		indexRule := &databasev1.IndexRuleEvent{
 			Series: seriesObj.Series,
 			Rules:  shardedRuleIndex,
-			Action: v1.Action_ACTION_PUT,
+			Action: databasev1.Action_ACTION_PUT,
 			Time:   timestamppb.New(time.Now()),
 		}
 		_, errPublishRules := s.repo.Publish(event.TopicIndexRule, bus.NewMessage(bus.MessageID(now), indexRule))
diff --git a/banyand/series/trace/trace.go b/banyand/series/trace/trace.go
index 96af476..c64d871 100644
--- a/banyand/series/trace/trace.go
+++ b/banyand/series/trace/trace.go
@@ -25,7 +25,9 @@ import (
 
 	"github.com/apache/skywalking-banyandb/api/common"
 	"github.com/apache/skywalking-banyandb/api/data"
-	v1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/v1"
+	databasev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
+	modelv1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/model/v1"
+	tracev1 "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1"
 	apischema "github.com/apache/skywalking-banyandb/api/schema"
 	"github.com/apache/skywalking-banyandb/banyand/index"
 	"github.com/apache/skywalking-banyandb/banyand/series"
@@ -144,11 +146,11 @@ type traceSeries struct {
 	writePoint                   storage.GetWritePoint
 	idx                          index.Service
 	shardNum                     uint32
-	fieldIndex                   map[string]int
+	fieldIndex                   map[string]*fieldSpec
 	traceIDIndex                 int
 	traceIDFieldName             string
 	stateFieldName               string
-	stateFieldType               v1.FieldSpec_FieldType
+	stateFieldType               databasev1.FieldType
 	strStateSuccessVal           string
 	strStateErrorVal             string
 	intStateSuccessVal           int64
@@ -157,6 +159,11 @@ type traceSeries struct {
 	fieldsNamesCompositeSeriesID []string
 }
 
+type fieldSpec struct {
+	idx  int
+	spec *databasev1.FieldSpec
+}
+
 func newTraceSeries(schema apischema.TraceSeries, l *logger.Logger, idx index.Service) (*traceSeries, error) {
 	t := &traceSeries{
 		schema: schema,
@@ -176,13 +183,13 @@ func newTraceSeries(schema apischema.TraceSeries, l *logger.Logger, idx index.Se
 		return nil, errors.Wrapf(ErrFieldSchemaNotFound, "trace_id field name:%s\n field index:%v",
 			t.traceIDFieldName, t.fieldIndex)
 	}
... 1446 lines suppressed ...