Difference between revisions of "Database backends"

From Luanti Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
Minetest supports several database backends. This page provides a comparison of all three (actually four, but the ''dummy'' backend isn't useful) backends.
+
Minetest supports several database backends. This page provides a comparison of all 3 (actually 4, but the ''dummy'' backend generally isn't useful) backends.
  
 
The database backend is set using the <code>backend</code> setting in ''world.mt''.
 
The database backend is set using the <code>backend</code> setting in ''world.mt''.
  
 
If you want to migrate a world to a new backend use <code>minetestserver --migrate [name of new backend] --world [path to your world directory]</code>
 
If you want to migrate a world to a new backend use <code>minetestserver --migrate [name of new backend] --world [path to your world directory]</code>
 +
 
= Comparison table =
 
= Comparison table =
  
Line 31: Line 32:
 
| Redis
 
| Redis
 
| style="background-color: #9F9;" |
 
| style="background-color: #9F9;" |
'''Very good''' ''(most data always kept in RAM)''
+
'''Very good''' ''(most data is always kept in RAM)''
 
| style="background-color: #9F9;" |
 
| style="background-color: #9F9;" |
 
'''Good'''
 
'''Good'''
 
| style="background-color: #F99;" |
 
| style="background-color: #F99;" |
'''None''' ''(needs redis server)''
+
'''None''' ''(needs Redis server)''
 
|-
 
|-
 
| Dummy
 
| Dummy
 
| style="background-color: #9F9;" |
 
| style="background-color: #9F9;" |
'''Very good''' ''(data always kept in RAM)''
+
'''Very good''' ''(all data is always kept in RAM)''
 
|  |
 
|  |
'''N/A''' ''(nothing is actually saved)''
+
'''N/A''' ''(nothing is saved to disk)''
 
|  |
 
|  |
'''N/A''' ''(nothing is actually saved)''
+
'''N/A''' ''(nothing is saved to disk)''
  
 
|}
 
|}
  
 
== SQLite3 ==
 
== SQLite3 ==
SQLite3 is the default backend for all Minetest worlds, it is supported by every Minetest builds and is therefore the standard database format that is used to distribute worlds.  
+
 
 +
SQLite3 is the default backend for all Minetest worlds, it is supported by every Minetest build and is therefore the standard database format that is used to distribute worlds.  
 +
 
 
== LevelDB ==
 
== LevelDB ==
LevelDB is mostly used on servers because of it's improved reliability and the ability to use more than 4GB space.
+
 
 +
LevelDB is mostly used on servers because of its improved reliability and the ability to use more than 4 GB of space.
 +
 
 
== Redis ==
 
== Redis ==
 +
 
Redis support was added to Minetest in April 2014, redis is mainly useful for servers as it allows multiple worlds to be stored in one redis instance.
 
Redis support was added to Minetest in April 2014, redis is mainly useful for servers as it allows multiple worlds to be stored in one redis instance.
  
 
Information about setting up a redis server can be found here: http://redis.io/topics/quickstart
 
Information about setting up a redis server can be found here: http://redis.io/topics/quickstart
=== world.mt settings for redis ===
+
 
 +
=== world.mt settings for Redis ===
 +
 
 
<code>redis_address</code> '''--''' The IP or hostname of the redis server.
 
<code>redis_address</code> '''--''' The IP or hostname of the redis server.
  
Line 61: Line 69:
  
 
<code>redis_hash</code> '''--''' Hash where the MapBlocks are stored in, if you want multiple worlds in one redis instance this needs to be different for each world.
 
<code>redis_hash</code> '''--''' Hash where the MapBlocks are stored in, if you want multiple worlds in one redis instance this needs to be different for each world.
 +
 
== Dummy ==
 
== Dummy ==
 +
 
A dummy database backend, which stores all MapBlocks in RAM without saving them and will most likely not be of any use for you.
 
A dummy database backend, which stores all MapBlocks in RAM without saving them and will most likely not be of any use for you.
 +
  
 
[[Category:Server]]
 
[[Category:Server]]
 
[[Category:Map]]
 
[[Category:Map]]

Revision as of 13:11, 13 May 2014

Minetest supports several database backends. This page provides a comparison of all 3 (actually 4, but the dummy backend generally isn't useful) backends.

The database backend is set using the backend setting in world.mt.

If you want to migrate a world to a new backend use minetestserver --migrate [name of new backend] --world [path to your world directory]

Comparison table

Backend Speed Reliability Compatibility with builds
SQLite3

Acceptable

Acceptable (db can corrupt if accessed while open)

Very good (supported by any Minetest version)

LevelDB

Good

Good

Mostly supported

Redis

Very good (most data is always kept in RAM)

Good

None (needs Redis server)

Dummy

Very good (all data is always kept in RAM)

N/A (nothing is saved to disk)

N/A (nothing is saved to disk)

SQLite3

SQLite3 is the default backend for all Minetest worlds, it is supported by every Minetest build and is therefore the standard database format that is used to distribute worlds.

LevelDB

LevelDB is mostly used on servers because of its improved reliability and the ability to use more than 4 GB of space.

Redis

Redis support was added to Minetest in April 2014, redis is mainly useful for servers as it allows multiple worlds to be stored in one redis instance.

Information about setting up a redis server can be found here: http://redis.io/topics/quickstart

world.mt settings for Redis

redis_address -- The IP or hostname of the redis server.

redis_port -- The port of the redis server. Optional, default: 6379

redis_hash -- Hash where the MapBlocks are stored in, if you want multiple worlds in one redis instance this needs to be different for each world.

Dummy

A dummy database backend, which stores all MapBlocks in RAM without saving them and will most likely not be of any use for you.