I was wondering, what kind of database does Minecraft use? Is it a relational database, maybe something common like MySQL? Do we even know what he's using?

And maybe even a better question, SHOULD he be doing it that way? What type of database should be used?

  • 7
    \$\begingroup\$ The format currently used for level data is described at minecraftwiki.net/wiki/Beta_Level_Format. \$\endgroup\$ Apr 15 '11 at 18:59
  • 4
    \$\begingroup\$ I love the "should" question. As if Notch is wrong. Hah. :-P \$\endgroup\$
    – Ricket
    Apr 15 '11 at 21:22
  • 4
    \$\begingroup\$ Do you mean the database on the client, or the database on the server that's managing authentication, etc. \$\endgroup\$
    – Tim Holt
    Apr 15 '11 at 21:50
  • 1
    \$\begingroup\$ Managing authentication is not a database. It's a plain text file with account names, called Whitelist ;) \$\endgroup\$
    – Marco
    Apr 15 '11 at 23:03
  • 2
    \$\begingroup\$ @Ricket What are you suggesting? Notch is a god amongst men! ;) \$\endgroup\$ Apr 16 '11 at 16:23

Minecraft saves the world data and the player data. Saving the world data is done in multiplayer and singleplayer with the same method. It saves everything in a single .mcr file.
Previous versions of minecraft saved the data in a file structure with many files, which was slower, I think.
I don´t know this exactly, but I guess that a database for world saving would be not the best, because the data is saved in intervals of 15 minutes or so and a database is not designed for saving all data at the same time.

The player data on multiplayer servers is saved in a .dat file. I don´t think that this player data is saved in a SQLite database or something similar, because using a database for requesting once and saving every 5 minutes or so is also not the best.

To sum it up:
I think Notch doesn´t even use any database, because it does not make sense since every data is kept in memory and only saved in intervals of minutes.

  • 3
    \$\begingroup\$ Notch uses a straight up binary format that's been compressed. His reason? Performance and space probably. \$\endgroup\$ Apr 16 '11 at 1:28
  • \$\begingroup\$ I am pretty sure the .dat is used in singleplayer too, for player positions and data. \$\endgroup\$ Apr 16 '11 at 16:24
  • \$\begingroup\$ @The Communist Duck: I looked into my savegames and could only find a .mcr. A .dat would make more sense, but maybe it is bundled with the .mcr. \$\endgroup\$
    – Marco
    Apr 16 '11 at 16:47
  • \$\begingroup\$ There is a level.dat for every level; I use it with the level tools site (URL forgotten) to find seeds and do the random-teleport thing. \$\endgroup\$ Apr 16 '11 at 17:27

Not the answer you're looking for? Browse other questions tagged .