Database:Documentation

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(added reference to 'users' table)
 
(74 intermediate revisions by 12 users not shown)
Line 1: Line 1:
This is a running start at documenting the tables in the MySQL instances used on both grid and regions, and describing how they relate to each other in the context of an OpenSim grid.
+
{{Quicklinks|Database_Documentation}}
  
SQLite is generally not considered apropriate for this use case and will not be covered here; however the table structures are very similar and most of what is here will be useful in that context as well.
+
{{Portal_Part|Introduction|
 +
This page documents the databases tables used in OpenSimulator.
  
Note that some of these tables may be relics, some may be planned for future use, and some may see heavy use but have columns which are relics, not yet properly updated or not yet used at all. Alpha code FTW!! :D
+
Tables are split up into Common, Services and Simulator.  
  
 +
On a grid, the grid services will contain the Services and Common tables, whilst each simulator instance will access the Simulator tables.
  
 +
A standalone will contain Common, Services and Simulator tables, with the exception of the regions table, which is not currently persisted for standalones.
  
 +
SQLite is generally not considered appropriate for this use case and will not be covered here; however the table structures are very similar and most of what is here will be useful in that context as well.
  
The instances:
+
Note that some of these tables may be relics, some may be planned for future use, and some may see heavy use but have columns which are relics, not yet properly updated or not yet used at all.
<table>
+
}}
<tr>
+
{{Portal_Part|Code|
<td align=left>Grid:</td>
+
There is a common package for database code, OpenSim.Data and each database has its own package (e.g. OpenSim.Data.MySQL).
<tr>
+
<td>&nbsp;</td>
+
</tr>
+
<tr>
+
<td>[[agents]]<br></td><td>Records agent (Avatar/User) login details</td>
+
<tr>
+
<td>[[assets]]<br></td><td>Comprehensive grid assets including textures and avatar inventories</td>
+
</tr><tr>
+
<td>[[avatarappearance]]<br></td><td>Persistence of the visual appearance of avatars between logins</td>
+
</tr>
+
<tr>
+
<td>[[inventoryfolders]]<br></td><td>Inventory folder-related details *excepting contents*</td>
+
</tr>
+
<tr>
+
<td>&nbsp;</td><td>Contents are in the [[inventoryitems]] table and point back to [[inventoryfolders]]</td>
+
</tr>
+
<tr>
+
<td>[[inventoryitems]]<br></td><td>All inventory item details (including folder associations) except contents - contents are referenced</td>
+
</tr>
+
<tr>
+
<td>&nbsp;</td><td>in the [[assets]] table<br><br></td>
+
</tr>
+
<tr>
+
<td>[[logs]]<br></td><td>Stores a record of logged events</td>
+
</tr>
+
<tr>
+
<td>[[logs_preTimestamp]]<br></td><td>Old format [[logs]] table? <br>**RELIC - no longer present in dist DB</td>
+
</tr>
+
<tr>
+
<td>&nbsp;</td><td>*** it would appear neither of these log tables is currently used ***<br><br></td>
+
</tr>
+
<tr>
+
<td>[[migrations]]</td><td>Supports 'automagic' migration to new database formats</td>
+
</tr>
+
<tr>
+
<td>[[regions]]</td><td>Regions known to the grid</td>
+
</tr>
+
<tr>
+
<td>[[reservations]]</td><td>Region registration table. This table has no rows on OSGrid and is likely in place for future functionality <br>**RELIC - no longer present in dist DB</td>
+
</tr>
+
<tr>
+
<td>[[userfriends]]</td><td>Friends list registration</td>
+
</tr>
+
<tr>
+
<td>[[users]]</td><td>Stored user profile</td>
+
</tr>
+
</table>
+
<br><br>
+
<table>
+
<tr>
+
<td align=left>Region:</td>
+
<tr>
+
<td>&nbsp;</td>
+
</tr>
+
<tr>
+
<td>[[estate_groups]]<br></td><td>Narrowly purposed at present. Appears to associate UUIDs under an Estate ID</td>
+
</tr>
+
<tr>
+
<td>[[estate_managers]]<br></td><td>Assoicates UUIDs with Estate ID</td>
+
</tr>
+
<tr>
+
<td>[[estate_map]]<br></td><td>Associates Regions with Estates By Estate ID</td>
+
</tr>
+
<tr>
+
<td>[[estate_settings]]<br></td><td>Settings for Estates</td>
+
</tr>
+
<tr>
+
<td>[[estate_users]]<br></td><td>Users allowed on the Estate</td>
+
</tr>
+
<tr>
+
<td>[[estateban]]<br></td><td>Users banned from the Estate</td>
+
</tr>
+
<tr>
+
<td>[[land]]<br></td><td>Parcel Properties</td>
+
</tr>
+
<tr>
+
<td>[[landaccesslist]]<br></td><td>Parcel Access List</td>
+
</tr>
+
<tr>
+
<td>[[migrations]]<br></td><td>Supports 'automagic' upgrade to new database formats</td>
+
</tr>
+
<tr>
+
<td>[[primitems]]<br></td><td>contains the prim's inventory, which is not at all unlike the avatars'<br>inventory with the exception of folders</td>
+
</tr>
+
<tr>
+
<td>[[prims]]<br></td><td>All rezzed prim details *excepting shape and contents*</td>
+
</tr>
+
<tr>
+
<td>[[primshapes]]<br></td><td>Properties of all rezzed prims</td>
+
</tr>
+
<tr>
+
<td>[[regionban]]<br></td><td>Per-Region ban list</td>
+
</tr>
+
<tr>
+
<td>[[regionsettings]]<br></td><td>Per-Region settings</td>
+
</tr>
+
<tr>
+
<td>[[terrain]]<br></td><td>Terrain mesh revision history</td>
+
</tr>
+
</table>
+
  
Full details of back-store instantiation as performed by the OpenSim software can be found here:<br>
+
Each database package has to supply implementations for the interfaces in OpenSim.Data.  For instance, IAssetData is the asset interface, used by OpenSimulator to store and retrieve asset data.
http://opensimulator.org/svn/opensim/trunk/OpenSim/Data/MySQL/Resources/
+
}}
<br><br>
+
= Organization =
Here is a note concerning the [[initial creation of the MySQL tables]]<br><br>
+
== OpenSimulator 0.9.x onwards ==
Questions about this documentation can be directed to daTwitch on #opensim-dev or #osgrid FreeNode IRC or Hiro Protagonist on OSGrid.<br>
+
 
