[Opensim-dev] Object Representation

Dzonatas dzonatas at dzonux.net
Fri Feb 8 17:55:09 UTC 2008


Sean Dague wrote:
> So, here is your chance to be a hero in the OpenSim world. :)  Ideas on
> how to reasonably pull all this together to give us a much more
> consistent serialization approach are very welcomed.  Please pile on.
>
> I think that solving this is probably our next big battle.  I'm excited
> to see the NHibernate work getting very close, as I think that's a huge
> step forward in this regard.  This probably also means we need to bring
> up the SOP/SOG discussion that Stephan wanted to kick off as well.
>   


NHibernate is nice, but I believe there are more general ways for object 
stores and persistence.

Based on Atomatrix, I've reworked its basic scheme to SQL tables.  The 
scheme is very simple:

CREATE TABLE IF NOT EXISTS `matrix0` (
  `uuid` binary(16) NOT NULL,
  `precursor` binary(16) NOT NULL,
  `intracursor` binary(16) NOT NULL,
  `concursor` binary(16) NOT NULL,
  `network` binary(16) NOT NULL,
  `intranet` binary(16) NOT NULL,
  `transnet` binary(16) NOT NULL,
  PRIMARY KEY  (`uuid`),
  KEY `precursor` (`precursor`),
  KEY `network` (`network`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE IF NOT EXISTS `matrix1` (
  `uuid` binary(16) NOT NULL,
  `precursor` longblob NOT NULL,
  PRIMARY KEY  (`uuid`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



If you haven't used Atomatrix or heard me talk about the scheme, you 
probably are saying "intracursor, concursor, what heck is that?" Same 
basic scheme as an atomatrix, but with different names on the data 
structure.

Before one complains dearly, do notice that the structure above is 
exactly 128 byte aligned records, and all other variable data is in a 
separate table if needed. Performance is in mind here.

The scheme basically takes an object and maps them to these records, and 
it will require more than one to map a full object. The scheme is meant 
to map any kind of matrix of any dimension to a database.

A quick guide to the scheme: the precursor, intracursor, and concursor 
are similar to class inheritance; and network, intranet, and transnet 
are similar to metadata and properties. Those similarities become 
perceptible once there is enough of these to map an object. The 
precursor is a uuid that points to another uuid. For example with C#, 
when you have "... A inherits B..." then B is the 'precursor' of A.  The 
methods and data of A are found through 'network' maps.  The blob stores 
the variable data, if needed.

Atomatrix is now under GPLv3 and that includes this scheme.

I started to play around with the CIL emitter to replace what I had 
working in Atomatrix as a built in compiler.  I had a virtual world that 
ran with concurrent players 20 years ago (modem days, multiple dial-up) 
that I still use today for regression tests, and it does seem practical 
to replace the generated code with run-time generated CIL based code. 
There already exists an XML format, so a base system being stored in DB 
can be imported/exported to SVN.

I'll leave this explanation as brief as this is, and I know what I just 
said just went *whoosh* for many ... but (published) code is docs on 
this one.

=)





More information about the Opensim-dev mailing list