questions sqlite and ini

Started by Luis_Labarca, Nov 02, 2016, 11:08 PM

Previous topic - Next topic

Luis_Labarca

Hello we all know that saving data continuously with sqlite does lag
my doubt is if I keep data continuously with ini produceria lag?

Another thing and I could tell the advantages and desventanjas of ini and sqlite
My server RP
IP: 51.222.28.159:8194

jWeb

Huh? The coca happened here?

Kewun

#2
Ini also does "lag". But I don't understand as my server doesn't lag by it. I never use sqlite because it sucks for me. Use ini, I don't really understand why people say it lags shit.
I'm using like 50 ini data's, and no lag.

Thijn

SQLite doesn't lag if you use it properly. INIs are always a bad idea. They're not made for storing and retrieving data for VC:MP.

Luis_Labarca

Quote from: Thijn on Nov 03, 2016, 07:55 AMSQLite doesn't lag if you use it properly. INIs are always a bad idea. They're not made for storing and retrieving data for VC:MP.
aah ok thanks
My server RP
IP: 51.222.28.159:8194

Luis_Labarca

Quote from: Kewun on Nov 03, 2016, 06:35 AMIni also does "lag". But I don't understand as my server doesn't lag by it. I never use sqlite because it sucks for me. Use ini, I don't really understand why people say it lags shit.
I'm using like 50 ini data's, and no lag.
good used the function ini in them functions that I gave lag with sqlite usare the ini for some things thank you for comment
My server RP
IP: 51.222.28.159:8194

Luis_Labarca

My server RP
IP: 51.222.28.159:8194

Mötley

#7
Well I did not see the vcmp version of FBS, So hear is the LU version.

Your real question should be "How are you going about reading and writing data", Are you writing it and retrieving it like these examples?
function PlayerKills( player )
{
// This gets the players kill count
local Kills = hsh_Stats.Get( player.Name.tolower() + "Kills" );
return Kills;
}

function IncreaseKills( player )
{
// This increases the amount of kills a player has
hsh_Stats.Inc( player.Name.tolower() + "Kills", 1 );
}

function IncreaseDeaths( player )
{
// This increases the amount of deaths a player has
hsh_Stats.Inc( player.Name.tolower() + "Deaths", 1 );
}

function PlayerCash( player )
{
// This gets the amount of cash that a player has
local Cash;
Cash = hsh_Finance.Get( player.Name.tolower() + "Cash" );

if ( Cash ) return Cash;
else return 0;
}

function IncreaseCash( player, amount )
{
// This increases the amount of cash a player has
hsh_Finance.Inc( player.Name.tolower() + "Cash", amount );
player.Cash += amount;
}

function PlayerBank( player )
{
// This gets the players bank balance
local Bank;
Bank = hsh_Finance.Get( player.Name.tolower() + "Bank" );

if ( Bank ) return Bank;
else return 0;
}

function DecreaseCash( player, amount )
{
// This decreases the amount of cash a player has
hsh_Finance.Dec( player.Name.tolower() + "Cash", amount );
player.Cash -= amount;
}

function IncreaseBank( player, amount )
{
// This increases the players bank balanace
hsh_Finance.Inc( player.Name.tolower() + "Bank", amount );
player.Cash -= amount;
}

OR are you storing the data in a array/class and writing the data every five minutes or so?

This is something you should figure out, As it really matters to which way you plan to use your system for storing the players data.

 :P Theres not ONE array/class in FBS ;D

KAKAN

My suggestion, load everything into arrays/tables. Done, now your performance is very fast because you fetch from RAM, which is faster than SSD or HDD.
oh no

EK.IceFlake

Quote from: KAKAN on Nov 03, 2016, 04:29 PMMy suggestion, load everything into arrays/tables. Done, now your performance is very fast because you fetch from RAM, which is faster than SSD or HDD.
oh f* my server crashed
Exactly.

KAKAN

Quote from: EK.CrystalBlue on Nov 04, 2016, 10:25 AM
Quote from: KAKAN on Nov 03, 2016, 04:29 PMMy suggestion, load everything into arrays/tables. Done, now your performance is very fast because you fetch from RAM, which is faster than SSD or HDD.
oh f* my server crashed
Exactly.
lol? That won't crash the server unless you got a stone age PC.
oh no

EK.IceFlake

No I mean if your server crashes then data is lost -- imagine an admin just went through 2000 accounts and did some shits and now the server crashed.
Or a player won 16M in an event

KAKAN

Quote from: EK.CrystalBlue on Nov 04, 2016, 12:41 PMNo I mean if your server crashes then data is lost -- imagine an admin just went through 2000 accounts and did some shits and now the server crashed.
Or a player won 16M in an event
you can keep updating. But, why would the server crash? Use SLC's plugin, do some really good scripting and your server won't crash.
oh no

EK.IceFlake

Quote from: KAKAN on Nov 04, 2016, 05:24 PM
Quote from: EK.CrystalBlue on Nov 04, 2016, 12:41 PMNo I mean if your server crashes then data is lost -- imagine an admin just went through 2000 accounts and did some shits and now the server crashed.
Or a player won 16M in an event
you can keep updating. But, why would the server crash? Use SLC's plugin, do some really good scripting and your server won't crash.
Power fault?

.

#14
Quote from: EK.CrystalBlue on Nov 04, 2016, 06:27 PMPower fault?

I believe that's considered to be your fault for hosting on your local PC. Besides, it's not as if you've never synchronized with the database. Who in their right minds read from database and only save on shutdown? So what? a few nabs lost a few stats from the past minute. Will the world end somehow? No! The problem was you hosting on you grandma's PC. Get a VPS ffs.

But that's not the issue here. The issue is that people don't know how to tackle SQLite and use it properly. So they just claim SQLite sucks and lags. There's a saying here in my country "Cats will say it stinks where they can't reach". And I find that to describe many of you that keep saying SQLite sucks.

You don't understand transactions and how costly they are to insert statements. And the fact that each query will demand a transaction. Regardless of who provides it.

The second and even bigger problem is that SQLite has no caching mechanism. By default, it uses a very safe writing mechanism where it makes sure that every single bit you specified is written to the disk and then it proceeds on you the next query (*cough* transaction *cough*). Read more. But used properly, you can get around that.

Get real people. INI can't do sh!t when it comes to complex database operations. There's no point in giving you examples because you wouldn't understand sh!t.
.