Subdivide the assets table
From OpenSimulator
(Difference between revisions)
(→Main idea) |
m (Robot: Cosmetic changes) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | __NOTOC__ | ||
+ | {{Quicklinks}} | ||
+ | <br /> | ||
+ | |||
+ | {{proposal}} | ||
+ | |||
[[User:lulurun]] | [[User:lulurun]] | ||
Line 21: | Line 27: | ||
related to [[avatar portability]] | related to [[avatar portability]] | ||
− | [[ | + | [[Image:avatar_portability_5.PNG]] |
=== Advantages === | === Advantages === | ||
Line 27: | Line 33: | ||
1. increase the dispersity of asset data, clarify the responsibility of each server. | 1. increase the dispersity of asset data, clarify the responsibility of each server. | ||
− | :* Currently, all of the asset data is stored in assets table, managed by assetserver.<br>This would cause some problems: | + | :* Currently, all of the asset data is stored in assets table, managed by assetserver.<br />This would cause some problems: |
::# assets table keeps growing in a fast pace. | ::# assets table keeps growing in a fast pace. | ||
− | ::# hard to determine which asset is belongs to inactive regions (when you want to "clean" the assets | + | ::# hard to determine which asset is belongs to inactive regions (when you want to "clean" the assets table). |
::# assetserver not only serves users' data but also regions' data, if something happened to assetserver both of avatar and prims will become gray. | ::# assetserver not only serves users' data but also regions' data, if something happened to assetserver both of avatar and prims will become gray. | ||
− | :* To separate assets table can not only solve these problems, but also brings minor benefits<br>such like: | + | :* To separate assets table can not only solve these problems, but also brings minor benefits<br />such like: |
::* reduce the responsibility of assetserver | ::* reduce the responsibility of assetserver | ||
::* disperse the asset requests(especially for big grid service) | ::* disperse the asset requests(especially for big grid service) | ||
Line 43: | Line 49: | ||
::* no complains about "no texture on prims" any more. | ::* no complains about "no texture on prims" any more. | ||
::* when a region leaves your grid, you don't have to worry about its assets becoming garbage. | ::* when a region leaves your grid, you don't have to worry about its assets becoming garbage. | ||
− | :::*on the other hand, this also good for region owners. | + | :::* on the other hand, this also good for region owners. |
:* For when a user registers their region server with a grid, | :* For when a user registers their region server with a grid, | ||
::* When you want to switch your sim to a new grid, "prims, primshapes, terrain, region_asset" are always tied-up together. the only thing you need to do is to edit UGAI servers URI in your OpenSim.ini | ::* When you want to switch your sim to a new grid, "prims, primshapes, terrain, region_asset" are always tied-up together. the only thing you need to do is to edit UGAI servers URI in your OpenSim.ini | ||
Line 50: | Line 56: | ||
3. make grid-mode more flexible | 3. make grid-mode more flexible | ||
− | :*Here are some pictures, they are showing some configuration patterns after the subdividing: | + | :* Here are some pictures, they are showing some configuration patterns after the subdividing: |
http://openugai.sourceforge.net/?page=assets_subdividing | http://openugai.sourceforge.net/?page=assets_subdividing | ||
Line 60: | Line 66: | ||
=== Implementation === | === Implementation === | ||
− | *Things need '''not''' to be changed: | + | * Things need '''not''' to be changed: |
:* The fields of "assets" table need not to be changed (at least for the subdividing). | :* The fields of "assets" table need not to be changed (at least for the subdividing). | ||
:* Current implementation of AssetServer need not to be changed. | :* Current implementation of AssetServer need not to be changed. | ||
− | *Things need to add: | + | * Things need to add: |
:* Add new table "RegionAssets". | :* Add new table "RegionAssets". | ||
:* Add DB access support for the new table under OpenSim.Data.* | :* Add DB access support for the new table under OpenSim.Data.* | ||
Line 76: | Line 82: | ||
* Things need to be changed | * Things need to be changed | ||
− | :*regionserver should not fetch assets from only one assetserver, So, One of the major changes we have to do is: | + | :* regionserver should not fetch assets from only one assetserver, So, One of the major changes we have to do is: |
in "GridAssetCient.cs" | in "GridAssetCient.cs" | ||
L50: protected override AssetBase GetAsset(AssetRequest req) | L50: protected override AssetBase GetAsset(AssetRequest req) |
Latest revision as of 20:14, 3 March 2012
This article or section is a Proposal It does not represent the current state of OpenSim, but is an idea for future work in OpenSim. Please feel free to update this page as part of the proposal discussion. |
[edit] proposal to subdivide the assets table
[edit] Main idea
My proposal is to subdivide asset table into 2 tables:
- user_asset
- used by UGAI servers
- for user owned assets
- objects in inventory
- appearance
- attachment, ...
- region_asset
- used by region servers
- for region owned assets
- background sounds
- textures on prims
- sun, moon, ...
- terrain maptile
related to avatar portability
[edit] Advantages
Major points first.
1. increase the dispersity of asset data, clarify the responsibility of each server.
- Currently, all of the asset data is stored in assets table, managed by assetserver.
This would cause some problems:
- assets table keeps growing in a fast pace.
- hard to determine which asset is belongs to inactive regions (when you want to "clean" the assets table).
- assetserver not only serves users' data but also regions' data, if something happened to assetserver both of avatar and prims will become gray.
- Currently, all of the asset data is stored in assets table, managed by assetserver.
- To separate assets table can not only solve these problems, but also brings minor benefits
such like:
- reduce the responsibility of assetserver
- disperse the asset requests(especially for big grid service)
- lower the risk of losing data, ...
- To separate assets table can not only solve these problems, but also brings minor benefits
2. for Data Portability in virtual world
- For grid admin,
- you can concentrate on managing only user(not region owner) relevant information like "users, avatarappearance, inventory"
- it can reduce the vulnerability caused by foreign assets.
- no complains about "no texture on prims" any more.
- when a region leaves your grid, you don't have to worry about its assets becoming garbage.
- on the other hand, this also good for region owners.
- For when a user registers their region server with a grid,
- When you want to switch your sim to a new grid, "prims, primshapes, terrain, region_asset" are always tied-up together. the only thing you need to do is to edit UGAI servers URI in your OpenSim.ini
- For standalone-mode user - probably creators,
- Avatars and buildings are saved separatly, export/import objects will become more simple. Or you can provide the DB file directly.
3. make grid-mode more flexible
- Here are some pictures, they are showing some configuration patterns after the subdividing:
http://openugai.sourceforge.net/?page=assets_subdividing
4. reduce the possibility of assetid conflict by reducing the scope of assetid.
[edit] Disadvantages
I can hardly imagine the disadvantages so far except many changes are need to be done. anything you think maybe a disadvantage is very appreciated.
[edit] Implementation
- Things need not to be changed:
- The fields of "assets" table need not to be changed (at least for the subdividing).
- Current implementation of AssetServer need not to be changed.
- Things need to add:
- Add new table "RegionAssets".
- Add DB access support for the new table under OpenSim.Data.*
- Add RegionAssetService
- including a RegionAssetLoader which reads assets/AssetSet.xml stores asset data to RegionAsset table
- LocalRegionAssetService (directly select from RegionAssets table)
- This is the pattern 1 at http://openugai.sourceforge.net/?page=assets_subdividing
- RemoteRegionAssetService
- This is the pattern 2-4 at http://openugai.sourceforge.net/?page=assets_subdividing
- Of course to use which kind of service should be able to config in "OpenSim.ini".
- Things need to be changed
- regionserver should not fetch assets from only one assetserver, So, One of the major changes we have to do is:
in "GridAssetCient.cs" L50: protected override AssetBase GetAsset(AssetRequest req) to protected override AssetBase GetAsset(AssetRequest req, string asset_url) L79: protected override AssetBase StoreAsset(AssetRequest req) to protected override AssetBase StoreAsset(AssetRequest req, string asset_url)
[edit] Migration From Existing System
Since this subdividing does not change the front services, there are not so many things to be done for the migration.
- Grid admin
- UGAI servers should work as it used to be. (nothing changes)
- you can forbid foreign assets by assigning assetserver a private address(a lot of ways to do).
- if you want cleanup unreferenced assets, ... try your best, this work won't be needed again.
- Region owner
- you can keep your contents completly in your local server from mow on.
- if you want get back your assets that already been stored in other AssetServer, ... troublesome but possible.
- VW User
- nothing changes.
- Developer
- you need to watch mantis frequently.
[edit] What do you think ?
please feel free to leave comments in this section :)