i'm working on a 'virtual catalog' project that requires building some kind of
'directory tree' inside a DB. There are stored 'categories' and 'items'. Each 'item'
has a number of attributes, different for each category.
here is an illustration that should explain it all:
base/
persons/
kids/
jim # name, surname, birth, mom_name, pap_name,
tim # sister_name, brother_name, ....
john #
grown_ups/
bob # name, surname, birth, salary, company,
rob # phone_no, fax_no, email, homepage, ...
books/
manuals/
linux # pages_no, authors, edition, cover_photo,
math # editure, pub_year, ....
geography #
dictionaries/
greek # terms_no, editure, editure, pub_year ...
latin #
arabic #
sf/
dune # pages_no, volumes, editure, author, pub_year
foundation # prizes, rating, ...
ubik #
computers/
workstations/
john's # owner, os, monitor, video, ram, ip, location,
mine # hdd, cpu, keyb, mouse, ...
his #
servers/
alpha # location, ip_list, os, ram, cpu, hdd, services
beta # ...
gamma #
ok, so I have all these different 'things' that should live together in the same eclectic catalog. I want to be able to do complex but still fast searching all around this db. The scalability range I would like to be somewhere near thousands of categories and thousands of unique items in each category.
how to organize it? As I see it at this moment there are two main solutions:
What would be the best database design for such a thing, keeping in mind that searching through this db should be as fast as possible? Also remember that attributes may differ a lot in number (and size).
The first solution I think it's crappy and wouldn't like to go on with it. The second is the one that I have already implemented and the results are pretty good until now, but I haven't yet had the time to build up some real stress test scenarios so I don't know for now what could happen when I would reach to 1K categories and 1K items in each category =)
heh, I haven't mentioned the DBMS because I wouldn't like to get some particular solutions optimised for xSQL or ySQL ;-) ... yet, ofc, notices regarding implementation flaws on i.e. mySQL or PostgreSQL or whatsoever are welcome
--
AltBlue.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |