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