Skip to content

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).

There are two layers:

  1. Shared database (required for a network). Point every server at the same database — use MySQL/MariaDB in storage.yml instead of SQLite. This alone keeps vote counts, points, streaks, and the queue consistent everywhere.
  2. 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
enabled: false
server-id: "auto"
redis:
uri: "redis://localhost:6379"
key-prefix: "daisyvotes"
heartbeat-seconds: 15
message-ttl-seconds: 30
live-routing:
enabled: true
deliver-online-rewards-across-network: true
broadcast-vote-party-across-network: true
KeyDefaultDescription
enabledfalseTurn 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.uriredis://localhost:6379Redis connection URI. Supports auth and TLS, e.g. redis://:pass@host:6379 / rediss://….
redis.key-prefixdaisyvotesNamespace for all DaisyVotes keys/channels in Redis.
redis.heartbeat-seconds15Presence heartbeat interval (min 5).
redis.message-ttl-seconds30How long cross-server messages live (min 5).
live-routing.enabledtrueMaster switch for live routing over Redis.
live-routing.deliver-online-rewards-across-networktrueDeliver a reward on whichever server the player is currently on.
live-routing.broadcast-vote-party-across-networktrueTrigger vote parties network-wide.
  1. Shared database. Configure the same MySQL/MariaDB connection in storage.yml on every server. See Storage & Data.
  2. Enable Redis. Set enabled: true and your redis.uri in network.yml on each server. Give each a distinct server-id (or leave auto).
  3. Reload / restart, then check /daisyvotes network status — it should report connected.

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.

CommandPermissionDescription
/daisyvotes network statusdaisyvotes.admin.networkEnabled/connected state, server id, Redis URI (redacted), last error.