Expand my Community achievements bar.

Redesigning a relational database within a JCR

Avatar

Level 3

Hi everyone,

I am working on my first AEM web application and it involved importing a simple relational database into JCR. I read that having 1000 child nodes in the same folder is bad practice so I decided to redesign the table. The following is the approach I am taking:

The app is a simple web form that has two parameters; Zipcode and ProductLine. These two parameters in tandem will form a unique node path. The path is formed as /content/myapp/database/master/zipcode/productline. However the zipcode is broken into 5 subfolders depending on the digit rather than the zipcode. So if  my request was{ZIP Code :55002, ProductLine : 9}, the servlet would translate that into a path to /content/myapp/database/master/5/5/0/0/2/9.

The node at the end of this path is named after a Distributor ID which is a reference to a node with properties in /content/myapp/database/distributor which is what the response is created with.

There is about 250,000 rows in the master table which are all references to distributors with keys <ProductLine, Zipcode>, and about 40 distributors in the distributor table.

Is this an okay approach or am I creating too much overhead?

Thank you!

3 Replies

Avatar

Level 10

Why are you converting the Database to JCR - AEM supports database operations using a DataSourcePool. Just want to make sure you know that. 

Avatar

Level 3

My company wants to migrate the database off of the server that it is currently running on by moving the database and linked applications into AEM

Avatar

Level 10

OK - I just wanted to point out that AEM is flexible and does support database operations.