For further clarification of the content ask on #opensim-dev look for sdague, JustinCC or DrSco
+
{| width="100%" cellpadding=10 margin: 10px 10px 10px 10px;
 +
|-
 +
|valign="top" |
 +
{{Portal_Part|Robust|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
* [[Avatars]] - Persistence of the visual appearance of avatars between logins and attached objects
 +
* [[Friends]] - A list of an avatars friends, friendship requests, and permissions granted to friends
 +
* [[GridUser]] - Information about a user in this particular grid, for everyone who uses the grid, local and foreign. This includes their home region, last region, online status and last login/logout.  This is distinct from auth information
 +
* [[Presence]] - Region and session information for currently logged in users.  Used for IM routing amongst other things.
 +
* [[UserAccounts]] - User account information, such as name, user level and e-mail. Just local accounts.
 +
* [[assets]] - Grid assets including such things as textures and sounds
 +
* [[auth]] - User authentication information
 +
* [[inventoryfolders]] - Inventory folder-related details except for the contents
 +
* [[inventoryitems]] - All inventory item details (including folder associations to [[inventoryfolders]]) except contents - contents are referenced in the [[assets]] table
 +
* [[Regions_(database_table)|regions]] - Regions known to the grid
 +
* [[tokens]] - unused
 +
{{Div col end}}
 +
}}
 +
 
 +
|valign="top" width="50%"|
 +
 
 +
{{Portal_Part|Simulator|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
* [[Land_(database_table)|land]] - Parcel Properties
 +
* [[landaccesslist]] - Parcel Access List
 +
* [[primitems]] - Contains the prim's inventory, which is not at all unlike the avatars'<br />inventory with the exception of folders
 +
* [[Prims_(database_table)|prims]] - All rezzed prim details *except shape and contents*
 +
* [[Database:Primshapes|primshapes]] - Properties of all rezzed prims
 +
* [[regionban]] - Per-Region ban list
 +
* [[Database:regionsettings|regionsettings]] Per-Region settings
 +
* [[regionwindlight]] - Windlight region settings
 +
* [[Terrain_(database_table)|terrain]] - Terrain mesh revision history
 +
{{Div col end}}
 +
}}
 +
 
 +
{{Portal_Part|Estates|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
* [[estate groups]] - Narrowly purposed at present. Appears to associate UUIDs under an Estate ID
 +
* [[estate managers]] - Associates avatar UUIDs with Estate ID
 +
* [[estate map]] -  Associates Regions with Estates By Estate ID
 +
* [[estate settings]] - Settings for Estates
 +
* [[estate users]] - Users allowed on the Estate
 +
* [[estateban]] - Users banned from the Estate
 +
{{Div col end}}
 +
}}
 +
 
 +
 
 +
|}
 +
 
 +
