Best Way to Store Data

I have been looking around recently for different ways to store lots of data in a way similar to the way MySQL does. I am, however, trying to avoid using MySQL for a few reasons (mainly the large file size and demanding load), and I am wondering: Is there a different way to store large amounts of data?

I really love the idea of using SQLite, but have been unable to get any part of it to work. I have looked into the code for essentialmode, but have been unable to figure out any way to properly implement such code. I have also looked into JSON, but have not found any logical way to do this.

If anyone has any resources or suggestions that would help me figure this out, it would be much appreciated. I have seen a lack of standalone database scripts and think it would believe it would be cool to do this.

It all depends on what you are storing and how you want to retrieve it. I talked about it a little while back, here’s a snippet:

If you explain a little more as to what you’re trying to achive, I can give you some more specifics as to the best way to achive it :+1:

1 Like

I’m working on a zombie survival server that is being created from the ground-up. I mainly need the data storage to store the players stats (hunger, thirst, etc), vehicles, weapon loadouts, level, etc.

In which case MySQL probably would best option. MySQL does not need to be intensive, you just need to be careful with how you apply it.

For starters, have you looked at the MySQL resource? If so, were you having any particular issues with it?

JSON Format ^

You should think about what data you need to query when choosing a storage type. I think you are unsure whether you should use a relational DB or flat storage (like SQLite, JSON, MongoDB or so).

Have a look at DynamoDB’s documentation. It has a very good section explaining the key differences and when to choose what. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-general-nosql-design.html#bp-general-nosql-design-vs-relational

For your use case a flat storage might be a good idea considering your data is tied to just one “entity” (the player). If you are going to mess with trading items/vehicles/weapons or any other sort of data exchange between players, perhaps you want more flexible storage in form of a relational DB (MySQL, PostgreSQL, your choice).

1 Like

Thank all you guys for the help! I think I’m going to try using a flat storage option first, most likely JSON because I would like to use SQLite (mainly for the better reliability) but I cannot figure out how to do it. From what I could find, essentialmode actually writes and compiles binaries in C (which is a language I’m unfamiliar with), and even knowing that I have no idea how they got it to work with FiveM.