Search Unity

is it possible to synchronize 2 Servers ?

Discussion in 'NetCode for ECS' started by Opeth001, Dec 12, 2021.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    Hello Everyone,

    i'm thinking about Servers and Fault tolerance.
    is it possible to create and synchronize a new server instance with an existing one to replace it ?

    Thanks!
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    Sure. To be able to have two or more servers actually running a fully consistent game world, ready to fail over in case of issues, you need these elements:

    * all servers must run the same code
    * all servers must have a copy of the same state
    * exactly one server must be the active "decider" responsible for any particular part of the game state
    * all the other servers must be informed of the decisions made by the active deciding server, or prove they always make the same decisions every time
    * in the case of a server failing, all the remaining servers must detect this and agree on new decider for the failed server's responsibilities
    * in the case of adding a server back into service, it must be able to confirm it has an accurate copy of the same state

    These are the same constraints in mission-critical control systems like jet engines.
     
    vectorized-runner and Opeth001 like this.
  3. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    is it possible to create a new server instance in the middle of a game and synchronize its game state with the current active/decider server?
    Is there already a Netcode way or good practice to do it ?
    Thanks
     
  4. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    The answer is almost always yes. It's just software. However, it can be challenging in general, and I have not set up a server for a Unity game nevermind a cooperative server ring/cluster for a Unity game. There may be some assets or technologies which fill this gap.
     
    Opeth001 likes this.
  5. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    900
    we don't support server migration at the moment (in 0.5). It is on our roadmap (as a feature) but I don't have an estimate right now when it will become available.
    There are a couple of major changes that need to be done in order to make work with the current architecture.
     
    Opeth001 likes this.