DaisyVotes — Cross-Server (Redis)
DaisyVotes can run across a network of servers — a lobby, survival, skyblock, etc. — sharing one set of vote data, with optional Redis for live cross-server delivery.
Network mode is configured in network.yml and is off by default (single-server).
How it fits together
Section titled “How it fits together”There are two layers:
- Shared database (required for a network). Point every server at the same database — use MySQL/MariaDB in
storage.ymlinstead of SQLite. This alone keeps vote counts, points, streaks, and the queue consistent everywhere. - Redis (optional, adds “live”). Redis powers instant cross-server delivery, player presence, and duplicate suppression — e.g. a vote received on the lobby grants its reward on the survival server immediately, rather than when the player next visits.
network.yml
Section titled “network.yml”enabled: falseserver-id: "auto"redis: uri: "redis://localhost:6379" key-prefix: "daisyvotes" heartbeat-seconds: 15 message-ttl-seconds: 30live-routing: enabled: true deliver-online-rewards-across-network: true broadcast-vote-party-across-network: true| Key | Default | Description |
|---|---|---|
enabled | false | Turn on Redis network mode. |
server-id | "auto" | This server’s id on the network, and it must be unique. auto derives one from the hostname and game port, so two servers on one box still differ; set a name (e.g. lobby) if you prefer. Two servers sharing an id discard each other’s updates — /daisyvotes doctor fails loudly if it catches it. |
redis.uri | redis://localhost:6379 | Redis connection URI. Supports auth and TLS, e.g. redis://:pass@host:6379 / rediss://…. |
redis.key-prefix | daisyvotes | Namespace for all DaisyVotes keys/channels in Redis. |
redis.heartbeat-seconds | 15 | Presence heartbeat interval (min 5). |
redis.message-ttl-seconds | 30 | How long cross-server messages live (min 5). |
live-routing.enabled | true | Master switch for live routing over Redis. |
live-routing.deliver-online-rewards-across-network | true | Deliver a reward on whichever server the player is currently on. |
live-routing.broadcast-vote-party-across-network | true | Trigger vote parties network-wide. |
- Shared database. Configure the same MySQL/MariaDB connection in
storage.ymlon every server. See Storage & Data. - Enable Redis. Set
enabled: trueand yourredis.uriinnetwork.ymlon each server. Give each a distinctserver-id(or leaveauto). - Reload / restart, then check
/daisyvotes network status— it should report connected.
Without Redis
Section titled “Without Redis”Redis is optional. With only a shared database and Redis off, everything still works — votes, points, streaks, and rewards are consistent across servers, and any reward earned while a player is offline is delivered through the shared offline queue (/vote claim). Redis simply makes online delivery and parties instant instead of on-next-join.
Locking a player’s record across servers
Section titled “Locking a player’s record across servers”Every counter DaisyVotes keeps — vote totals, points, streaks — is a read, modify, and write of one whole database row; there’s no atomic “add one” anywhere. With Redis enabled, a vote landing on one server and, say, a shop purchase happening on another for the same player now take a network-wide lock on that player’s row before either one touches it, so the two can no longer read the same starting balance and overwrite each other’s write. This only matters with more than one server writing the same database — a single-server setup already has this covered by an in-JVM lock.
If Redis is unreachable, or the lock can’t be taken within two seconds, the update goes ahead anyway rather than dropping the vote — a rare lost update is judged the lesser problem.
Command
Section titled “Command”| Command | Permission | Description |
|---|---|---|
/daisyvotes network status | daisyvotes.admin.network | Enabled/connected state, server id, Redis URI (redacted), last error. |