Roaming databases
A roaming database is a database that persists across game servers and roams to the game server where it’s needed. When a game server interacts with a roaming database, it’s working with a local copy for performance, but you can regularly synchronize the data to the cloud for durability. Because roaming databases are separate from game servers, you can shut down a game server without losing the data in the roaming database.
Note: An embedded database powers roaming databases to handle even the most demanding real-time loads.
The Roaming Databases SDK uses a key-value interface, allowing you to store arbitrary strings or bytes per key. The SDK also provides a category that combines with the key to create a unique key to provide easier namespace management than raw string concatenation.
A practical example of using roaming databases is a sandbox game that allows for multiple players and a persistent world state. In this example, you might place dynamic objects in the world in an objects
category with automatically incrementing IDs, then load the world by iterating over all keys in the objects
category. You might also serialize player data to JSON and store it in a player_inventory
category with the player ID as the key, enabling you to load and deserialize the player data when the player joins the world.