You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BanyanDB employs a Time-To-Live (TTL) mechanism to automatically delete data older than the specified duration. When using BanyanDB as the storage backend, the `recordDataTTL` and `metricsDataTTL` configurations are deprecated. Instead, TTL settings should be configured directly within `storage.banyandb`.
4
+
5
+
For detailed information, please refer to the [Storage BanyanDB](../setup/backend/storages/banyandb.md) documentation.
6
+
7
+
## Segment Interval and TTL
8
+
9
+
BanyanDB's data rotation mechanism manages data storage based on **Segment Interval** and **TTL** settings:
10
+
11
+
-**Segment Interval (`SIDays`)**: Specifies the time interval in days for creating a new data segment. Segments are time-based, facilitating efficient data retention and querying.
12
+
-**TTL (`TTLDays`)**: Defines the time-to-live for data within a group, in days. Data that exceeds the TTL will be automatically deleted.
13
+
14
+
### Best Practices for Setting `SIDays` and `TTLDays`
15
+
16
+
-**Data Retention Requirements**: Set the TTL based on how long you need to retain your data. For instance, to retain data for 30 days, set the TTL to 30 days.
17
+
-**Segment Management**: Avoid generating too many segments, as this increases the overhead for data management and querying.
18
+
-**Query Requirements**: Align segment intervals with your query patterns. For example:
19
+
- If you frequently query data for the last 30 minutes, set `SIDays` to 1 day.
20
+
- For querying data from the last 7 days, set `SIDays` to 7 days.
21
+
22
+
## Configuration Guidelines
23
+
24
+
### Record Data
25
+
26
+
For both standard and super datasets:
27
+
28
+
-**Recommended `SIDays`**: `1`
29
+
- Most queries are performed within a day.
30
+
-**`TTLDays`**: Set according to your data retention needs.
31
+
32
+
### Metrics Data
33
+
34
+
Configure `SIDays` and `TTLDays` based on data retention and query requirements. Recommended settings include:
35
+
36
+
| Group |`SIDays`|`TTLDays`|
37
+
|----------------|----------|-----------|
38
+
| Minute (`gmMinute`) | 1 | 7 |
39
+
| Hour (`gmHour`) | 5 | 15 |
40
+
| Day (`gmDay`) | 15 | 15 |
41
+
| Index (`gmIndex`) | 15 | 15 |
42
+
43
+
**Group Descriptions:**
44
+
45
+
-**Minute (`gmMinute`)**: Stores metrics with a 1-minute granularity. Suitable for recent data queries requiring minute-level detail. Consequently, it has shorter `SIDays` and `TTLDays` compared to other groups.
46
+
-**Hour (`gmHour`)**: Stores metrics with a 1-hour granularity. Designed for queries that need hour-level detail over a longer period than minute-level data.
47
+
-**Day (`gmDay`)**: Stores metrics with a 1-day granularity. This group handles the longest segment intervals and TTLs among all granularity groups.
48
+
-**Index (`gmIndex`)**: Stores metrics used solely for indexing without value columns. Since queries often scan all segments in the `index` group, it shares the same `SIDays` and `TTLDays` as the `day` group to optimize performance. This group's `TTL` must be set to the **max** value of all groups.
49
+
50
+
For more details on configuring `segmentIntervalDays` and `ttlDays`, refer to the [BanyanDB Rotation](https://skywalking.apache.org/docs/skywalking-banyandb/latest/concept/rotation/) documentation.
-`SIDays`: Interval in days for creating a new segment. Segments are time-based, allowing efficient data retention and querying. `SI` stands for Segment Interval.
111
99
-`TTLDays`: Time-to-live for the data in the group, in days. Data exceeding the TTL will be deleted.
112
100
113
-
For more details on setting `segmentIntervalDays` and `ttlDays`, refer to the [BanyanDB Rotation](https://skywalking.apache.org/docs/skywalking-banyandb/latest/concept/rotation/) documentation.
101
+
For more details on setting `segmentIntervalDays` and `ttlDays`, refer to the [BanyanDB TTL](../../../banyandb/ttl.md) documentation.
102
+
103
+
#### Record Group Settings
104
+
105
+
The `gr` prefix is used for record group settings. The `normal` and `super` sections are used to define settings for normal and super datasets, respectively.
106
+
107
+
Super datasets are used to store trace or log data that is too large for normal datasets. Each super dataset is stored in a separate group in BanyanDB. The settings defined in the `super` section are applied to all super datasets.
108
+
109
+
Normal datasets are stored in a single group named `normal`. The settings defined in the `normal` section are applied to all normal datasets.
110
+
111
+
#### Metrics Group Settings
112
+
113
+
The `gm` prefix is used for metrics group settings. The `minute`, `hour`, and `day` sections are used to define settings for metrics stored based on granularity.
114
+
115
+
The `index` group is designed to store metrics used for indexing without value columns. For example, `service_traffic`, `network_address_alias`, etc.
114
116
115
117
For more details, refer to the documentation of [BanyanDB](https://skywalking.apache.org/docs/skywalking-banyandb/latest/readme/) and the [BanyanDB Java Client](https://github.com/apache/skywalking-banyandb-java-client) subprojects.
Copy file name to clipboardExpand all lines: docs/en/setup/backend/ttl.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,3 +10,8 @@ These are the settings for the different types:
10
10
metricsDataTTL: ${SW_CORE_METRICS_DATA_TTL:7} # Unit is day
11
11
```
12
12
13
+
## BanyanDB TTL
14
+
15
+
BanyanDB has a TTL mechanism to automatically delete data that is older than the specified time. When you use BanyanDB as the storage backend, `recordDataTTL` and `metricsDataTTL` are not used. Instead, you should configure the TTL settings in `storage.banyandb`.
16
+
17
+
Please refer to the [Storage BanyanDB](storages/banyandb.md) document for more information.
Copy file name to clipboardExpand all lines: oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBStorageProvider.java
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,15 @@ public void onInitialized(final BanyanDBStorageConfig initialized) {
0 commit comments