Skip to content

v2.14.3 Added Redis Database

Latest

Choose a tag to compare

@tcmmi tcmmi released this 21 Mar 11:19
· 20 commits to master since this release

🔴 New: Redis Variable Storage

Skript variables can now be stored in Redis with instant cross-server sync via Pub/Sub (<5ms). Zero external Java dependencies - built using raw RESP protocol sockets.

Why Redis? MySQL syncs every 5-60 seconds by polling. Redis pushes changes instantly to every connected server. No polling. No delays. No race conditions.

Quick Start

1. Install Redis:

sudo apt install redis-server -y
sudo systemctl enable redis-server
sudo systemctl start redis-server
redis-cli ping  # -> PONG

2. Add to config.sk:

databases:
    database 1:
        type: Redis
        pattern: .*
        host: 127.0.0.1
        port: 6379
        password: ""

3. Restart your server. Variables sync instantly.

Redis vs MySQL

MySQL Redis
Sync Speed 5-60s (polling) <5ms (Pub/Sub)
Race Conditions Possible Impossible
Persistence Always on disk RAM + disk (RDB/AOF)
Setup Database + credentials apt install redis-server

Persistence

Redis saves to disk automatically via RDB snapshots. For maximum durability:

# /etc/redis/redis.conf
appendonly yes
save 60 1000

Redis Management

RedisInsight - free GUI for Redis:

docker run -d --name redisinsight --network host redis/redisinsight:latest
# Open http://your-server:5540

Requirements

  • Redis 6.0+ on the server
  • Default: 127.0.0.1:6379, no password

🟢 MySQL: SQLibrary Removed

The abandoned SQLibrary dependency has been replaced with direct JDBC connections via DatabaseWrapper. Works with MySQL Connector/J 8.x and 5.x. No more NoClassDefFoundError: lib/PatPeter/SQLibrary/Database.


🟡 MySQL: Automatic Schema Migration

Tables created by older Skript versions are now automatically upgraded on startup. Missing columns (update_guid, rowid) are added via ALTER TABLE - no manual SQL needed.


🟡 MySQL: Deadlock Protection

  • Save operations retry up to 3x with exponential backoff
  • Commit thread gracefully recovers from deadlocks
  • No more Deadlock found when trying to get lock error spam

🟡 MySQL: Connection Recovery

  • autoCommit and prepared statements automatically restored after reconnect
  • Eliminated duplicate connection threads
  • Connection keep-alive with automatic reconnection logging