Game Database. SQLite, XML, JSON or PlayerPrefs?

Hi guys!
Basically the question is in the title:
What is the best way to store game data if:

  1. It is levels data
  2. Items data
  3. Initial game settings
  4. Player profiles
  5. Social data cache


  1. Data should be updatable via network (new levels, new items)
  2. There should be some kind of pro-level editor for this database.
  3. There should be way to link (somehow) game resources to DB items. For example new level prefabs and item textures should be easily linked to DB fields.
  4. It’s mobile project (iOS/Android)

Any ideas or even may be live examples

Hi Artfabrique,

It depends a lot on how flexible you want it, what platform and what scale.

  1. PlayerPrefs are very fast, native and easy to use, they just save some values, strings or such along with the game, but they are not very database alike, but it works well for things like ‘remember my username’ on login screens for example. Also on web-player they are limited in size.

  2. XML is written out as a text document, not quite the database yet, but it is easy to implement, and easy to import/export values to, there’s an example of the wiki just google xml + unity, there’s both a js and c example you can backwards engeneer. XML is good for configuration files, that you can change outside of the game, in a slightly good way. Json is slightly the same as this though there are some native differences. Also XML can be tricky on phone, you need to use some xml-lite libs, but it’s do-able.

  3. SQL is the online, real database solution. But it require a lot more work to implement, and it require you to actually know what you’re doing, there’s no easy drag n drop solution. But for large databases, it is the best of these options, and it is good for lookups.