Any way to make awesome database? + secure scripts

Hello I know how to make a standard database

but it is not enough for me

I tried:

  • Read other topics
  • Look for video tutorials

I don’t want someone to write code for me I just wish to learn how to do code secure scripts and secure databases

I have a database I’m working on, and I think it’s pretty awesome. :wink:

If you’re interested in security, you should look into session locking. You should also be making sure that you’re not allowing people to save incorrect data. For example, make sure not to save the players data until every ‘action’ on their data is completed, like accepting a trade or buying a piece of furniture.

If you want it to be easy to use and have good organization, I suggest metatables and OOP. It seems really tough to learn, I avoided them for the better part of more than half a decade, but I suggest them. They aren’t necessary for data saving, but I find them really, really easy to use when I want to modify certain tables, multiple different values or custom metadata in the players data while not having to worry that it’s missing (I use metatables for their inheritance as well! Just gives me peace of mind).

My database also has a few standard functions, like saving data while the game is shutting down, or autosaving every 10ish minutes. The only reason I autosave at all is because I feel like there’s a chance that when a server is shutdown, all the requests might throttle because of the request limit.

Also for my logic ‘hierarchy’:

I have a script called database, that sees when a player joins, leaves, and is shutdown. As well as looking at remotes to see when a player wants to load their data.

This database script will handle all of the guard clauses, like if the player (exploiter) tries to load a data save that they don’t have (my game uses save slots), or if the player tries to load their data while it’s loaded in another server (session locking!), etc.

If the server determines that it’s safe, it calls the metatable function :Update(), :GetData() or whatever to get their data and send it back to the player so it can show up on their screen and whatnot.

2 Likes

Good reply, I will try to learn OOP and what you say. Thanks, I wait for other replies!