• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Tables VS Sql Queries

but I believe sending a SQL Qeury is probably more efficient than opening a file and reading it.
Didn't think about it that way...

@Syntax I would have to say that those were more pro's towards sql rather than con's towards lua, but I guess it's the same thing in reality. I suppose I really should do more digging into sql in general, because I was just about to ask you again what is NoSql, and so I googled it, and there are many of different sql services out there. That would be what I need to do more research on I suppose... Thanks for showing me these things...

Thank you to everyone on this thread, I wasn't searching for a definitive answer to a question I didn't ask, didn't find one either. LMAO! If any of that makes any sense, but I was really trying to see the advantages and disadvantages of both languages, and you guys have helped to show me some of them, didn't realize sql could be so powerful, definitely hadn't seen that before, time to try some alternates...

To keep the topic going just a little longer, curiosity has me, what would be some things you guys would say should be used for one and then for the other? I mean like summs example, yeah obviously we don't want to store a quest id in the database, but thinking on a bigger scale, like the pet system. Lets use that for example, who thinks the pet system should be written like zbizu says he is going to do for sql, or like the others were working on in lua? Granted the system is still going to be written in lua, but I mean the data that is stored, for a system like that...
 
I like to add any information I might want to know in the future into the SQL.

For example, I make a Player entry for each monster name in the SQL, then every time a monster drops an item I save the entry in LUA with the time it was dropped. Then when the server saves I save that information into SQL.

For Example:
Code:
["Rat"] = {
       ["CORPSEID"] = AMOUNT,
       ["ITEMID"] = AMOUNT,
       ["ITEMID"] = AMOUNT, 
      {
["DRAGON"] = {
       ["CORPSEID"] = AMOUNT,
       ["ITEMID"] = AMOUNT,
       ["ITEMID"] = AMOUNT,
      }

Then save the above information for each creature, with a timestamp (each hour) into the SQL.

This means, I can see how much of each item is dropped by each creature every hour, I can make graphs, see if one monster is giving away too much loot, or what monsters players hunt more often, etc.

SQL is basically a tool, that allows you to manage information more easily. I would hate to open up tons of LUA files trying to look for the information I want.
 
Back
Top