Mysql Question

Discussion in 'Spigot Plugin Development' started by Mystic_Mark_, Jun 30, 2018.

  1. I came across some problems with transfering data over my Bungeecord Network.
    The data is loaded before it's saved, But what is better. Directly updating or Saving it in a class first and then saving it on disconnect.
     
  2. I always vouch for direct saving since there's less chance to lose data. It wouldn't fix your problem though, the race condition still exists.

    You'd need to somehow force the player to wait before connecting to the other server, even if they disconnect and attempt to connect directly themselves.
     
  3. I had the same problem. I solved it using bungee as a data loud for direct information. Although data might come after the load, I created my system so I could just send the newer version to the second server even if it was way later.
    This might not help you though. So I would recommend storing most of the data instantly or sending them in groups if you send many at a time.
     
  4. FrostedSnowman

    Resource Staff

    Since I already use redis for my setup, I decided to have it fix this issue, too.

    Basically, I save data and then the other server doesn't load the data until it gets a response back from the redis system indicating that the data is successfully saved / updated.