Platform Administration and Architecture

Configure Content Delivery roles for separate EventQueue and Properties tables

Abstract

How to configure Sitecore Content Delivery roles to use EventQueue and Properties tables in a database separate from the local Web database.

You can configure Content Delivery (CD) roles to use EventQueue and Properties tables stored in a different database than their local Web database. This can be necessary in several scenarios including when replicating the Web database using Azure active geo-replication.

To configure CD roles for separate EventQueue and Properties tables:

  1. In the App_Config/ConnectionStrings.config file, add an additional connection string for the new database:

    <add name="CONNECTION_STRING_NAME" connectionString="Data Source=HOSTNAME;Initial Catalog=DATABASE;User ID=USER;Password=PASSWORD" />
  2. In the App_Config/Include/ folder, create a folder and name it, for example, MyPatchFiles/.

  3. In the App_Config/Include/MyPatchFiles/ folder, create a configuration patch file and name it, for example, DedicatedEventQueueProvider.config.

  4. In the DedicatedEventQueueProvider.config file, insert the following code and configure EventQueue to use the new database connection string by changing the param1 attribute:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <sitecore>
            <eventing defaultProvider="sitecore">
                <eventQueueProvider defaultEventQueue="core">
                    <eventQueue name="web" type="Sitecore.Data.Eventing.$(database)EventQueue, Sitecore.Kernel">
                        <param ref="dataApis/dataApi[@name='$(database)']" param1="CONNECTION_STRING_NAME" patch:instead="*[@param1='$(name)']"/>
                    </eventQueue>
                </eventQueueProvider>
            </eventing>
        </sitecore>
    </configuration>
  5. In the App_Config/Include/MyPatchFiles/ folder, create a configuration patch file and name it, for example, DedicatedPropertyStoreProvider.config.

  6. In the DedicatedPropertyStoreProvider.config file, insert the following code and configure PropertyStore to use the new database connection string by changing the param1 attribute:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <sitecore>
            <PropertyStoreProvider defaultStore="core">
                <store name="web" prefix="web" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.$(database)PropertyStore, Sitecore.Kernel">
                <param ref="dataApis/dataApi[@name='$(database)']" param1="CONNECTION_STRING_NAME" patch:instead="*[@param1='$(name)']" />
                </store>
            </PropertyStoreProvider>
        </sitecore>
    </configuration>