== OpenSimulator 0.7.2 onwards ==
 +
 
 +
{{Portal_Part|Code|
 +
Migrations supports automatic upgrade to new database formats.
 +
 
 +
}}
 +
{| width="100%" cellpadding=10 margin: 10px 10px 10px 10px;
 +
|-
 +
|valign="top" |
 +
{{Portal_Part|Robust|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
* [[Avatars]] Persistence of the visual appearance of avatars between logins and attached objects
 +
* [[Friends]] A list of an avatars friends, friendship requests, and permissions granted to friends
 +
* [[GridUser]] Information about a user in this particular grid, for everyone who uses the grid, local and foreign. This includes their home region, last region, online status and last login/logout.  This is distinct from auth information
 +
* [[Presence]] - Region and session information for currently logged in users. Used for IM routing amongst other things.
 +
* [[UserAccounts]] User account information, such as name, user level and e-mail. Just local accounts.
 +
* [[assets]] Grid assets including such things as textures and sounds
 +
* [[auth]] User authentication information
 +
* [[inventoryfolders]] Inventory folder-related details *except contents*
 +
* [[inventoryitems]] holds actual content and points back to * [[inventoryfolders]]
 +
* [[inventoryitems]] All inventory item details (including folder associations) except contents - contents are referenced in the * [[assets]] table*
 +
* [[Regions_(database_table)|regions]] Regions known to the grid
 +
*  tokens table is unused
 +
{{Div col end}}
 +
}}
 +
 
 +
|valign="top" width="50%"|
 +
 
 +
{{Portal_Part|Simulator|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
* [[Land_(database_table)|land]] Parcel Properties
 +
* [[landaccesslist]] Parcel Access List
 +
* [[primitems]] Contains the prim's inventory, which is not at all unlike the avatars'<br />inventory with the exception of folders
 +
* [[Prims_(database_table)|prims]] All rezzed prim details *except shape and contents*
 +
* [[Database:Primshapes|primshapes]] Properties of all rezzed prims
 +
* regionban Per-Region ban list
 +
* [[Database:regionsettings|regionsettings]] Per-Region settings
 +
* regionwindlight - Windlight region settings
 +
* [[Terrain_(database_table)|terrain]] Terrain mesh revision history
 +
 
 +
{{Div col end}}
 +
}}
 +
 
 +
{{Portal_Part|Estates|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
* [[estate groups]] Narrowly purposed at present. Appears to associate UUIDs under an Estate ID
 +
* [[estate managers]] Associates avatar UUIDs with Estate ID
 +
* [[estate map]] Associates Regions with Estates By Estate ID
 +
* [[estate settings]] Settings for Estates
 +
* [[estate users]] Users allowed on the Estate
 +
* [[estateban]] Users banned from the Estate
 +
}}
 +
 
 +
|}
 +
 
 +
