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
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
Depends on your needs.
Do you need multiple things to access the same data at once?
No, there's gonna be a sort of log database, that count item minned and crafted and other stats of a player
Are you developing a plugin? if so i'd think about how will i be interacting with the database
Yes
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
I'm selfhosting
So... doesnt matter because the host
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
Yes
Okay
Thx
Are you a plugin dev ?
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
Oh thx
What sort of plugin's have you modified ?
Coreprotect, essentialsX, grim and griefPrevention
Okay, impressive
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
I'm new to plugin creations so that's sort of big for me lol
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
I see
Do u made this for free ?
It depends on the license of the projects
if i have to make a custom plugin for an SMP then i'd charge them
Okay
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
Uh ? could you explain more, i'm triggerd now
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
Okay, for what kind of use Redis is good (true project / example)
Caching queries for example
Ok