Player data storage system: SQL, NoSQL or local file

Hello everyone! Currently i see most servers use SQL database to store user data. Do you think that is necessary for FiveM server? In my opinion, FiveM only runs alone, there is no connection to other servers like Minecraft to form a network. Do you think between SQL , NoSQL and local storage which will be best for the FiveM server?

Every type of storage has its pros and cons depending on the use case. Most fivem servers use SQL

1 Like

If starting a new framework with local storage, will it be good?

If you want relational data than MySQL/MariaDB, otherwise use key-value store or document database. No matter what option you choose there are going to be pros and cons - personally I like being able to ensure data integrity with foreign keys and cascades.

FiveM already uses RocksDB for kvp natives, such as SetResourceKvp - FiveM Natives @ Cfx.re Docs, GetResourceKvpString - FiveM Natives @ Cfx.re Docs, FindKvp - FiveM Natives @ Cfx.re Docs.

I wouldn’t recommend just saving a file.


Minor addendum; I suggest MariaDB because many people are already using it for their servers and if you’re looking to use or release public resources it’s going to be the simplest choice. If you’re working on everything yourself and from scratch, use whatever - I’ve wanted to try postgresql but I don’t run a server and just release resources, so there’s no point.

1 Like