You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by danisevsky <da...@gmail.com> on 2012/10/16 13:23:06 UTC

How to store binary data?

Hi all,

I am using Jackrabbit for storing photos. Users can read and upload
photos. Current size of workspace is about 100GB and my repository
configuration looks like this:

<Repository>
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${rep.home}/repository"/>
    </FileSystem>
    ...
    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
    <Workspace name="${wsp.name}">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
		    <param name="blobFSBlockSize" value="0"/>
		    <param name="minBlobSize" value="4096"/>
		    <param name="errorHandling" value=""/>
        </PersistenceManager>
        ...
    </Workspace>
    ...
</Repository>

Now I am quite confused because I read that BundleFsPersistenceManager
is not meant to be used in production environments (except for
read-only uses) [1].
Could someone tell me what I should to use? Is DataStore [2] suitable
filesystem (I do not think that store photos in DB is good option)
solution for production use? And how to migrate all data? I am using
Jackrabbit 2.5.1.

I would be very thankful for explanation.

[1] http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ
[2] http://wiki.apache.org/jackrabbit/DataStore

Re: How to store binary data?

Posted by Nicolas Peltier <np...@adobe.com>.
You might create another workspace in the same repository, with different
persistence manager, and try to fetch the data from the original workspace?

On 10/16/12 3:04 PM, "danisevsky" <da...@gmail.com> wrote:

>Thank you Nicolas, now it is more obvious for me. So I think I made a
>big mistake when i choose BundleFsPersistenceManager. Is it possible
>to migrate my data from BundleFsPersistenceManager to for example
>MySqlPersistenceManager?
>
>Thanks a lot.
>
>2012/10/16 Nicolas Peltier <np...@adobe.com>:
>> Hi,
>>
>> Persistence manager and datastore are two different things in
>>jackrabbit,
>> the first is for persisting hierarchy, alphanumeric properties, and
>>binary
>> properties smaller than iirc 4KB per default (configurable), the second
>>is
>> for storing binary properties bigger than that threshold.
>> This means that your photo (bigger than 4b) will have a track in the
>> persistence manager (which can be e.g. DerbyPM), and one in the
>>datastore.
>>
>> Hope this helps,
>> Nicolas
>>
>> On 10/16/12 1:23 PM, "danisevsky" <da...@gmail.com> wrote:
>>
>>>Hi all,
>>>
>>>I am using Jackrabbit for storing photos. Users can read and upload
>>>photos. Current size of workspace is about 100GB and my repository
>>>configuration looks like this:
>>>
>>><Repository>
>>>    <FileSystem
>>>class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>>>        <param name="path" value="${rep.home}/repository"/>
>>>    </FileSystem>
>>>    ...
>>>    <Workspaces rootPath="${rep.home}/workspaces"
>>>defaultWorkspace="default"/>
>>>    <Workspace name="${wsp.name}">
>>>        <FileSystem
>>>class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>>>            <param name="path" value="${wsp.home}"/>
>>>        </FileSystem>
>>>        <PersistenceManager
>>>class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistence
>>>Ma
>>>nager">
>>>                   <param name="blobFSBlockSize" value="0"/>
>>>                   <param name="minBlobSize" value="4096"/>
>>>                   <param name="errorHandling" value=""/>
>>>        </PersistenceManager>
>>>        ...
>>>    </Workspace>
>>>    ...
>>></Repository>
>>>
>>>Now I am quite confused because I read that BundleFsPersistenceManager
>>>is not meant to be used in production environments (except for
>>>read-only uses) [1].
>>>Could someone tell me what I should to use? Is DataStore [2] suitable
>>>filesystem (I do not think that store photos in DB is good option)
>>>solution for production use? And how to migrate all data? I am using
>>>Jackrabbit 2.5.1.
>>>
>>>I would be very thankful for explanation.
>>>
>>>[1] http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ
>>>[2] http://wiki.apache.org/jackrabbit/DataStore
>>


Re: How to store binary data?

Posted by danisevsky <da...@gmail.com>.
Thank you Nicolas, now it is more obvious for me. So I think I made a
big mistake when i choose BundleFsPersistenceManager. Is it possible
to migrate my data from BundleFsPersistenceManager to for example
MySqlPersistenceManager?

