mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-25 12:15:12 +01:00
Updated database details and added philosophy.
parent
1df1e0368a
commit
8cbaa0a9ec
@ -1,8 +1,15 @@
|
||||
# Introduction
|
||||
|
||||
BentoBox provides a database for you so you do not have to make one yourself. The BentoBox database can be chosen to store data in flat file, MySQL or Mongo. You do not have to worry or care about which one is used. BentoBox's database stores Java Objects by serializing them. For MySQL and Mongo, the java object will be converted to JSON and stored as JSON. For flat file, the object is converted and stored as YAML.
|
||||
BentoBox provides a database API for developers so you do not have to make one yourself. The BentoBox database can be chosen to store data in a flat-file, MySQL, Mongo, SQLite, PostGreSQL, MariaDB, etc. You do not have to worry or care about which one is used. Note that YAML is no longer supported as a database, however it is used for configuration files via the Config API.
|
||||
|
||||
# How To
|
||||
## Philosophy
|
||||
|
||||
We have taken a "NoSQL" approach to the BentoBox database. i.e., we store serialized Java objects as JSON "blobs" in the database. Each table in the database is assigned to store a specific Java object, e.g., islands, players, challenges, etc. and each entry in the table is one object. The tables have two columns - a unique ID and the JSON object. Databases such as PostgreSQL can store these JSON objects in a binary form, which makes them handle this approach efficiently.
|
||||
|
||||
### How do I access the data from outside BentoBox?
|
||||
Most of the supported databases, e.g., MySQL, PostgreSQL, etc. support queries on the JSON data directly. The only ones that do not are flat-file based, i.e., JSON and SQLite. Therefore, you should look up the documentation on how to make JSON queries for your database.
|
||||
|
||||
## How To
|
||||
|
||||
To store a class in the BentoBox database do the following:
|
||||
|
Loading…
Reference in New Issue
Block a user