Well, indeed I've heard that recommendation over and over again... but did you make tests with thousands of nodes and got bad performance? Or, did you make tests with both approachs and got better performance with createFolderPathForUser instead of using simply the ID 'as is'?
I don't know about the 'cost' of doing such tests though, but I'd try 'em quickly because using the ID directly as the 'key' is far simpler than manipulating the ID everytime (which is also time consuming, even if computers do compute very fast). Just an idea. I'll let other, more experienced, JackRabbit guys jump in here if they have better ideas (I'm sure some will). El 27/11/10 08:50, danisevsky escribió: > Users may be tens of thousands and I think it is recomended "go deep" > instead of "go wide". > > 2010/11/27 Fabián Mandelbaum <[email protected]>: > >> El 27/11/10 08:01, danisevsky escribió: >> >>> Hello, I have users stored in relational db. Each user has its own >>> jacrabbit folder in which are photos, comments, etc. Folder is created >>> after user registration. I do not know how to best create path to this >>> folder. I am thinking about this algorithm: >>> >>> public static String createFolderPathForUser(User user) { >>> StringBuilder path = new StringBuilder(); >>> String uuid = UUID.randomUUID().toString(); >>> String shorterUUID = uuid.substring(0, 10); >>> char[] chars = new char[shorterUUID.length()]; >>> shorterUUID.getChars(0, shorterUUID.length(), chars, 0); >>> for (int i = 0; i < chars.length; i++) { >>> path.append(chars[i] + "/"); >>> } >>> path.append(user.getId()); >>> return path.toString(); >>> } >>> >>> which get for user with id=123 e.g. this path: >>> >>> 1/4/c/9/6/7/b/c/-/e/123 >>> >>> and this path save to user field in relational db. >>> >>> Is it good solutions? A have not much experiences with jackrabbit. >>> >>> Thanks. >>> >>> >> Hello, >> >> why not just /users/123 ? >> >>
