-
Notifications
You must be signed in to change notification settings - Fork 2
Storage and Persistence
AshleyThew edited this page Jul 5, 2026
·
1 revision
Bank supports SQLITE, MYSQL, and MONGODB save types selected by config.
Storage is made of multiple subsystems: account payloads, lock state, transaction history, and mapping tables.
Startup selects backend from Bank.Save.Type and initializes a BankDatabase wrapper.
If non-SQLite connection fails, plugin falls back to SQLite.
SQL backends register listeners for:
- UUID mapping
- info type mapping and info payload storage
- player lock state
- hiscores
- transaction tables
- cheque data
Mongo backend requires Mongo driver availability (via mongodb-loader plugin).
- Account payload subsystem: player info JSON by type.
- UUID mapping subsystem: player UUID and name mapping.
- Lock subsystem: boolean lock or time-based lock model.
- Transaction subsystem: money and exp history tables.
- Ranking subsystem: hiscore/baltop data.
Files:
-
config.yml(Bank.Save.Type, lock and autosave settings) mysql.ymlmongo.ymlconvert.yml
Reference files:
MySQL backend baseline:
Bank:
Save:
Type: MYSQL
Lock:
Time: true
Auto:
Enabled: true
Timer: 600Admin sequence when changing backend:
- Backup existing data.
- Configure target backend file.
- Set save/conversion keys.
- Restart and validate logs before opening server.
/bank admin save/bank admin reload/bank admin fix usernames
Storage operations are primarily admin-command gated.
SQL schema highlights:
-
bank_info_type: maps info classes to IDs -
bank_player_info: JSON payload per UUID and info type -
bank_uuids: UUID/name mappings -
bank_player_lockandbank_player_time_lock - money/exp transaction tables (auto-created)
Locking:
- Standard lock table uses boolean lock state.
- Time-lock mode uses timestamp unlock windows.
Retention notes:
- Transaction growth depends on configured max history and cleanup behavior.
- Lock mode should be consistent across all servers sharing one backend.
- Single server:
SQLITEdefault, localdatabase.db. - Network:
MYSQLwith exactly one main server for offline interest managers.
- MySQL fails then SQLite appears active: check credentials in
mysql.ymland startup logs. - Mongo mode fails: install
mongodb-loaderand validatemongo.yml. - Repeated lock conflicts across servers: verify common lock mode and synchronized save settings.
- System Architecture and Lifecycle
- Commands and Permissions
- Account and Balance Model
- Transactions and Money Flow Rules
- Storage and Persistence
- Configuration System
- GUI and Inventory Interactions
- Integrations and Access Modes
- Error Handling and Edge Cases
- Admin Operations and Troubleshooting
- Backup, Recovery, and Migration
- Version Compatibility and Known Limitations
- command_baltop.yml
- commands.yml
- config.yml
- convert.yml
- default_items.yml
- hiscores.yml
- inventories.yml
- itemblacklist.yml
- items.yml
- language.yml
- mysql.yml
- permissions.yml
- sounds.yml
- upgrade.yml
- Discord Support Config:
- command_baltop.yml
- commands.yml
- config.yml
- convert.yml
- default_items.yml
- hiscores.yml
- inventories.yml
- itemblacklist.yml
- items.yml
- language.yml
- mongo.yml
- mysql.yml
- permissions.yml
- sounds.yml Config:
- command_baltop.yml
- commands.yml
- config.yml
- convert.yml
- default_items.yml
- hiscores.yml
- inventories.yml
- itemblacklist.yml
- items.yml
- language.yml
- mongo.yml
- mysql.yml
- permissions.yml
- sounds.yml Config:
- command_baltop.yml
- commands.yml
- config.yml
- convert.yml
- default_items.yml
- hiscores.yml
- inventories.yml
- itemblacklist.yml
- items.yml
- language.yml
- mongo.yml
- mysql.yml
- permissions.yml
- sounds.yml