資料儲存Storage
歷史資料、玩家統計快取與處罰日誌都寫入資料庫,資料庫是唯一真相來源。
storage:
type: sqlite # sqlite · mysql · mariadb
Redis(選用)
查詢優先讀 Redis,更新時先寫資料庫再覆蓋 Redis。Redis 掛掉會自動降級為資料庫, 服務不中斷,恢復後自動回填。
單機且 Redis 在遠端時,本地資料庫通常反而更快。Redis 的主要價值在跨服彙整。
玩家統計快取
離線玩家的統計需重讀統計檔(實測約 425ms),線上玩家僅約 4ms,因此只對離線玩家快取。 快取存於 Redis/資料庫,不佔用伺服器記憶體。
History, the player stat cache and the punishment log all go to a database, which is the single source of truth.
storage:
type: sqlite # sqlite · mysql · mariadb
Redis (optional)
Reads prefer Redis; writes go to the database first and then overwrite Redis. If Redis dies the plugin falls back to the database without interruption and backfills on reconnect.
On a single server with a remote Redis, the local database is usually faster. Redis mainly pays
off for cross-server aggregation.
Player stat cache
Offline players require re-reading the stats file (~425ms measured) versus ~4ms for online players, so only offline players are cached. Entries live in Redis or the database and use no server memory.