1

We are running into the notorious 1000+ child node issue in the JCR for users, and we are trying to provide a solution without moving to a SSO or LDAP solution as the client does not have the budget for such a solution.

Given the little documentation available for BTreeManager, I was wondering if there is a way to implement BTreeManager with UserManager to handle account creation and sign in, or will we have to create our own UserManager class to handle account creation with a BTreeManager implementation?

1 Answers1

1

I would not recommend you in anyway to implement your own UserManager as it completely overshoots the mark. The UserManager provides you already the possibility to use an existing intermediate path which can be e.g. created eiither by some custom algorithm or the BTreeManager.

I have good experience this approach e.g. in an AEM environment with around 110k users (still growing). In this case we used the username to generate an intermediate path:

/home/users/project-prefix/[first-char][second-char]/[third-char][fourth-char]/[username]

If you prefer to leverage the BTreeManager to take care of a balanced usertree, then better encapsulate your custom functionality in a custom "AccountCreationService" which uses the BTreeManager to create an intermediate path for each user and delegates the actual creation of the Authorizable to the UserManager.

Thomas
  • 1,302
  • 9
  • 16
  • So it is possible, but is there an example of how to use BTreeManager? We are not even considering building our own UserManager - just asked if we needed to. Against my judgement our initial approach was similar to yours, but only went two characters deep - /[first-char]/[second-char]/[usernode]. This backfired horribly. I have constructed a new intermediate path comprised of 2-char substring sets of an MD5 hash of the timestamp at account creation. e.g.: /home/users/project/e2/81/ca/5c/b7/[usernode]. – ImKevinJones Feb 19 '15 at 20:53
  • 1
    I'm afraid I have not seen any example on how to use the BTreeManager in the web, except the API docs. But it does not tell anything about the costs of initialization. I would likely build a service that keeps the tree in memory, but then you have to think of incorporating change events into your service as well. Better go for the path approach. I was using 3 character segments for my mentioned use case with 100k users and it worked quite nicely. But we evaluated the user distribution among those segments, prior to the decision wether to use 2 or 3 characters. – Thomas Feb 20 '15 at 10:23