Discussion in 'Bukkit Discussion' started by andrewkm, May 7, 2011.
Performance-wise, the approaches are effectively the same. On certain advanced MySQL setups and with extreme load on the server you might be able to optimize by putting different databases on different storage. But you're likely to run into severe performance issues on the minecraft server itself long before the DB becomes an issue.
Some thoughts on each design (reordered somewhat to make the explanation more fluent):
Design 2 (Single DB, Single user)
This design is likely to cause you problems. All plugins share the same database and you can easily run into issues with table-name collisions. In addition to that, plugins with security vulnerabilities (any form of SQL injection) will expose all your plugins.
There's no reason to use this approach, given how easy it is to create new databases.
Design 1 (Multiple DBs, Single user)
This design removes the table-collision issue, and is a bit "neater". However, you are still subject to security issues potentially corrupting all your plugins' data.
Design 3 (Multiple DBs, Multiple users)
This is what I would recommend. Given proper permission settings in MySQL, this localises security breaches in plugins to affect that plugin alone. There's no risk of "cross-talk" between plugin data stores.
The extra effort needed to go from Design 1 to 3 is minimal (a GRANT statement per plugin/db combination, and some re-configuration of db user/pwd settings), and the effect on security is fairly significant.
Hope this helps.
Separate names with a comma.