Database for plugin

What database system should i use for my plugin ? I heard about Redis, but idk if i should go for a SQL database or NoSQL database I'm waiting for your answer !
25 Replies
Admincraft Meta
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by lesuisse#0
Discount Milk
Discount Milk2y ago
Depends on your needs. Do you need multiple things to access the same data at once?
LeSuisse
LeSuisseOP2y ago
No, there's gonna be a sort of log database, that count item minned and crafted and other stats of a player
Mortis
Mortis2y ago
Are you developing a plugin? if so i'd think about how will i be interacting with the database
LeSuisse
LeSuisseOP2y ago
Yes
Mortis
Mortis2y ago
i personally recommend mySQL because mosat hosts offer mysql dbs with their hosting so its less hassle for the hosts. You could go down the Coreprotect route of using an sqlite database or h2 as some other plugins do
LeSuisse
LeSuisseOP2y ago
I'm selfhosting So... doesnt matter because the host
Mortis
Mortis2y ago
just pointing that out if you do intend for your plugin to be used elsewhere rather than personal usage if its personal usage then use whatever you feel comfortable with. Honestly speaking all database choices are fine to use
LeSuisse
LeSuisseOP2y ago
Yes Okay Thx Are you a plugin dev ?
Mortis
Mortis2y ago
Not really. I just modify some public ones for smps that i help out with // I use databases for personal projects so im familiar with them
LeSuisse
LeSuisseOP2y ago
Oh thx What sort of plugin's have you modified ?
Mortis
Mortis2y ago
Coreprotect, essentialsX, grim and griefPrevention
LeSuisse
LeSuisseOP2y ago
Okay, impressive
Mortis
Mortis2y ago
not really. they're just small changes or just often fixing a small bug that the dev has yet to implement due to being busy etc
LeSuisse
LeSuisseOP2y ago
I'm new to plugin creations so that's sort of big for me lol
Mortis
Mortis2y ago
I feel its easier to modify existing plugins than to create them from scratch cause modifying can be as simple as changing some values or adding another logic check or just copy pasting in some other code
LeSuisse
LeSuisseOP2y ago
I see Do u made this for free ?
Mortis
Mortis2y ago
It depends on the license of the projects if i have to make a custom plugin for an SMP then i'd charge them
LeSuisse
LeSuisseOP2y ago
Okay
Nils
Nils2y ago
Don't use Redis, it's wasn't designed to act as a persistent database it's an in memory db just use mysql/postgres Or actually you could also get away with using something like mongo probably better for this usecase if all you need to do is increment a number
LeSuisse
LeSuisseOP2y ago
Uh ? could you explain more, i'm triggerd now
Nils
Nils2y ago
Redis is an in memory key value db designed for raw performance Sure it supports writing to disk But that's not what it's made for You should be using it as a caching layer for example Or maybe storing session data for users
LeSuisse
LeSuisseOP2y ago
Okay, for what kind of use Redis is good (true project / example)
Nils
Nils2y ago
Caching queries for example
LeSuisse
LeSuisseOP2y ago
Ok

Did you find this page helpful?