About WAL (Write-Ahead Logging) Directory

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 关于WAL预写日志目录

| username: terry0219

Regarding the configuration of the WAL log location, there are two places to configure: raftdb.wal-dir and rocksdb.wal-dir. What is the difference between them?

| username: zhanggame1 | Original post link

The TiDB documentation states that TiKV has two RocksDB instances, one for Raft and one for data, each with its own WAL.

| username: TiDBer_QYr0vohO | Original post link

rocksdb.wal-dir is the directory for recording data WAL, and raftdb.wal-dir is the directory for storing Raft RocksDB WAL files, which is the WAL directory for recording raft logs.

| username: dba远航 | Original post link

One is writing logs, the other is writing data.

| username: 这里介绍不了我 | Original post link

They correspond to rocksdb raft and rocksdb kv, one stores logs and the other stores data.

| username: forever | Original post link

Two RocksDB instances, RocksDB Raft: WAL logs for Raft logs and RocksDB KV: WAL logs for data.

| username: 随缘天空 | Original post link

The raftdb.wal-dir usually stores the write-ahead logs related to the Raft consensus process. The rocksdb.wal-dir stores data related to TiKV. RocksDB is a persistent key-value store used by TiKV to save the actual database data (rows, columns, indexes, etc.).

| username: YuchongXU | Original post link

Persistent write

| username: xiaoqiao | Original post link

Logs and data

| username: wangkk2024 | Original post link

Persistent write

| username: TiDBer_JUi6UvZm | Original post link

Raft logs and KV data

| username: zhang_2023 | Original post link

Data and logs are separated.

| username: mono | Original post link

One is used for data storage, primarily for data persistence. The other is used for data replication to ensure high availability.

| username: 洪七表哥 | Original post link

There are two RocksDB instances, one for Raft logs and one for KV data logs.

| username: wangkk2024 | Original post link

Here to learn.

| username: QH琉璃 | Original post link

The introductory course mentioned it, right? Two RocksDBs.

| username: zhang_2023 | Original post link

One stores logs, one is an application log.

| username: TiDBer_JUi6UvZm | Original post link

The third session of the 302 course, which introduces the TIKV part, is explained very clearly.

| username: zhaokede | Original post link

Logs and data.

| username: madcoder | Original post link

Why are you asking questions when the official website explains it very clearly?