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

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


The following commit(s) were added to refs/heads/index by this push:
     new 074f333a Update documents
074f333a is described below

commit 074f333ac9b4f8253762d82327068bf81742d190
Author: Gao Hongtao <[email protected]>
AuthorDate: Fri Nov 15 06:40:00 2024 +0000

    Update documents
    
    Signed-off-by: Gao Hongtao <[email protected]>
---
 api/validate/validate.go   |  3 +++
 docs/concept/data-model.md | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/api/validate/validate.go b/api/validate/validate.go
index 1c4481aa..9c404762 100644
--- a/api/validate/validate.go
+++ b/api/validate/validate.go
@@ -132,6 +132,9 @@ func Measure(measure *databasev1.Measure) error {
        if len(measure.TagFamilies) == 0 {
                return errors.New("measure tag families is empty")
        }
+       if measure.IndexMode && len(measure.Fields) > 0 {
+               return errors.New("index mode is enabled, but fields are not 
empty")
+       }
        return tagFamily(measure.TagFamilies)
 }
 
diff --git a/docs/concept/data-model.md b/docs/concept/data-model.md
index 06726eb3..e81c0640 100644
--- a/docs/concept/data-model.md
+++ b/docs/concept/data-model.md
@@ -76,6 +76,7 @@ fields:
 entity:
   tag_names:
   - entity_id
+index_mode: false
 interval: 1m
 ```
 
@@ -115,6 +116,25 @@ functions to them.
 
 Another option named `interval` plays a critical role in encoding. It 
indicates the time range between two adjacent data points in a time series and 
implies that all data points belonging to the same time series are distributed 
based on a fixed interval. A better practice for the naming measure is to 
append the interval literal to the tail, for example, `service_cpm_minute`. 
It's a parameter of `GORILLA` encoding method.
 
+`index_mode` is a flag to enable the series index as the storage engine. All 
the tags will be stored in the inverted index and no field is allowed in the 
measure. This mode is suitable for the non-time series data model but needs TTL 
to be set. In this mode, the tags defined in the `entity` is the unique key of 
the data point. `timestamp` and `version` are the common tags in the inverted 
index.
+
+There is an example of a measure with the index mode enabled:
+
+```yaml
+metadata:
+  name: service_traffic
+  group: sw_metric
+tag_families:
+- name: default
+  tags:
+  - name: id
+    type: TAG_TYPE_STRING
+  - name: service_name
+    type: TAG_TYPE_STRING
+index_mode: true
+entity: ["id"]
+```
+
 [Measure Registration Operations](../api-reference.md#measureregistryservice)
 
 #### TopNAggregation

Reply via email to