Thanks a lot.

2012/10/16 Nicolas Peltier <np...@adobe.com>:
> Hi,
>
> Persistence manager and datastore are two different things in jackrabbit,
> the first is for persisting hierarchy, alphanumeric properties, and binary
> properties smaller than iirc 4KB per default (configurable), the second is
> for storing binary properties bigger than that threshold.
> This means that your photo (bigger than 4b) will have a track in the
> persistence manager (which can be e.g. DerbyPM), and one in the datastore.
>
> Hope this helps,
> Nicolas
>
> On 10/16/12 1:23 PM, "danisevsky" <da...@gmail.com> wrote:
>
>>Hi all,
>>
>>I am using Jackrabbit for storing photos. Users can read and upload
>>photos. Current size of workspace is about 100GB and my repository
>>configuration looks like this:
>>
>><Repository>
>>    <FileSystem
>>class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>>        <param name="path" value="${rep.home}/repository"/>
>>    </FileSystem>
>>    ...
>>    <Workspaces rootPath="${rep.home}/workspaces"
>>defaultWorkspace="default"/>
>>    <Workspace name="${wsp.name}">
>>        <FileSystem
>>class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>>            <param name="path" value="${wsp.home}"/>
>>        </FileSystem>
>>        <PersistenceManager
>>class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceMa
>>nager">
>>                   <param name="blobFSBlockSize" value="0"/>
>>                   <param name="minBlobSize" value="4096"/>
>>                   <param name="errorHandling" value=""/>
>>        </PersistenceManager>
>>        ...
>>    </Workspace>
>>    ...
>></Repository>
>>
>>Now I am quite confused because I read that BundleFsPersistenceManager
>>is not meant to be used in production environments (except for
>>read-only uses) [1].
>>Could someone tell me what I should to use? Is DataStore [2] suitable
>>filesystem (I do not think that store photos in DB is good option)
>>solution for production use? And how to migrate all data? I am using
>>Jackrabbit 2.5.1.
>>
>>I would be very thankful for explanation.
>>
>>[1] http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ
>>[2] http://wiki.apache.org/jackrabbit/DataStore
>

Re: How to store binary data?

Posted by Nicolas Peltier <np...@adobe.com>.
Hi,

Persistence manager and datastore are two different things in jackrabbit,
the first is for persisting hierarchy, alphanumeric properties, and binary
properties smaller than iirc 4KB per default (configurable), the second is
for storing binary properties bigger than that threshold.
This means that your photo (bigger than 4b) will have a track in the
persistence manager (which can be e.g. DerbyPM), and one in the datastore.

Hope this helps,
Nicolas

On 10/16/12 1:23 PM, "danisevsky" <da...@gmail.com> wrote:

>Hi all,
>
>I am using Jackrabbit for storing photos. Users can read and upload
>photos. Current size of workspace is about 100GB and my repository
>configuration looks like this:
>
><Repository>
>    <FileSystem 
>class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>        <param name="path" value="${rep.home}/repository"/>
>    </FileSystem>
>    ...
>    <Workspaces rootPath="${rep.home}/workspaces"
>defaultWorkspace="default"/>
>    <Workspace name="${wsp.name}">
>        <FileSystem
>class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>            <param name="path" value="${wsp.home}"/>
>        </FileSystem>
>        <PersistenceManager
>class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceMa
>nager">
>		    <param name="blobFSBlockSize" value="0"/>
>		    <param name="minBlobSize" value="4096"/>
>		    <param name="errorHandling" value=""/>
>        </PersistenceManager>
>        ...
>    </Workspace>
>    ...
></Repository>
>
>Now I am quite confused because I read that BundleFsPersistenceManager
>is not meant to be used in production environments (except for
>read-only uses) [1].
>Could someone tell me what I should to use? Is DataStore [2] suitable
>filesystem (I do not think that store photos in DB is good option)
>solution for production use? And how to migrate all data? I am using
>Jackrabbit 2.5.1.
>
>I would be very thankful for explanation.
>
>[1] http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ
>[2] http://wiki.apache.org/jackrabbit/DataStore