Configuring content storage
The cd_storage_conf.xml file is the Content Delivery Storage Layer configuration file. This task explains how to configure standard storage scenarios.
About this task
When the Content Deployer receives incoming content it deploys that content to the Storage Layer which then stores the content in the Content Data Store. The Content Data Store is the local file system and/or a relational database.
Procedure
- Open
cd_storage_conf.xmllocated in theconfig\subdirectory of your Content Delivery root location in a plain-text editor or XML editor. - In the
Storageselement, configure one or more of the following storage mechanisms:Note: By default, the sample Storage Layer configuration file provided with SDL Tridion is configured to store all content to the local file system in the folder c:\temp.- To enable storage of content in a Microsoft SQL Server database, ensure the presence of the following
<Storage>element, uncommented:<Storage Type="persistence" Id="MSSQL_01" dialect="MSSQL" Class="com.tridion.storage.persistence.JPADAOFactory"> <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" /> <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource"> <Property Name="serverName" Value="SERVER_NAME" /> <Property Name="portNumber" Value="1433" /> <Property Name="databaseName" Value="DATABASE_NAME" /> <Property Name="user" Value="USER_NAME" /> <Property Name="password" Value="PASSWORD" /> </DataSource> </Storage> - To enable storage of content in an Oracle database, ensure the presence of the following
<Storage>element, uncommented:<Storage Type="persistence" Id="Oracle_01" dialect="ORACLESQL" Class="com.tridion.storage.persistence.JPADAOFactory"> <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" /> <DataSource class="oracle.jdbc.pool.OracleDataSource"> <Property Name="driverType" Value="thin" /> <Property Name="networkProtocol" Value="tcp" /> <Property Name="serverName" Value="SERVER_NAME" /> <Property Name="portNumber" Value="1521" /> <Property Name="databaseName" Value="DATABASE_NAME" /> <Property Name="user" Value="USER_NAME" /> <Property Name="password" Value="PASSWORD" /> </DataSource> </Storage>If you are connecting to Oracle RAC, use the property name
serviceNameinstead ofdatabaseName. - To enable storage of content on the local file system, ensure the presence of the following
<Storage>element, uncommented:<Storage Type="filesystem" Id="LocalFileSystem_01" defaultFilesystem="true" defaultStorage="true" Class="com.tridion.storage.filesystem.FSDAOFactory"> <Root Path="STORAGE_PATH" /> </Storage>where
STORAGE_PATHis the fully qualified path to the root folder of your storage location. - To enable storage through JNDI (that is, storage in an Oracle or Microsoft SQL Server database via your Web application server), ensure the presence of the following
<Storage>element, uncommented:<Storage Type="persistence" Id="JNDI_01" dialect="DIALECT_TYPE" Class="com.tridion.storage.persistence.JPADAOFactory" JNDIName="JNDI_NAME" />where
orDIALECT_TYPEisORACLESQL(for storage in an Oracle database)MSSQL(for storage in a SQL Server database), andJNDI_NAMEis the identifier of your data source (the exact inner structure of this string depends on the Web application server you use).
Note: The values for theIdattributes of the<Storage>elements (MSSQL_01,Oracle_01andJNDI_01) are arbitrary. They only need to be unique strings.Note: If you are running a multi-threaded Content Deployer, be aware that the value of theSizeattribute in thePoolelement can impair the effect of setting up a multi-threaded Content Deployer. You may need to increase value of theSizeattribute. - To enable storage of content in a Microsoft SQL Server database, ensure the presence of the following
- Provide values for the properties by replacing the following strings in the
Valueattributes of thePropertyelements:For database storage, specify the following:
SERVER_NAME- Replace this string with the name of the database server host.
DATABASE_NAME- Replace this string with the name of the database to access.
USER_NAME- Replace this string with the name of a user who can access the database.
PASSWORD- Replace this string with a valid password for the user you specified.
Note: You can add as many<Storage>elements as you like. - Select one of the storage media you configured (a database or a file system location) as your default storage destination in the
ItemTypeselement, located directly after theGlobalsection:<ItemTypes defaultStorageId="STORAGE_ID" cached="CACHE_BEHAVIOR"> </ItemTypes>Replace
STORAGE_IDwith a value of theIdattribute of one of yourStorageelements (for example,MSSQL_01). Also, setcachedtotrueorfalsedepending on your preference. Typically, in a development environment you would setcachedtofalseand in a live environment totrue.Content Delivery will now store all content in the storage medium identified by the storage ID you specified, and cache or not cache it (depending on your value forcached). - You now have a number of ways in which you can override this default behavior:
- You can change whether or not items of a certain type are cached. To do this, insert an
Itemelement inside theItemTypeselement and set the value ofcachedto the reverse of the value specified inItemTypes:<Item typeMapping="TYPE_NAME" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID"/> - You can store items of a certain type in a different storage medium. To do this, insert an
Itemelement inside theItemTypeselement and set the value ofstorageIdto another value than the one specified inItemTypes:<Item typeMapping="TYPE_NAME" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID"/> - You can store specific types of binary items (that is, binary files with specific file extensions) in a different storage medium. To do this, insert an
Itemelement inside theItemTypeselement:<Item typeMapping="Binary" itemExtension=".EXT" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID" /> - You can store specific types of Pages (that is, Web pages with specific file extensions) in a different storage medium. To do this, insert an
Itemelement inside theItemTypeselement:<Item typeMapping="Page" itemExtension=".Jsp" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID" />Other possible values for
itemExtensionare.Aspxand.html - You can store specific types of Component Presentations (that is, Component Presentations with specific file extensions) in a different storage medium. To do this, insert an
Itemelement inside theItemTypeselement:<Item typeMapping="ComponentPresentation" itemExtension=".Jsp" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID" />Possible values for
itemExtensionare:.Jsp.Ascx.Xml.Txt.rel
- You can specify a different storage medium and/or caching behavior for items that were published from a specific Publication in the Content Manager, by inserting a
Publicationelement inside theItemTypeselement, directly after anyItemelements:<Publication Id="PUB_ID" defaultStorageId="STORAGE_ID" cached="CACHE_BEHAVIOR"> </Publication> - You can specify a different storage medium and/or caching behavior for items of a certain type that were published from a specific Publication, by inserting an
Itemelement inside aPublicationelement. These elements are formatted the same way as theItemelements directly under theItemTypeselement.
Replace the strings as follows:
STORAGE_ID-
The ID of one of the storage mediums you specified in the
<Storages>element. CACHE_BEHAVIOR-
Either
trueif you want the items to be cached, orfalseif you do not. TYPE_NAME-
The name of an item type you wish to configure storage for.
TYPE_NAMEmust have one of the following values:Value Description BinaryA binary resource ComponentLinkClickInformation about visitors clicking on a Component Link, used in the Communication Statistics product ComponentPresentationA Component Presentation (the result of rendering a Component with a Component Template) ComponentVisitInformation about visitors visiting a Component, used in the Communication Statistics product DynamicLinkInfoThe properties of a dynamic link ExtensionDataRendering instructions related to custom content you add during publishing (if TYPE_NAMEhas this value,STORAGE_IDmust refer to a database, not a file system)MetadataThe metadata of items, including binary variants and link information PageA Page PersonalizationData related to Personalization & Profiling functionality PublicationA Publication QueryA Query used for Intelligent Navigation TaxonomyA Taxonomy TimeframeA Timeframe, as used in Personalization & Profiling TrackedPageA Tracked Page, as used in Personalization & Profiling XSLTAn Dynamic Template containing an XSLT stylesheet
You now override the default storage and caching behavior configured in theItemTypesbehavior, as specified. - You can change whether or not items of a certain type are cached. To do this, insert an
- Optional: Change the transaction timeout value by adding a
<Transaction>element directly after theStorageselement and before the</Global>closing tag. The following example sets the timeout value to 240000 ms (4 minutes):... </Storages> <Transaction Timeout="240000" MonitorInterval="5000" /> </Global>The Storage Layer has a default timeout value of 2 minutes for transactions to the storage system. If you intend to store larger data sets, such as a large taxonomy containing 150,000 Keywords or more, this default timeout value is insufficient (4 minutes would be a better value in this example.)
Note: TheMonitorIntervalspecifies how often to check for pending transactions. The default5000is usually a good value. - Save and close the
cd_storage_conf.xmlfile. - Assuming that the Storage Layer is running as part of a Web application, restart the Web application according to the instructions of your Web application server. In IIS, for example, perform an
iisreset.
What to do next
- Configuring storage for the Experience Manager Web service
You need to edit the Storage Layer configuration file used by the Content Delivery Experience Manager Web service to configure Experience Manager to store session data in a dedicated database. If you have two or more staging environments, you can also configure load balancing. - Configuring storage for the Experience Manager Web site extension
You need to edit the Storage Layer configuration file used by the staging Web site to configure the Experience Manager Web site extension to store session data in the dedicated database you created earlier. If you have two or more staging environments, you can also configure load balancing, but that does mean that you need to use a dedicated database.