(As collected from our gracious friends on the Slide mailing lists)

Configuring a single NameSpace/Slide Server with multiple Stores

Goal:

Dependencies:

What will be changed:

Adding a new store: You can add (to my knowledge) an unlimited number of additional stores pending your hardware. You must keep one store as a root store, "/", that the rest of the stores will be children of (otherwise you will get an error describing something along those lines).

Example is worth more than me talking, so here we go:

<slide>
    <namespace name="slide">
        <definition>
<!--default store from distribution, can change if you want-->
            <store name="tx">
             ....
            </store>
<!--Aha! A new store!-->
            <store name="mysecondstore">
                <parameter name="tlock-timeout">120</parameter>
<!--Don't forget to configure the location of your new store-->
                <nodestore classname="org.apache.slide.store.txfile.TxXMLFileDescriptorsStore">
                    <parameter name="rootpath">newstore/metadata</parameter>
                    <parameter name="workpath">newwork/metadata</parameter>
                    <parameter name="defer-saving">true</parameter>
                    <parameter name="timeout">120</parameter>
                </nodestore>
                <sequencestore classname="org.apache.slide.store.txfile.FileSequenceStore">
                    <parameter name="rootpath">newstore/sequence</parameter>
                </sequencestore>
                <securitystore>
                    <reference store="nodestore"/>
                </securitystore>
                <lockstore>
                    <reference store="nodestore"/>
                </lockstore>
                <revisiondescriptorsstore>
                    <reference store="nodestore"/>
                </revisiondescriptorsstore>
                <revisiondescriptorstore>
                    <reference store="nodestore"/>
                </revisiondescriptorstore>
<!--Don't forget to configure the location of your new store-->
                <contentstore classname="org.apache.slide.store.txfile.TxFileContentStore">
                    <parameter name="rootpath">newstore/content</parameter>
                    <parameter name="workpath">newwork/content</parameter>
                    <parameter name="defer-saving">true</parameter>
                    <parameter name="timeout">120</parameter>
                </contentstore>
                <!-- uncomment if you want to use the sample Indexer -->
                <!-- be sure to have Lucene in your classpath-->
                <!--
                <contentindexer
classname="org.apache.slide.index.SampleTxtContainsIndexer">
                <parameter name="indexpath">./newindex</parameter>
                </contentindexer>
                -->
            </store>
<!--Aha! End of the new store!-->

For more stores, simply rinse and repeat the above!

Configure the scope of new stores: Now that a new store is configured, need to add the scope to have it visisble. This is pretty trivial, just use common sense:

<slide>
    <namespace name="slide">
        <definition>
             ....
             </store>
             <scope match="/" store="tx"/>
             <scope match="/newstorescope" store="mysecondstore"/>

So far, you can choose to configure the <scope> tags either directly underneath each store, or all the <scope> tags at the bottom of configuring all your stores at this time. Soon there will be a standard and expectation, but for now lasse faire.

Configure data objectnode for scope: This section could use a lot more detail, and the example is not recommended for production as, at of this writing, I do not understand the ACL schemantics related to stores and sub-stores.

<slide>
    <namespace name="slide">
        <definition>
         ....
         </definition>
         <configuration>
         .....
         </configuration>
         <data>
        <data>
<!--this is the root node. the 'uri' attribute points to the scope configured previously-->
            <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
                <permission action="all" subject="/roles/root" inheritable="true"/>
                <permission action="/actions/read-acl" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/write-acl" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/unlock" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/read" subject="all" inheritable="true"/>
                 ....(probably should have all the user, role, and other security objectnodes run first)....
<!--my new store (or sub-store rather)-->
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/newstorescope">
                    <permission action="all" subject="unauthenticated" inheritable="true"/>
                    <!--
                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
                    -->
                </objectnode>
<!--close my new store above tag, close root node tag below-->
             </objectnode>

Nonetheless, these examples should help get you started!

As always, have fun and detailed feedback is always welcome!

-D

Additional Configuration Notes

Based on some work we have been doing, we have developed a number of configuration guidelines and samples. Now available here - MultipleStoresWithSamples

MultiStoreConfig (last edited 2009-09-20 22:02:50 by localhost)