Jump to content

[Solved] setAccountData or own account database?


JAY.ANN

Recommended Posts

  • 2 weeks later...
On 16/08/2022 at 13:01, JAY.ANN said:

It's pretty comfortable to use standard MTA accounts databases but does it have performance issues as setElementData or smth?

SetElementData is data stored on the player temporarely, if the player logs off, or the server shuts down, you will lose that information. It is stored inside GTA memory and is synced with all players and the server unless specified otherwise.

SetAccountData only allow you to insert key/value pairs into a fixed db. You have no real control over it, and with lots of data this could be bad for performance because it'd need to do a lot of queries (via getAccountData) for each key/value pair that you saved to a player account.

MySQL allows you to structure your database and gives you control over what you put in your database and how you modify and query the data. You can also access the data from other places like a website. This will give you the best optimization.

If you're new or uncomfortable with MySQL you could try using SQLite instead, which creates a new .db file for you which you gives you similar control over it as MySQL except that you don't have a address from which you can access it. I recommend this if you're new and want to try out MySQL for the first time. You don't have to install MySQL to your desktop or server with this option.

You can use setAccountData for small gamemodes if you don't need to store a ton of data per user, otherwise use MySQL or SQLite.

 

Hope this helps.

 

Edited by Tails
  • Thanks 1
Link to comment
On 29/08/2022 at 05:43, Tails said:

SetElementData is data stored on the player temporarely, if the player logs off, or the server shuts down, you will lose that information. It is stored inside GTA memory and is synced with all players and the server unless specified otherwise.

SetAccountData only allow you to insert key/value pairs into a fixed db. You have no real control over it, and with lots of data this could be bad for performance because it'd need to do a lot of queries (via getAccountData) for each key/value pair that you saved to a player account.

MySQL allows you to structure your database and gives you control over what you put in your database and how you modify and query the data. You can also access the data from other places like a website. This will give you the best optimization.

If you're new or uncomfortable with MySQL you could try using SQLite instead, which creates a new .db file for you which you gives you similar control over it as MySQL except that you don't have a address from which you can access it. I recommend this if you're new and want to try out MySQL for the first time. You don't have to install MySQL to your desktop or server with this option.

You can use setAccountData for small gamemodes if you don't need to store a ton of data per user, otherwise use MySQL or SQLite.

 

Hope this helps.

 

That's the information i was looking for. Thank you!

  • Like 1
Link to comment
  • Vinyard changed the title to [Solved] setAccountData or own account database?
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...