25,000行是什麼到MySQL或這種情況下的平面文件。最初不要擔心數據量。我從事過許多零售數據庫模式,產品通常由靜態或任意長度的一組屬性定義。您的數據量結束時不會太遠。
靜態:
create table products (
product_id integer primary key auto_increment
, product_name varchar(255) -- or whatever
, attribute1_id -- FK
, attribute2_id -- FK
, ...
, attributeX_id -- FK
);
create table attributes (
attribute_id integer primary key -- whatever
, attribute_type -- Category?
, attribute_value varchar(255)
);
或者,你明明:
create table products (
product_id integer primary key auto_increment
, product_name varchar(255) -- or whatever
);
create table product_attributes (
product_id integer
, attribute_id integer
, -- other stuff you want like date of assignment
, primary key (product_id , attribute_id)
);
create table attributes (
attribute_id integer primary key -- whatever
, attribute_type -- Category?
, attribute_value varchar(255)
);
我會毫不猶豫地推幾百萬元的記錄到喜歡的方式的基本結構。
Xepoch,謝謝你的迴應。這是非常有用的,我會在開始開發這個數據庫時參考你的建議。正如我對mysql和數據庫格式的新手一樣,有經驗的老手幫助我很好。 – SubxZero