Configure Dynamic Data Store (10-11.2)
Describes how to set up the Dynamic Data Store.
NoteThis content applies to Optimizely Content Management System (CMS) versions 10 through 11.2.
You have the following options to configure through the application’s configuration file:
The <episerver.dataStore> element has one child element called <dataStore>.
- The
<dataStore>element has the child elements<providers>and<cache>and the following attributes:defaultProvideris the name of the Dynamic Data Store provider to use.
The name should correspond to an element with the same name in the<providers>element.autoResolveTypecan be true (default) or false.
If you set this to true, then the Dynamic Data Store tries to resolve .NET Types if theSystem.Type.GetTypemethod call fails for types stored in a store. Removing the version information from the type string and callingType.GetTypeagain resolves. If this fails, then the assembly information is removed from the type string andType.GetTypeis called again. If theTypestill is not resolved, an exception occurs. If you set this value to false, the assembly resolves the type in the configuration file.autoRemapStorescan be true (default) or false.
If you set this to true, then the Dynamic Data Store automatically remaps .NET classes decorated with theEPiServerDataStoreAttributeattribute and where you set theAutomaticallyRemapStoreproperty to true, to their respective stores when the class and store mappings are no longer aligned. If you set this value to false, no automatic remapping is done for any class.
- The
<providers>elements contain child<add>elements for each Dynamic Data Store provider available.
Currently, only a Microsoft SQL Server provider is available. - The
<cache>element contains a single<providers>child element and the following attributes:defaultProvideris the name of the Dynamic Data Store cache provider to use. The name should correspond to an element with the same name in the<cache> <providers>element.
- The
<cache> <providers>elements contain a child<add>elements for each Dynamic Data Store cache provider available.
Currently, providers are available for HTTP Runtime and Null (no caching).
Recommendations
- Create or obtain instances of the
DynamicDataStoreon the stack, use them, and then discard them. Note that the Dynamic Data Store is not thread-safe, and if an instance is used and shared between multiple threads, protect it with thread-locking techniques. - Implement
EPiServer.Data.IDynamicDataor aGuidproperty called Id on objects you want to be saved when you want to control the external identity of your objects. - Use the same instance of a Dynamic Data Store to load and then update a POCO object (object without identity).
Updated 3 months ago