Contents
When should you use a SQL database?
SQL databases provide great benefits for transactional data whose structure doesn’t change frequently (or at all) and where data integrity is paramount. It’s also best for fast analytical queries. NoSQL databases provide much more flexibility and scalability, which lends itself to rapid development and iteration.
How do games use databases?
They store binary data within tables that look like (char_id, last_update, data) and the game servers periodically serialize a character into a byte array, then push to DB servers. That’s the same method used to transfer players between servers. Everyone is just a chunk of data.
Can a game be saved in a SQL database?
Moreover there would be no need for savegames since the hole game state is saved in the database. Last but not least, expanding the game to an online game would be relative easy because there already is a place where the hole game state is stored. An SQL database is not nearly fast enough to use for realtime reading and writing game information.
How to choose how to store game data?
On the client side, you might store cached data about other players in a non-relational database (as mentioned above). On the server side, you’re storing all game data in a relational database to persist it. And then again on the client side you’re probably storing log data, configuration data, etc. in XML/flat files for easier accessibility.
Do you need a database for online games?
If you’re talking about games with an online component, though, that would be crazy. Go the database route and save yourself the headache. Let the server manage all of your data using a back-end cluster. Hope some of this feedback helps.
How is data stored in a SQL database?
An SQL database is not nearly fast enough to use for realtime reading and writing game information. Such data is almost always kept in memory, in traditional data structures.