javajackrabbit-oak

Jackrabbit Oak scaling client apps against same repository


For a webapp deployment architecture it was decided to try make it simple and employ uniform horizontal scaling -- have n machines, each machine has identical and full set of components. These machines are not responsible for the relational database that lives somewhere else, however they are responsible for file storage. The initial idea was such: have a network shared drive, mounted into each machine, and then the web application in each machine uses jackrabbit-oak (using node store created through new SegmentNodeStore(new FileStore(....))) to operate on a repository inside this network shared drive.

Turns out this doesn't work. One application successfully creates the node store, but it locks the journal file and other applications are stuck waiting. So if user request gets routed to machine-1 which has created the node store, it works. If user request got routed to machine-2 instead, file operations aren't working. An immediate thought was to instead of having node store that lives through entire application span, instead open and close the store for each request. But that's not good enough either; if someone starts long download from machine-1 and a different request with files comes to machine-2, now the machine-2 is stuck waiting for an hour.

Is it possible to solve this issue with plain repository files, without delegating to mongo / s3 / etc.?


Solution

  • No, the segment node store does not support clustering.