AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   KeyValues vs. MySQL database for data storage? (https://forums.alliedmods.net/showthread.php?t=333038)

kratoss1812 06-15-2021 17:27

KeyValues vs. MySQL database for data storage?
 
Hi! I was wondering if it would be a good ideea to use keyvalues instead of a database to store player's items as in an inventory. The reason behind this is that it's much easier to work with KeyValues and just loop through them than using SQL callbacks .. at some point it gets messy.

The size of the tree could get thousands of entries such as

PHP Code:

"STEAM_0:1:65095681"
{
    
"item_1"
    
{
        
"value1" "someValue"
        "value2" "someValue"
    
}
    
    
"item_2"
    
{
        
"value1" "someValue"
        "value2" "someValue"
    
}


this could get a lot of entries for each player ever connected

my plan is to use KeyValue.Import and save the output into StringMaps for where the key is each connected player auth method (steamid, accountid, etc, basically the "STEAM_0:1:65095681" in my example) of each player so I don't have to use the main tree every time in order to get the best performance out of this


All times are GMT -4. The time now is 16:18.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.