[Opensim-dev] further db thoughts

Sean Dague sean at dague.net
Fri Jan 11 13:58:15 UTC 2008


I spent another day wasted on nhibernate, until someone can sort out an
example using Mono + Linux + Mono.Data.SqliteClient, I think we're dead
there.  I do encourage someone to sort that out, as nhibernate would
definitely be better than any other approach, but I haven't figured out
how to get it to work all the places we need it to.

That being said, there is real work that can be done today to make what
we have a lot better (both performance wise, and maintainability wise).
I started hacking on the SQLite adapter in this direction yesterday, and
will be spending the next week+ working out these new ideas there.

Step 1) remove most of the ADO.NET plumbing, get us back to straight db
access.  For things like Users and Assets this actually will reduce the
lines of code in the plugin (I dropped the LOC for the friends list
functions yesterday by about 1/2).  I think this will remove some of the
nasty prim move lag for linked sets, as well as the asset store startup
time.

Step 1b) move the SQL definition out of the code and into seperate
Resource files.  I'm taking a page of inspiration here from the Ruby on
Rails approach to things, which I'm hoping will work out well.  Each
datastore will have a set of DataStoreName_XXX.sql files.  XXX will be a
sequence number.  We'll have a dataversions table in each store, which
will store which version the DataStore is at.  On startup, we'll check
to see if there are any newer XXX files for the store, and if so, apply
them in order.  This mirrors the "migrations" concept in RoR, and works
*really well* for being able to version databases forward.  I expect to
have the first working bits of this approach the middle of next week.

Step 2) Adapt the upward facing interfaces.  Right now the earliest data
interfaces are: GetAll & Store, which can be seen with prims.  Some of
the later interfaces are more along the lines of Add, Update, Get,
Remove.  I think there is some value getting towards that even if we
still need GetAll for the base prim load for sims.

Anyway, back to hacking.  Again, comments here are welcomed for sure.

      -Sean

-- 
__________________________________________________________________

Sean Dague                                       Mid-Hudson Valley
sean at dague dot net                            Linux Users Group
http://dague.net                                 http://mhvlug.org

There is no silver bullet.  Plus, werewolves make better neighbors
than zombies, and they tend to keep the vampire population down.
__________________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080111/ae8b9aba/attachment-0001.pgp>


More information about the Opensim-dev mailing list