== Pre 0.6.9 ==
 +
{{Portal_Part|Code|This mainly pertains to OpenSimulator 0.6.9.}}
 +
{| width="100%" cellpadding=10 margin: 10px 10px 10px 10px;
 +
|-
 +
|valign="top" |
 +
{{Portal_Part|Robust|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
*[[agents]] Records agent (Avatar/User) login details
 +
*[[assets]] Comprehensive grid assets including textures and avatar inventories
 +
*[[avatarappearance]] Persistence of the visual appearance of avatars between logins
 +
*[[avatarattachments]] Items attached to avatars
 +
*[[inventoryfolders]] Inventory folder-related details *except contents*, Contents are in the [[inventoryitems]] table and point back to
 +
*[[inventoryitems]] All inventory item details (including folder associations) except contents are referenced in the [[assets]] table
 +
*[[migrations]] Supports 'automagic' migration to new database formats
 +
*[[Regions_(database_table)|regions]] Regions known to the grid
 +
*[[userfriends]] Friends list registration
 +
*[[users]] Stored user profiles
 +
{{Div col end}}
 +
}}
 +
 
 +
|valign="top" width="50%"|
 +
 
 +
{{Portal_Part|Simulator|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
* [[land]] Parcel Properties
 +
* [[landaccesslist]] Parcel Access List
 +
* [[migrations]] Supports 'automagic' upgrade to new database formats
 +
* [[primitems]] Contains the prim's inventory, which is not at all unlike the avatars inventory with the exception of folders
 +
* [[Prims_(database_table)|prims]] All rezzed prim details *except shape and contents*
 +
* [[Database:Primshapes|primshapes]] Properties of all rezzed prims
 +
* [[regionban]] Per-Region ban list
 +
* [[regionsettings]] Per-Region settings
 +
* [[terrain]] Terrain mesh revision history
 +
{{Div col end}}
 +
}}
 +
 
 +
{{Portal_Part|Estates|
 +
{{Div col|colwidth=12em|rules=yes|gap=1em}}
 +
* [[estate groups]] Narrowly purposed at present. Appears to associate UUIDs under an Estate ID
 +
* [[estate managers]] Associates UUIDs with Estate ID
 +
* [[estate map]] Associates Regions with Estates By Estate ID
 +
* [[estate settings]] Settings for Estates
 +
* [[estate users]] Users allowed on the Estate
 +
* [[estateban]] Users banned from the Estate
 +
}}
 +
 
 +
|}
 +
 
 +
[[Category:Database]]

Latest revision as of 04:20, 4 December 2023

Introduction

This page documents the databases tables used in OpenSimulator.

Tables are split up into Common, Services and Simulator.

On a grid, the grid services will contain the Services and Common tables, whilst each simulator instance will access the Simulator tables.

A standalone will contain Common, Services and Simulator tables, with the exception of the regions table, which is not currently persisted for standalones.

SQLite is generally not considered appropriate for this use case and will not be covered here; however the table structures are very similar and most of what is here will be useful in that context as well.

Note that some of these tables may be relics, some may be planned for future use, and some may see heavy use but have columns which are relics, not yet properly updated or not yet used at all.

Code

There is a common package for database code, OpenSim.Data and each database has its own package (e.g. OpenSim.Data.MySQL).

Each database package has to supply implementations for the interfaces in OpenSim.Data. For instance, IAssetData is the asset interface, used by OpenSimulator to store and retrieve asset data.

Contents

[edit] Organization

[edit] OpenSimulator 0.9.x onwards

