In our application, when we define classes in Orient, we have a choice 
between using an application level id (which doesn't change once assigned) 
and a query friendly label for the class names. The label can change 
several times over the course of the class's lifetime, but the app level id 
never changes.

We'd like to avoid the "alter class old name new" command (or any 
non-trivial schema change operations) since we feel that this is an unsafe 
operation with too many changes at the database level. At the moment, we're 
considering the following solution:

1) Give the Orient class name a physical name based on the application 
level id (say X). Since the app level id never changes, we never need to 
alter the class name in Orient. 
2) Now we can query the class  in Orient using "select from X" which 
returns all objects of that class.
3) Now,clearly, "select from X" is problematic since X has no logical 
meaning as the application id X has no semantics making the query hard to 
understand.
4) To workaround 3) above, we plan to set the Orient class shortname to the 
logical name which is semantically meaningful (say Y)
5) "select from Y" is now the same as "select from X", but has the 
additional advantage of being user friendly.
6) Now, when the logical name of a class changes, we change the Orient 
class alias/shortname. So let's say we now change the alias of the class 
from Y to Z. Changing the alias apparently has minimum physical 
consequences in the Orient database. The only thing that changes is that 
now we can simply do "select from Z" instead of "select from Y" and will be 
equivalent to "select from X".  Under the covers, since X never changes, we 
never have to call "alter class X name Y" or "alter class Y name Z"

First question: Is the use of class shortname  for the above physical 
versus logical class name separation is a good design choice.

Second question: A related question is if a similar physical versus logical 
name separation can be done at the property name level or is something like 
"ALTER PROPERTY X.p0 NAME p1" the only option for changing property names. 
I did not find any concept of a property name alias similar to the class 
name shortname (alias). Essentially, if a property name alias was 
available, then the same solution I described earlier for classes would 
also work for properties.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to