aspose file tools*
The moose likes JDBC and the fly likes Generalization to design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Generalization to design" Watch "Generalization to design" New topic
Author

Generalization to design

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 732
Hello,

There are nine modules of the website and each module has:

1) Location i.e. Region, Country and City
2) Category
3) Status
4) User Preferences
5) User Favorites

Option-A:
I generalized these modules (from point 1-5) and added a table WebsiteSection and then created sub tables to save point 1-5 listed above. The design became neat and clean

Option-B:
I am thinking to repeat point 2 to 5 for each module

I am confused if I generalize all modules then even my design became neat and clean and but:
(i) Users load will effect efficiency of data retrieval
(ii) If problem occur in master or detail table then all modules will be down
(iii) SQL query will be so complex
(iv) If tomorrow load become too much and there is a need of hosting different modules on different dedicated servers then will be very difficult to isolate the coded modules

I stuck between these two separate options (option-A & option-B). Please advise whether I go to Option-A or Option-B?

Thanks & best regards
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30762
    
156

Generally, you start with a clean design and only change it for proven performance. How many users are you expecting? How many preferences/favorites/etc? This will tell you how many rows in the tables. Then you can create a simulated table, added indexes and see what the performance is really like for a query.

I suspect it will be equivalent. Performance shows up in order of magnitude differences. A ninth of the data is just barely one order of magnitude.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30762
    
156

Also, why would the SQL be so much more complex with option A? I would expect just one more where clause for the module type.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 732
Thank you very much. You helped me to choose one option and saved my too much time

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generalization to design