Robust
  • Avatars - Persistence of the visual appearance of avatars between logins and attached objects
  • Friends - A list of an avatars friends, friendship requests, and permissions granted to friends
  • GridUser - Information about a user in this particular grid, for everyone who uses the grid, local and foreign. This includes their home region, last region, online status and last login/logout. This is distinct from auth information
  • Presence - Region and session information for currently logged in users. Used for IM routing amongst other things.
  • UserAccounts - User account information, such as name, user level and e-mail. Just local accounts.
  • assets - Grid assets including such things as textures and sounds
  • auth - User authentication information
  • inventoryfolders - Inventory folder-related details except for the contents
  • inventoryitems - All inventory item details (including folder associations to inventoryfolders) except contents - contents are referenced in the assets table
  • regions - Regions known to the grid
  • tokens - unused
Simulator
  • land - Parcel Properties
  • landaccesslist - Parcel Access List
  • primitems - Contains the prim's inventory, which is not at all unlike the avatars'
    inventory with the exception of folders
  • prims - All rezzed prim details *except shape and contents*
  • primshapes - Properties of all rezzed prims
  • regionban - Per-Region ban list
  • regionsettings Per-Region settings
  • regionwindlight - Windlight region settings
  • terrain - Terrain mesh revision history
Estates


[edit] OpenSimulator 0.7.2 onwards

Code

Migrations supports automatic upgrade to new database formats.

Robust
  • Avatars Persistence of the visual appearance of avatars between logins and attached objects
  • Friends A list of an avatars friends, friendship requests, and permissions granted to friends
  • GridUser Information about a user in this particular grid, for everyone who uses the grid, local and foreign. This includes their home region, last region, online status and last login/logout. This is distinct from auth information
  • Presence - Region and session information for currently logged in users. Used for IM routing amongst other things.
  • UserAccounts User account information, such as name, user level and e-mail. Just local accounts.
  • assets Grid assets including such things as textures and sounds
  • auth User authentication information
  • inventoryfolders Inventory folder-related details *except contents*
  • inventoryitems holds actual content and points back to * inventoryfolders
  • inventoryitems All inventory item details (including folder associations) except contents - contents are referenced in the * assets table*
  • regions Regions known to the grid
  • tokens table is unused
Simulator
  • land Parcel Properties
  • landaccesslist Parcel Access List
  • primitems Contains the prim's inventory, which is not at all unlike the avatars'
    inventory with the exception of folders
  • prims All rezzed prim details *except shape and contents*
  • primshapes Properties of all rezzed prims
  • regionban Per-Region ban list
  • regionsettings Per-Region settings
  • regionwindlight - Windlight region settings
  • terrain Terrain mesh revision history
Estates

[edit] Pre 0.6.9

Code
This mainly pertains to OpenSimulator 0.6.9.
Robust
  • agents Records agent (Avatar/User) login details
  • assets Comprehensive grid assets including textures and avatar inventories
  • avatarappearance Persistence of the visual appearance of avatars between logins
  • avatarattachments Items attached to avatars
  • inventoryfolders Inventory folder-related details *except contents*, Contents are in the inventoryitems table and point back to
  • inventoryitems All inventory item details (including folder associations) except contents are referenced in the assets table
  • migrations Supports 'automagic' migration to new database formats
  • regions Regions known to the grid
  • userfriends Friends list registration
  • users Stored user profiles
Simulator
  • land Parcel Properties
  • landaccesslist Parcel Access List
  • migrations Supports 'automagic' upgrade to new database formats
  • primitems Contains the prim's inventory, which is not at all unlike the avatars inventory with the exception of folders
  • prims All rezzed prim details *except shape and contents*
  • primshapes Properties of all rezzed prims
  • regionban Per-Region ban list
  • regionsettings Per-Region settings
  • terrain Terrain mesh revision history
Estates
Personal tools
General
For Administrators
For Developers
For Creators
For Grid Users
About This Wiki
Tools