Gossamer Forum
Home : Products : DBMan : Customization :

Huge records,need help

Quote Reply
Huge records,need help
Hi,
I'm testing my database now. With 17 records, my database is abut 5KB. Each record has
about 40 items and 4-5 choices to choose from. I've figured out my database will hold
1024/5*17 = 3480 records for 1 MB.
But i'm planning to have more than 50,000 members for my site. 3480 records will
only good for a month the most. What can I do?
I've most database fuctions done now with your help =>
If i use dbman now and wanna do a complex database (like relational and msSQL),
can i intergate/move dbman into the new database system later.
Or will I have to redo the whole database and learn everything all over again.
If I wanna do a relational database using all the fuctions I have learn from dbman,
what should I do now ?
Quote Reply
Re: Huge records,need help In reply to
As I recommended to you before...you will need to use DBMAN SQL.

Quote:
can i intergate/move dbman into the new database system later.

Yes.

Quote:
Or will I have to redo the whole database and learn everything all over again.

You will have to learn SQL commands to open the MySQL tables to read and write from it.

Quote:
If I wanna do a relational database using all the fuctions I have learn from dbman,

Again...the SQL version is your best bet.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Huge records,need help In reply to
I agree with Eliot completely here. With the database size you're working with, you can use dbman, but you're going to have lots of problems once your file gets over 2MB. (Until 2meg, you're mostly just going to have slow access).

With the SQL version, the sky's virtually the limit. However while you're just testing, the non-SQL version should work well for you right now, again up to 1 or 2 megs, tops.

--Lee
Quote Reply
Re: Huge records,need help In reply to
Here is a quick and dirty example:

1) Switch subs in the html.pl file:

Database #1

Code:
sub switch_to_data1 {
#-----------------------------------------------------
@db_cols = qw(ID Field1 Field2 Field3);
$db_file_name = "/absolute/path/to/database1.db";
}

Database #2

Code:
sub switch_to_data2 {
#-----------------------------------------------------
@db_cols = qw(ID Field1 Field2 Field3);
$db_file_name = "/absolute/path/to/database2.db";
$db_key_pos = 0;
}

Database #3

Code:
sub switch_to_data3 {
#-----------------------------------------------------
@db_cols = qw(ID Field1 Field2 Field3);
$db_file_name = "/absolute/path/to/database3.db";
$db_key_pos = 0;
}

Database #4

Code:
sub switch_to_data4 {
#-----------------------------------------------------
@db_cols = qw(ID Field1 Field2 Field3);
$db_file_name = "/absolute/path/to/database4.db";
$db_key_pos = 0;
}


2) Switch calls in the html_record sub-routine:

Code:
my (%rec) = &get_record ($rec{'ID'});
&switch_to_data4;
my (%rec) = &get_record ($rec{'ID'});
&switch_to_data3;
my (%rec) = &get_record ($rec{'ID'});
&switch_to_data2;
my (%rec2) = &get_record ($rec{'ID'});
&switch_to_data1;

Then use the following types of codes in that sub:

For Database1

Code:
$rec{'Field'}

For Database2

Code:
$rec2{'Field'}

For Database3

Code:
$rec3{'Field'}

For Database4

Code:
$rec4{'Field'}


Follow the instructions in the Relational Mod instruction page.

Keep in mind that at any time you want to move to the SQL version of LINKS, it will take you longer to upgrade the multiple flat file database files in the MySQL tables. You will have to run four separate upgrade processes to put the data into four different tables...and also re-work the db.cgi file to use SQL commands to pull data from the four different tables.

(It is a lot easier to upgrade with one flat file to SQL, than multiple files.)

Good luck.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.




[This message has been edited by AnthroRules (edited April 17, 2000).]
Quote Reply
Re: Huge records,need help In reply to
Thanks Eliot!! Smile
i will try and tell you later

Thank!
Quote Reply
Re: Huge records,need help In reply to
Thanks for both of you Smile
Ithink i will try to use the Relational DBman first to see how it goes.
One more thing,is it possible to switch over more than 2 Database ?? i just looked at the relational Mod only telling me how to switch over two Database. Can it switch over 4 Database???

Thanks
Quote Reply
Re: Huge records,need help In reply to
that shouldn't be a problem. Just repeat the steps for adding additional databases.

--Lee
Quote Reply
Re: Huge records,need help In reply to
thanks leisurelee,
Could you give me a example ???
THanks
Quote Reply
Re: Huge records,need help In reply to
You're welcome.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.