Server Friendly Idea (may have been discussed before)

    Joined
    Jul 11, 2013
    Messages
    191
    Reaction score
    7
    I am definitely no expert at Java or code management, but I was wondering if it would be possible to implement data compression. This would be very good for servers and clients alike. With compression, data is less MB hogging and can allow for better connections and cheaper servers. I do not know how hard this would be to implement but it seems like a decent idea to say the least. I can live and play without it, but it would be nice to have.
     
    Joined
    Aug 15, 2013
    Messages
    52
    Reaction score
    0
    • Legacy Citizen
    like Minecraft and StarMade have to be very careful with how it\'s implemented. Here\'s some things compressed server files are good at:

    • Read speed (the bottleneck is usually in disk I/O, so fewer bytes read = faster)
    • Storage space (obviously)
    • Mass data writing

    However, there\'s the one thing compression is often bad at:

    • Incremental data writing

    Many compression algorithms need to know a lot about the data they\'re storing as a \"big picture\" before they can begin to efficiently zip it up. This means that when a small change is made, depending on which algorithm you use, the entire set of data it belongs to may need to be re-compressed, which can sometimes stall on things like block updates.

    This can be helped by delaying disk writes until the data is out of context, such as when all players in the area have logged off, but keeping this data in memory for long periods without committing changes to permanent storage risks crippling data loss in the case of a crash.

    More reliable methods exist, such as keeping an uncompressed copy of any loaded data on recoverable temporary storage, but this kind of duplication may ruin any benefits of compressing in the first place.

    What it comes down to is that there really isn\'t a single correct way to do this, but it\'s definitely possible. However, since the server\'s needs play a large factor in the performance you\'ll get out of each implementation, it\'s probably best exposed as a config option.



    And I\'ve just realized while typing this that you\'re probably talking about network traffic compression, which is well outside my experience. I\'ll leave what I just said here for future Googling, but I\'m not the right guy to discuss what you were really asking for. Sorry. :P