For many years, multithreading has been a common technique to extract more performance from the machine. Today, everything has to do with horizontal expansion or adding more virtual machines to the work pool. The Minecraft server is still stuck in the past in some ways, because it supports neither multithreading nor horizontal scaling. [Jackson Roberts] Decided to change all of this Support thousands of players instead of dozens of players by hacking into Minecraft.
Since the server is single-threaded, having more than 100 players on a server may slow it down.Some modules try to optimize and speed up existing servers, but [Jackson] Want more. The early proof of the concept is to divide the world into separate servers, each with 64×64 blocks (a block is defined as a 16x256x16 world volume by Minecraft). When crossing the border, entities such as players and zombies will move from one server to another. Although feasible, there are some problems with the demo, for example, if the server fails, some parts of the world will be inaccessible. The border is also harsh, because you have to reconnect and cannot see players outside the server.
Instead of dividing the world, [Jackson] A method of splitting players has been adopted, and there are some backing stores for persistence and broadcast changes. The agent is located in front of multiple Minecraft servers, each of which is connected to a WorldQL server (spatial database based on Postgres). Each server reports the player’s location to the WorldQL server and receives updates of its loading location. When the server goes online, it catches up with the changes stored in WorldQL and starts to synchronize, allowing the server to automatically scale. There are some core game mechanics that are not yet ready for prime time, such as NPC and Redstone, but the progress so far is significant.
this The code for the Minecraft plugin is on GitHub, But there will be more in the future. So if you are interested in something more vanilla, why not marvel at the fully playable Pokemon Red in vanilla Minecraft?