Results 1 to 10 of 56

Hybrid View

  1. #1
    Player
    Larirawiel's Avatar
    Join Date
    Feb 2019
    Location
    Aldrassil
    Posts
    2,560
    Character
    Larirawiel Caennalys
    World
    Shiva
    Main Class
    White Mage Lv 100
    Quote Originally Posted by JTWrenn View Post
    So...
    35.8 million subscribers * 20913 equipable items *2 bytes = 1497.37 GB for the entire currently active population. It would require account wide sharing of the unlocked looks, but I also don't think every item has a unique looks so I think it could be done. Say double for old accounts, and that is totally doable. Each server would only need an extra TB and they would have a ton of space to handle it.

    So storage size isn't it, but technical systems might be I just can't figure out what weird reason that would be though.
    Sorry, but this is not true.

    For booleans you need one bit and not two bytes. One byte is 8 bit. So you could store true and false in one byte. Take the first bit of a byte and flip it to 0 or 1 and you are done.

    And your assumption, that there is one or two bytes for every item for every player in the game would be very inefficient in terms of storing and retrieving the data. The cardinality of the true/false column would be very low and this would propably lead to so called "full table scans". And full table scans are very slow. Especially when you have this huge amount of data.

    And this is the reason why almost nobody would store every item and every player and put a true/false-flag on it. Usually, it is made with a so called "m:n"- or many-to-many-relationship. It is way more efficient to store and retrieve the data. Because you would only store records of items, which the player really got. And the bridge table between player and item would contain many different IDs. The cardinality would be way better compared to a true/false column (yes, i know, some databases have special indexes for booleans) and a database index could be used.


    Cheers
    (0)
    Last edited by Larirawiel; 08-26-2022 at 06:16 AM.

  2. #2
    Player
    JTWrenn's Avatar
    Join Date
    Jul 2019
    Posts
    72
    Character
    Brok Samson
    World
    Adamantoise
    Main Class
    Blacksmith Lv 89
    Quote Originally Posted by Larirawiel View Post
    Sorry, but this is not true.

    For booleans you need one bit and not two bytes. One byte is 8 bit. So you could store true and false in one byte. Take the first bit of a byte and flip it to 0 or 1 and you are done.

    Cheers
    I get the idea of a boolean needing one bit, but that is not how they are stored in an SQL database. Different systems store them in different ways, but most are 1 byte, or two bytes because of extra things attached to them for the storage. Like you might just have the data saying true or false, but how do you differentiate that boolean variable from the next one in it's own table? That requires unique identifiers so you end up using up more space.

    I agree there are likely more efficient ways to do it, but if you had a database and you pulled 25 at a time, and then checked if they were available as you swapped pages with it, it would not be inefficient. You would do chunks at a time on a local database of items and options checked against an online database of unlocked true or falses. You would split up the database by types so it is pulling from different chunks and the amount of searching would be fairly minimal. As has been pointed out WoW does it just fine.

    Now you could make it more efficient in processing by storing a table with everything in it to show the item, you wouldn't need anything but an item number, and then pull them. So using a unit32 field you could just make a list like that and it would work fine as well, but the pulls would be the same, as you are just pulling the look into a box based on the number, but it would cut out one search check at the cost of an extra 2 bytes per look.

    It's in the weeds though. I was just trying to show that even in the worst case scenario the amount of space needed is not that big. 1.5tb for an entire player base up to maybe 3 tb if you just stored a list of numbers that correspond to the item identifier. Space was the debate on this particular response. I do agree the id storage would be more efficient for processing, but no boolean's are not usually stores as bits even though it is possible to do it that way.
    (0)