Slightly related to [ticket #604][604].

We have had replication in Midgard since ages and in the future we're going to 
even more decentralized and widely replicated direction, thus I feel the need 
to remind everyone of something that has been second nature to me for many 
years.

Never store "links" to other objects in fields that are not defined on 
MgdSchema level to link to said object class as local IDs, always use GUIDs. 
This is especially often a problem when storing stuff to parameters, but the 
legacy classes also offer many "extra" fields that are not linked anywhere and 
are commonly used to store arbitary data.

You will need to make this a rule not lightly broken since Mr. Murphy will make 
sure you will not catch this when testing (the replicated objects might be 
created on remote end in the same order as in local thus getting same IDs) in 
case you already knew you want to use replication. 

The other option is that one day you realize how cool this replication stuff is 
and set it up. Then you start wondering why stuff breaks in weird ways, realize 
the IDs are not same across databases and will have to either do without the 
coolness or make a bunch of changes and scripts to fix this after the fact.

[604]: http://trac.midgard-project.org/ticket/604
_______________________________________________
user mailing list
[email protected]
http://lists.midgard-project.org/mailman/listinfo/user

Reply via email to