[Gpephone-devel] Which database is better to store tree structure?

YANG Lin RD-ILAB-PEK lin.yang at orange-ftgroup.com
Thu Apr 12 04:13:49 CEST 2007


 
Hi,

>
>Do we actually have that many different value types? Currently 
>we have five fundamental data types in SQL, so it should be 
>possible to reduce the amount of
>   value types to these five. 

Some of the value types is strucutre type. We can convert them into
strings. The value types is not a big problem.
I think the more complex thing is that each property may have its own
parameter and more than one values.

Take "attendee" property as an example:

ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;
RSVP=TRUE;CN=lin;LANGUAGE=en:MAILTO:lin.yang at orange-ftgroup.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;RSVP=TRUE;
LANGUAGE=en:PARTSTAT=DECLINED;MAILTO:san.zhou at orange-ftgroup.com

There're 2 attendee properties here. The first one has a string value 
"MAILTO:lin.yang at orange-ftgroup.com";
and several parameters:
      type			  	value
CAL_CUTYPE_PARAMETER  		INDIVIDUAL
CAL_ROLE_PARAMETER		REQ-PARTICIPANT
CAL_PARTSTAT_PARAMETER		ACCEPTED
CAL_RSVP_PARAMETER		TRUE
CAL_CN_PARAMETER			lin
CAL_LANGUAGE_PARAMETER	en


The second one has a string value "MAILTO:san.zhou at orange-ftgroup.com", 
and several parameters
	type				value
CAL_CUTYPE_PARAMETER  		INDIVIDUAL
CAL_ROLE_PARAMETER		REQ-PARTICIPANT
CAL_PARTSTAT_PARAMETER		DECLINED
CAL_RSVP_PARAMETER		TRUE
CAL_LANGUAGE_PARAMETER	en

The parameter can't be stored into a property table like this:

Property1 | property2  | property3 | ...
Value 1    |  value2      |  value3    |...

>The only case where this would 
>not make sense if if we have fields where it is useful to 
>entrust the data validation to the database.
>Me might want to take a look at the libeventdb implementation 
>in GPE which needs to do provide the same.
>

There're some differrence.
In libeventdb, each event has some properties. Each property may
have one value. The value are all coverted into string.
Parameters are not supported here.
The table is like this:

Uid   |         tag       |      value  |
Uid1 |  description   | meeting   |
Uid1 |  start	     | 20070410 |
Uid1 | ...                 | ...            |
Uid2 |....
...





More information about the Gpephone-devel mailing list