Skip to content

Architecture

Viet Nguyen edited this page Mar 22, 2016 · 4 revisions

#Architecture Minecraftly operates under the premise that everything can fail at anytime, so we focus on designing a high availability, fault tolerant system that can withstand failure at the server, database, or network level.

First, let's visualize the stack:

                           Minecraft Players
                                  
                                  |
                                  |
                                  |
                                  
      +----------------- Network Load Balancer -----------------+
      |                           |                             |
      |                           |                             |
      |                           |                             |
   BungeeCord 1              BungeeCord 2                 BungeeCord n
      |                           |                             |
      |                           |                             |
      |                           |                             |
   Spigot 1                    Spigot 2                      Spigot n
      |                           |                             |
      |                           |                             |
      |                           |                             |
      +------------------- NFS, MySQL & Redis ------------------+
      

According to the drawing above, you can clearly see that all BungeeCord & Spigot servers share the same NFS, MySQL and Redis servers. In this case, we call such shared server "endpoints" (because behind the endpoints maybe a cluster of servers as well.

There are an infinite amount of BungeeCord and Spigot servers, having the same exact configuration. It doesn't matter how many BungeeCord or Spigot servers out there. As long as they use the same NFS mount point, the same MySQL server, and the same Redis server, then the player's experience will be unified.

##Single Machine Environment (for testing) To build a single machine test environment, it will be visualized like this:

                           Minecraft Players
                                  
                                  |
                                  |
                                  |
                                  
   BungeeCord 1 (port 25565)                    BungeeCord 2 (port 25566)
      |                                                         |
      |                                                         |
      |                                                         |
   Spigot 1 (port 25567)                           Spigot 2 (port 25568)
      |                                                         |
      |                                                         |
      |                                                         |
      +--------------------- MySQL & Redis ---------------------+
      

This testing environment is very simple. It works with traditional server cluster (VM, dedicated servers, etc...). It can also work with cloud servers (Amazon Web Services, Google Cloud Platform, Microsoft Azure).

How do I store world A, B, C, D, E, and F for the respective players and load them as fast as possible, using traditional way of saving worlds on disk?

The answer is to have all servers using the same "global worlds" folder, storing all the worlds for the respective player there.

For multiple servers to "share the same folder", the simpliest way is to use NFS (Network File System) server.

Clone this wiki locally