If you have ever wondered how basic information (like GUID) from the ContentType created using Optimizely Admin view and the properties from the code come together seamlessly to provide the content type. Let us unbox and find out the process of prefect harmony
What is Synchronization?
As soon as the Optimizely website starts, it scans all the
assemblies and looks for classes decorated with [ContentType] and properties
[Display] or [Property]. Once the scan is complete, it compares these with the
content types defined in the database and synchronizes based on one of the
seven use cases as mentioned below.
Key 7 Use cases :
# |
Use Case |
Pre-Condition |
Sync Process |
1 |
New Content Type |
A new Class with [ContentType]
is added to the code |
·
Creates
content type in DB ·
Properties
are added to DB |
2 |
Update Content
Type |
A new
property is added existing ContentType class |
Properties
are added to DB |
3 |
Identical Content Type |
No changes in code |
·
Skips
DB update ·
Merge
setting for runtime cache |
4 |
Rename Property |
A property in
existing class is renamed |
Treated as
new property, Old values are not migrated. If old values
are required then Migration step has to be used |
5 |
Deleted Content Type |
Remove a Content Type
class |
If no instances exist
then DB entry is also deleted. However, if there is any
instance then the DB entry stays. |
6 |
Commit Disabled
|
ContentModelOptions.EnableModelSyncCommit
is set to false |
·
No automatic database writes during start up. ·
Synchronize button in CMS to be used to sync /
commit manually. |
7 |
Merge Setting |
Admin changes display
name in CMS |
·
Admin
changes take precedence; hence database values override Code setting at run
time. ·
Revert
to Default option can restore it to values defined in code |
Import things to remember:
- · Never change the GUID after deployment
- · Renaming properties causes data loss, explicit migration is required if the old values have to be restored
- · Admin changes always take precedence
- · Avoid downgrades as older assemblies will not overwrite newer DB definition
Comments
Post a Comment