Hi Jorge,
On Fri, Feb 21, 2020 at 3:40 PM jorgeeflorez . <[email protected]>
wrote:
> Hi Matt, thanks a lot for your answer.
>
> If your storage is "local" (meaning it appears as a local filesystem to
> > Oak), I'd probably use OakFileDataStore. It implements SharedDataStore
> so
> > you can share the same location with multiple instances. For example if
> > you create a file share on a NAS and then mount that share on multiple
> > servers - even though the storage is across the network, it is mounted in
> > the filesystem and appears local. OakFileDataStore should work well for
> > this purpose.
>
>
> I think this would be the case: I will have one or more servers, each one
> with one or more Oak instances (we handle several repositories), all
> "using" the same file store. One customer has those servers in the same
> intranet and another has them in Amazon. But in both cases I could mount a
> folder that would be "visible" to all servers, right?
>
Just be sure that any Oak instances sharing the same file location belong
to the same logical cluster.
Sharing the same file location between multiple logical instances should
"work", but certain capabilities like data store GC won't work well in that
scenario.
That doesn't mean you need a separate file server for each Oak cluster
though. One location per cluster should work fine - they could be
different shares on the same server, or even different folders in the same
share.
One question though - you said one customer has servers in Amazon (I assume
EC2). Where are they planning to store their binaries - in file storage
mounted by the VM or in S3? They may wish to consider using an S3 bucket
instead and using S3DataStore - might cost less.
>
> Do you think it would be best to use OakFileDataStore over, for example
> CachingFileDataStore? to keep things "simple"?
>
TBH I don't see what caching gives you in this scenario. The caching
implementation will maintain a local cache of uploaded and downloaded
files; the intent would be to improve latency, but caches also always add
complexity. With OakFileDataStore the files are already "local" anyway -
even if across a network I don't know how much the cache buys you in terms
of performance.
>
> As for DataStoreBlobStore - DataStoreBlobStore is a wrapper around a class
> > that implements DataStore to make it look like a BlobStore.
> >
> > I have been using something like this to setup my repository, I do not
> know if there is another way...
>
> FileDataStore fds = new FileDataStore();
> File dir = ...;
> fds.init(dir.getAbsolutePath());
> DataStoreBlobStore dsbs = new DataStoreBlobStore(fds);
> DocumentNodeStore docStore = new MongoDocumentNodeStoreBuilder().
> setMongoDB("mongodb://user:password@" + host + ":" +
> port, "repo1", 16).
> setClusterId(123).
> setAsyncDelay(10).
> setBlobStore(dsbs).
> build();
>
>
That looks like the right idea - other than I'd use OakFileDataStore
instead of FileDataStore.
-MR