Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Design how to display 10+K node large hierarchy structure

hi,

I have a design problem that needs some suggestions in it.

I need to show a large tree to the client for selection. The tree is so large that contains 10K nodes. If I store the tree in the session, it is not good for scalability. Besides, pulling out too much data from database at once may not be good as well. I am open for suggestion to minimize the impact to my site. If there is link to some products or open source project that will be great! I want to focus on performance and scalability. Technologies are open for suggestion, like applet, javascript, DHTML, Servlet...

thanks

ray

0
rayhon88
Asked:
rayhon88
1 Solution
 
CEHJCommented:
>>If I store the tree in the session, it is not good for scalability.

In what way?
0
 
bloodredsunCommented:
Does the tree-structure change between users?

If it doesn't, put it in the application scope?

If you can't, look at caching like osCache from opensymphony http://www.opensymphony.com/oscache/ which alows you to store data in session scope but for a shorter period than the duration of the session, e.g. in the session scope but only for 6 minutes.
0
 
rayhon88Author Commented:
hi, CEHJ

Because it is in the clustered environment. If I put a tree with 10K of nodes in the session, it will be very costy for session in-memory replication.

ray

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
java_devCommented:
It sounds to me like you are describing requires a lazy loader. Rather than load the entire tree from the database, just get those records that the user cares about. This would involve initially showing the children of the root node, and then when the user selects one of those nodes, you retrieve the information from the database for that node's children.

If you don't want to build this yourself, you might be able to find a open source or commercial widget to do this. I did a very brief search for "lazy load jsp tree" and found this link...

http://www.jscape.com/webgalileofaces/

It uses JSF, and I can't say for sure if it will work for you. It does support both lazy loading on the client and the server. Here's the link for it's tree features http://www.jscape.com/webgalileofaces/tree.html

Good luck
0
 
rayhon88Author Commented:
I decide to drop the tree approach. In exchange, I use the window-like UI.

     A
   /  /\
  B  C  D
     /|\
    E F G
       |
       H


node C will be display as:

A/B/C <-- a path which is clickable, that can be used to go back to the previous node
------------
E
F  <-- display folder image means it has children
G

With this display, i can use lazy loading approach. Subnodes are loaded when the folder is clicked.

However, I need to do some manipulation like selecting a node and move it to the right panel. The drawback is each click on the arrow will trigger a round trip to the server. and the state of the right hand panel need to put in the session.

=========================
|                   |               |                |
|                   |               |                |
|                   |       >      |                |
|                   |               |                |
|                   |       <      |                |
|                   |               |                |
|                   |               |                |
=========================

any comment of the new design?

thanks

ray




0
 
java_devCommented:
I like the "path" approach, not only does it give you lazy loading, but also gives your user a way to return to any one of the previous "parent" nodes.

As far as the "round trip to the server" issue, perhaps you could use cookies to store the "selection", rather than putting it into the session. Once the user is done selecting nodes, you can provide a "finish" button that the user presses, which when submitted uses the cookie value (which contains all of the user selections). You would only need to store the values of the node ID's in the cookie, and you only need one cookie for all the nodes. This cookie could contain a comma separated list of node ID's (or whatever separator you care to use).

0
 
rayhon88Author Commented:
good to know that you like this approach. However, to leverage cookie may not be ok b/c we don't know whether users have turned off the cookie. I want to have a solution that works without relying on anything that may cause problem in the user side.

ray
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now